@Test
public void testDoInlineWhenPreservingSemanticsDeadCode() throws Exception {

  final String shader = "#version 310 es\n"
      + "uniform int u;\n"
      + "void main() {\n"
      + "  u;\n"
      + "  if(" + Constants.GLF_DEAD + "(" + Constants.GLF_FALSE + "(false, false))) {\n"
      + "    u;\n"
      + "  }\n"
      + "}\n";
  final String expected = "#version 310 es\n"
      + "uniform int u;\n"
      + "void main() {\n"
      + "  u;\n"
      + "  if(" + Constants.GLF_DEAD + "(" + Constants.GLF_FALSE + "(false, false))) {\n"
      + "    2;\n"
      + "  }\n"
      + "}\n";
  final TranslationUnit tu = ParseHelper.parse(shader);
  final PipelineInfo pipelineInfo = new PipelineInfo();
  pipelineInfo.addUniform("u", BasicType.INT, Optional.empty(), Collections.singletonList(2));
  final List<SimplifyExprReductionOpportunity> opportunities =
      InlineUniformReductionOpportunities.findOpportunities(new GlslShaderJob(Optional.empty(),
          pipelineInfo, tu), new ReducerContext(false, ShadingLanguageVersion.ESSL_310,
          new RandomWrapper(0), new IdGenerator()));
  assertEquals(1, opportunities.size());
  opportunities.get(0).applyReduction();
  CompareAsts.assertEqualAsts(expected, tu);
}