xref: /minix3/external/bsd/llvm/dist/clang/test/Preprocessor/optimize.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -Eonly %s -DOPT_O2 -O2 -verify
2*f4a2713aSLionel Sambuc #ifdef OPT_O2
3*f4a2713aSLionel Sambuc   // expected-no-diagnostics
4*f4a2713aSLionel Sambuc   #ifndef __OPTIMIZE__
5*f4a2713aSLionel Sambuc     #error "__OPTIMIZE__ not defined"
6*f4a2713aSLionel Sambuc   #endif
7*f4a2713aSLionel Sambuc   #ifdef __OPTIMIZE_SIZE__
8*f4a2713aSLionel Sambuc     #error "__OPTIMIZE_SIZE__ defined"
9*f4a2713aSLionel Sambuc   #endif
10*f4a2713aSLionel Sambuc #endif
11*f4a2713aSLionel Sambuc 
12*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -Eonly %s -DOPT_O0 -verify
13*f4a2713aSLionel Sambuc #ifdef OPT_O0
14*f4a2713aSLionel Sambuc   // expected-no-diagnostics
15*f4a2713aSLionel Sambuc   #ifdef __OPTIMIZE__
16*f4a2713aSLionel Sambuc     #error "__OPTIMIZE__ defined"
17*f4a2713aSLionel Sambuc   #endif
18*f4a2713aSLionel Sambuc   #ifdef __OPTIMIZE_SIZE__
19*f4a2713aSLionel Sambuc     #error "__OPTIMIZE_SIZE__ defined"
20*f4a2713aSLionel Sambuc   #endif
21*f4a2713aSLionel Sambuc #endif
22*f4a2713aSLionel Sambuc 
23*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -Eonly %s -DOPT_OS -Os -verify
24*f4a2713aSLionel Sambuc #ifdef OPT_OS
25*f4a2713aSLionel Sambuc   // expected-no-diagnostics
26*f4a2713aSLionel Sambuc   #ifndef __OPTIMIZE__
27*f4a2713aSLionel Sambuc     #error "__OPTIMIZE__ not defined"
28*f4a2713aSLionel Sambuc   #endif
29*f4a2713aSLionel Sambuc   #ifndef __OPTIMIZE_SIZE__
30*f4a2713aSLionel Sambuc     #error "__OPTIMIZE_SIZE__ not defined"
31*f4a2713aSLionel Sambuc   #endif
32*f4a2713aSLionel Sambuc #endif
33