@Test
public void testDoNotReduceIfPreservingSemantics() throws Exception {

  final String original = "void main() {\n"
      + " if (" + Constants.GLF_DEAD + "(false)) {\n"
      + "  switch (0) {\n"
      + "   case 0:\n"
      + "    return;\n"
      + "  }\n"
      + " }\n"
      + "}\n";
  final TranslationUnit tu = ParseHelper.parse(original);
  final List<VariableDeclToExprReductionOpportunity> ops =
      VariableDeclToExprReductionOpportunities
          .findOpportunities(MakeShaderJobFromFragmentShader.make(tu), new ReducerContext(false,
              ShadingLanguageVersion.ESSL_320,
              new RandomWrapper(0), new IdGenerator()));
  // There should be no opportunities as the preserve semantics is enabled.
  assertTrue(ops.isEmpty());
}