optimize.c 733 B

1234567891011121314151617181920212223242526272829303132
  1. // RUN: %clang_cc1 -Eonly %s -DOPT_O2 -O2 -verify
  2. #ifdef OPT_O2
  3. // expected-no-diagnostics
  4. #ifndef __OPTIMIZE__
  5. #error "__OPTIMIZE__ not defined"
  6. #endif
  7. #ifdef __OPTIMIZE_SIZE__
  8. #error "__OPTIMIZE_SIZE__ defined"
  9. #endif
  10. #endif
  11. // RUN: %clang_cc1 -Eonly %s -DOPT_O0 -verify
  12. #ifdef OPT_O0
  13. // expected-no-diagnostics
  14. #ifdef __OPTIMIZE__
  15. #error "__OPTIMIZE__ defined"
  16. #endif
  17. #ifdef __OPTIMIZE_SIZE__
  18. #error "__OPTIMIZE_SIZE__ defined"
  19. #endif
  20. #endif
  21. // RUN: %clang_cc1 -Eonly %s -DOPT_OS -Os -verify
  22. #ifdef OPT_OS
  23. // expected-no-diagnostics
  24. #ifndef __OPTIMIZE__
  25. #error "__OPTIMIZE__ not defined"
  26. #endif
  27. #ifndef __OPTIMIZE_SIZE__
  28. #error "__OPTIMIZE_SIZE__ not defined"
  29. #endif
  30. #endif