@Test
public void testOutline() throws Exception {

  String program = "int _GLF_outlined_1(int x) { return x; }"
      + "void main() { int y; y = _GLF_outlined_1(0); }";
  String programAfter = "int _GLF_outlined_1(int x) { return x; }"
      + "void main() { int y; y = 0; }";
  TranslationUnit tu = ParseHelper.parse(program);
  List<OutlinedStatementReductionOpportunity> ops = OutlinedStatementReductionOpportunities
      .findOpportunities(MakeShaderJobFromFragmentShader.make(tu),
      new ReducerContext(false, ShadingLanguageVersion.ESSL_100,
          new RandomWrapper(0), new IdGenerator()));
  assertEquals(1, ops.size());
  ops.get(0).applyReduction();
  assertEquals(PrettyPrinterVisitor.prettyPrintAsString(ParseHelper.parse(programAfter)),
      PrettyPrinterVisitor.prettyPrintAsString(tu));
}