if_warning.c 605 B

12345678910111213141516171819202122232425262728293031
  1. // RUN: %clang_cc1 %s -Eonly -Werror=undef -verify
  2. // RUN: %clang_cc1 %s -Eonly -Werror-undef -verify
  3. extern int x;
  4. #if foo // expected-error {{'foo' is not defined, evaluates to 0}}
  5. #endif
  6. #ifdef foo
  7. #endif
  8. #if defined(foo)
  9. #endif
  10. // PR3938
  11. #if 0
  12. #ifdef D
  13. #else 1 // Should not warn due to C99 6.10p4
  14. #endif
  15. #endif
  16. // rdar://9475098
  17. #if 0
  18. #else 1 // expected-warning {{extra tokens}}
  19. #endif
  20. // PR6852
  21. #if 'somesillylongthing' // expected-warning {{character constant too long for its type}} \
  22. // expected-warning {{multi-character character constant}}
  23. #endif