33 lines · c
1// RUN: %clang_cc1 -Eonly %s -DOPT_O2 -O2 -verify2#ifdef OPT_O23 // expected-no-diagnostics4 #ifndef __OPTIMIZE__5 #error "__OPTIMIZE__ not defined"6 #endif7 #ifdef __OPTIMIZE_SIZE__8 #error "__OPTIMIZE_SIZE__ defined"9 #endif10#endif11 12// RUN: %clang_cc1 -Eonly %s -DOPT_O0 -verify13#ifdef OPT_O014 // expected-no-diagnostics15 #ifdef __OPTIMIZE__16 #error "__OPTIMIZE__ defined"17 #endif18 #ifdef __OPTIMIZE_SIZE__19 #error "__OPTIMIZE_SIZE__ defined"20 #endif21#endif22 23// RUN: %clang_cc1 -Eonly %s -DOPT_OS -Os -verify24#ifdef OPT_OS25 // expected-no-diagnostics26 #ifndef __OPTIMIZE__27 #error "__OPTIMIZE__ not defined"28 #endif29 #ifndef __OPTIMIZE_SIZE__30 #error "__OPTIMIZE_SIZE__ not defined"31 #endif32#endif33