aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c23-has-c-attribute-3.c
blob: cd1a000725685933baa7f20b3dd33a99bed12d39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Test __has_c_attribute.  Test GNU attributes.  */
/* { dg-do preprocess } */
/* { dg-options "-std=c23 -pedantic-errors" } */

#if __has_c_attribute (gnu::packed) != 1
#error "bad result for gnu::packed"
#endif

#if __has_c_attribute (__gnu__::__packed__) != 1
#error "bad result for __gnu__::__packed__"
#endif

#if __has_c_attribute (gnu::__packed__) != 1
#error "bad result for gnu::__packed__"
#endif

#if __has_c_attribute (__gnu__::packed) != 1
#error "bad result for __gnu__::packed"
#endif

/* GNU attributes should not be reported as accepted without a scope
   specified.  */
#if __has_c_attribute (packed) != 0
#error "bad result for packed"
#endif