@Test
public void testNonLocalInitialization() throws Exception {

  final String shader = "struct _GLF_struct_28 {\n"
        + "    mat4 _f0;\n"
        + "    vec4 a;\n"
        + "};\n"
        + "vec4 f(_GLF_struct_28 _GLF_struct_replacement_29)\n"
        + "{\n"
        + "    return _GLF_struct_28(mat4(1.0), vec4(1.0)).a;\n"
        + "}\n"
        + "void main()\n"
        + "{\n"
        + "        _GLF_struct_28 _GLF_struct_replacement_29;\n"
        + "}\n";
  final String expected = "struct _GLF_struct_28 {\n"
        + "    vec4 a;\n"
        + "};\n"
        + "vec4 f(_GLF_struct_28 _GLF_struct_replacement_29)\n"
        + "{\n"
        + "    return _GLF_struct_28(vec4(1.0)).a;\n"
        + "}\n"
        + "void main()\n"
        + "{\n"
        + "        _GLF_struct_28 _GLF_struct_replacement_29;\n"
        + "}\n";
  TranslationUnit tu = ParseHelper.parse(shader);
  List<RemoveStructFieldReductionOpportunity> ops = RemoveStructFieldReductionOpportunities
      .findOpportunities(MakeShaderJobFromFragmentShader.make(tu),
            new ReducerContext(true, ShadingLanguageVersion.ESSL_100,
                new RandomWrapper(0), new IdGenerator()));
  assertEquals(1, ops.size());
  ops.get(0).applyReduction();
  assertEquals(PrettyPrinterVisitor.prettyPrintAsString(tu),
      PrettyPrinterVisitor.prettyPrintAsString(ParseHelper.parse(expected)));
}