@Test
public void testUnusedAnonymousStructIsRemoved() throws Exception {

  final String original = "volatile struct { int x; }; void main() { }";
  final String expected = "void main() { }";
  final TranslationUnit tu = ParseHelper.parse(original);
  final List<GlobalVariablesDeclarationReductionOpportunity> ops =
      GlobalVariablesDeclarationReductionOpportunities
      .findOpportunities(MakeShaderJobFromFragmentShader.make(tu),
          new ReducerContext(false, ShadingLanguageVersion.ESSL_100,
          new RandomWrapper(0), new IdGenerator()));
  assertEquals(1, ops.size());
  ops.get(0).applyReduction();
  CompareAsts.assertEqualAsts(expected, tu);
}