@Test
public void testStripUnusedGlobals() throws Exception {

  final String original = ""
        + "int a = 0, b = a, c;"
        + "float d = 2.0, e[4];"
        + "void baz() {"
        + "  d = 2;"
        + "}"
        + "int x, y = c;"
        + "void foo() {"
        + "  d = float(x);"
        + "}"
        + "float t;"
        + "float t2 = d;"
        + "float l, m;"
        + "void main() {"
        + "}";
  final String expected = ""
        + "int a = 0, c;"
        + "float d = 2.0;"
        + "void baz() {"
        + "  d = 2;"
        + "}"
        + "int x;"
        + "void foo() {"
        + "  d = float(x);"
        + "}"
        + "void main() {"
        + "}";
  final TranslationUnit tu = ParseHelper.parse(original);
  StripUnusedGlobals.strip(tu);
  CompareAsts.assertEqualAsts(expected, tu);
}