@Test
public void testSwitch1() throws Exception {

  final String prog = "void main() {"
      + "  int y = 2;"
      + "  switch(_GLF_SWITCH(0)) {"
      + "    case 5:"
      + "    y += 1;"
      + "    case 6:"
      + "    case 7:"
      + "    y += 2;"
      + "    case 0:"
      + "    case 1:"
      + "    y += 3;"
      + "    case 42:"
      + "    y += 4;"
      + "    break;"
      + "    case 16:"
      + "    y += 5;"
      + "    default:"
      + "    1;"
      + "  }"
      + "}";
  final String expectedProg = "void main() {"
      + "  int y = 2;"
      + "  switch(_GLF_SWITCH(0)) {"
      + "    case 5:"
      + "    case 0:"
      + "    case 1:" // TODO: get rid of this; doesn't affect semantics.
      + "    y += 3;"
      + "    case 42:" // TODO: get rid of this; doesn't affect semantics.
      + "    y += 4;"
      + "    break;"
      + "    1;" // This gets left over because it used to be the only statement immediately
      // following a case label; the reducer conservatively decides not to remove it.  Now that
      // it does not follow a case label it could be culled by the reducer in the future.
      + "  }"
      + "}";
  final TranslationUnit tu = ParseHelper.parse(prog);
  List<StmtReductionOpportunity> ops = StmtReductionOpportunities
      .findOpportunities(MakeShaderJobFromFragmentShader.make(tu),
          new ReducerContext(false, ShadingLanguageVersion.GLSL_130,
      new RandomWrapper(0), new IdGenerator()));
  for (StmtReductionOpportunity op : ops) {
    op.applyReduction();
  }
  CompareAsts.assertEqualAsts(expectedProg, tu);
}