1 // RUN: %clang_cc1 -fsyntax-only %s -verify 2 #ifndef __has_warning 3 #error Should have __has_warning 4 #endif 5 6 #if __has_warning("not valid") // expected-warning {{__has_warning expected option name}} 7 #endif 8 9 #if __has_warning("-Wparentheses") 10 #warning Should have -Wparentheses // expected-warning {{Should have -Wparentheses}} 11 #endif 12 13 #if __has_warning(-Wfoo) // expected-error {{builtin warning check macro requires a parenthesized string}} 14 #endif 15 16 #if __has_warning("-Wnot-a-valid-warning-flag-at-all") 17 #else 18 #warning Not a valid warning flag // expected-warning {{Not a valid warning flag}} 19 #endif