1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 #pragma clang optimize off
5 #pragma clang optimize on
8 #pragma clang optimize on top of spaghetti // expected-error {{unexpected extra argument 'top' to '#pragma clang optimize'}}
11 #pragma clang optimize something_wrong // expected-error {{unexpected argument 'something_wrong' to '#pragma clang optimize'; expected 'on' or 'off'}}
14 #pragma clang optimize // expected-error {{missing argument to '#pragma clang optimize'; expected 'on' or 'off'}}
16 // Check that macros can be used in the pragma
19 #pragma clang optimize OFF
20 #pragma clang optimize ON
22 // Check that _Pragma can also be used to address the use case where users want
23 // to define optimization control macros to abstract out which compiler they are
25 #define OPT_OFF _Pragma("clang optimize off")
26 #define OPT_ON _Pragma("clang optimize on")