@Test
public void testAssignVariableIdentifier() throws Exception {

  final String program = ""
      + "int a = 1;"
      + "int b = a, c = b;"   // b depends on a and c depends on b.
      + "int d = c;"          // d depends on c.
      + "void main() { }";
  // No need to retain the order of the assignment as we are running the semantics-changing mode.
  final String expected = ""
      + "int a;"
      + "int b, c;"
      + "int d;"
      + "void main() {"
      + " d = c;"
      + " c = b;"
      + " b = a;"
      + " a = 1;"
      + "}";
  final TranslationUnit tu = ParseHelper.parse(program);
  final List<GlobalVariableDeclToExprReductionOpportunity> ops =
      GlobalVariableDeclToExprReductionOpportunities
      .findOpportunities(MakeShaderJobFromFragmentShader.make(tu), new ReducerContext(true,
          ShadingLanguageVersion.ESSL_100,
          new RandomWrapper(0), new IdGenerator()));
  assertEquals(4, ops.size());
  ops.forEach(GlobalVariableDeclToExprReductionOpportunity::applyReductionImpl);
  CompareAsts.assertEqualAsts(expected, tu);
}