@Test
public void testUnaryIncDecLiveCodeRemoval() throws Exception {

  final String program = "void main() {"
        + "  int GLF_live0c;"
        + "  GLF_live0c++;"
        + "  ++GLF_live0c;"
        + "  GLF_live0c--;"
        + "  --GLF_live0c;"
        + "}";
  final String reducedProgram = "void main() {"
        + "  int GLF_live0c;"
        + "}";
  final TranslationUnit tu = ParseHelper.parse(program);
  List<? extends IReductionOpportunity> ops =
        StmtReductionOpportunities.findOpportunities(MakeShaderJobFromFragmentShader.make(tu),
            new ReducerContext(false, ShadingLanguageVersion.ESSL_100,
                new RandomWrapper(0), new IdGenerator()));
  assertEquals(4, ops.size());
  for (int i = 0; i < ops.size(); i++) {
    assertTrue(ops.get(i) instanceof StmtReductionOpportunity);
    ops.get(i).applyReduction();
  }
  assertEquals(PrettyPrinterVisitor.prettyPrintAsString(ParseHelper.parse(reducedProgram)),
        PrettyPrinterVisitor.prettyPrintAsString(tu));
}