@Test
public void testReturnsRemovedGlsl100For() throws Exception {

  final String program = "void foo() {"
        + "  for(int i = 0; i < 10; i++) "
        + "    if (i > 5) {"
        + "      return;"
        + "    }"
        + "}";
  final String expected = "void foo() {"
        + "  bool foo_has_returned = false;"
        + "  for(int i = 0; i < 10; i++) {"
        + "    if (foo_has_returned) {"
        + "      break;"
        + "    }"
        + "    if (i > 5) {"
        + "      foo_has_returned = true;"
        + "    }"
        + "  }"
        + "}";
  final TranslationUnit tu = ParseHelper.parse(program);
  final FunctionDefinition fd = findFunctionDefinition(tu, "foo");
  ReturnRemover.removeReturns(fd, ShadingLanguageVersion.ESSL_100);
  CompareAstsDuplicate.assertEqualAsts(expected, tu);
}