1 /* Test __has_c_attribute. Test GNU attributes. */
2 /* { dg-do preprocess } */
3 /* { dg-options "-std=c2x -pedantic-errors" } */
4
5 #if __has_c_attribute (gnu::packed) != 1
6 #error "bad result for gnu::packed"
7 #endif
8
9 #if __has_c_attribute (__gnu__::__packed__) != 1
10 #error "bad result for __gnu__::__packed__"
11 #endif
12
13 #if __has_c_attribute (gnu::__packed__) != 1
14 #error "bad result for gnu::__packed__"
15 #endif
16
17 #if __has_c_attribute (__gnu__::packed) != 1
18 #error "bad result for __gnu__::packed"
19 #endif
20
21 /* GNU attributes should not be reported as accepted without a scope
22 specified. */
23 #if __has_c_attribute (packed) != 0
24 #error "bad result for packed"
25 #endif