]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/c2x-has-c-attribute-1.c
1 /* Test __has_c_attribute. Test basic properties. */
2 /* { dg-do preprocess } */
3 /* { dg-options "-std=c2x -pedantic-errors" } */
5 #ifdef __has_c_attribute
8 #error "__has_c_attribute not defined"
11 #ifndef __has_c_attribute
12 #error "__has_c_attribute not defined"
15 #if defined __has_c_attribute
18 #error "__has_c_attribute not defined"
21 #if __has_c_attribute(foo)
22 #error "foo attribute supported"
26 #elif __has_c_attribute(foo)
27 #error "foo attribute supported"