verify-marker.c 810 B

12345678910111213141516171819202122
  1. // RUN: %clang_cc1 -verify %s
  2. #include "verify-marker.h" // expected-error@#1 {{unknown type name 'unknown_type'}}
  3. int x = 1; // #a
  4. int x = 2; // #b
  5. // expected-error@#b {{redefinition of 'x'}}
  6. // expected-note@#a {{previous}}
  7. // expected-error@#unknown {{}} expected-error {{use of undefined marker '#unknown'}}
  8. // This is OK: there's no problem with a source file containing what looks like
  9. // a duplicate definition of a marker if that marker is never used.
  10. // #foo
  11. // #foo
  12. // #bar expected-note {{ambiguous marker '#bar' is defined here}}
  13. // #bar expected-note {{ambiguous marker '#bar' is defined here}}
  14. // expected-error@#bar 0-1{{oops}} expected-error{{reference to marker '#bar' is ambiguous}}
  15. // expected-error@#forward_ref {{undeclared identifier 'future'}}
  16. int y = future; // #forward_ref