@Test
public void testMultipleDeclarations() throws Exception {

  final String program = "void main() {"
      + "int a = 1;"      // Initialized variable declaration.
      + "int b = foo();"  // Initialized variable declaration.
      + "int c;"          // Uninitialized variable declaration.
      + "}";
  final String expected = "void main() {"
      + " int a;"
      + " a = 1;"
      + " int b;"
      + " b = foo();"
      + " int c;"
      + "}";
  final TranslationUnit tu = ParseHelper.parse(program);
  List<VariableDeclToExprReductionOpportunity> ops = VariableDeclToExprReductionOpportunities
      .findOpportunities(MakeShaderJobFromFragmentShader.make(tu), new ReducerContext(true,
          ShadingLanguageVersion.ESSL_100,
          new RandomWrapper(0), new IdGenerator()));
  // Only variable declarations a and b have the initializer.
  // Thus, we expect the reducer to find only 2 opportunities.
  assertEquals(2, ops.size());
  ops.forEach(VariableDeclToExprReductionOpportunity::applyReductionImpl);
  CompareAsts.assertEqualAsts(expected, tu);
}