Debian Codegraph @

gcc/testsuite/c-c++-common/has-feature-common.c

raw
1 /* { dg-do compile } */
2 /* Test __has_{feature,extension} for generic features. */
3
4 #define FEAT(x) (__has_feature (x) && __has_extension (x))
5 #define EXT(x) (__has_extension (x) && !__has_feature (x))
6
7 #if __has_feature (unknown_feature) || __has_extension (unknown_feature)
8 #error unknown feature is known!
9 #endif
10
11 #if !EXT (gnu_asm_goto_with_outputs)
12 #error
13 #endif
14
15 #if !EXT (__gnu_asm_goto_with_outputs__)
16 #error
17 #endif
18
19 #if !EXT (gnu_asm_goto_with_outputs_full)
20 #error
21 #endif
22
23 #if !EXT (__gnu_asm_goto_with_outputs_full__)
24 #error
25 #endif
26
27 #if !FEAT (enumerator_attributes)
28 #error
29 #endif
30
31 #if !FEAT (__enumerator_attributes__)
32 #error
33 #endif
34
35 #if !FEAT (attribute_deprecated_with_message)
36 #error
37 #endif
38
39 #if !FEAT (__attribute_deprecated_with_message__)
40 #error
41 #endif
42
43 #if !FEAT (attribute_unavailable_with_message)
44 #error
45 #endif
46
47 #if !FEAT (__attribute_unavailable_with_message__)
48 #error
49 #endif
50
51 #if !FEAT (tls)
52 #error
53 #endif
54
55 #if !FEAT(__tls__)
56 #error
57 #endif
58
59 #if defined (__SANITIZE_ADDRESS__) != __has_feature (address_sanitizer)
60 #error
61 #endif
62
63 #if defined (__SANITIZE_ADDRESS__) != __has_extension (address_sanitizer)
64 #error
65 #endif
66
67 #if defined (__SANITIZE_THREAD__) != __has_feature (thread_sanitizer)
68 #error
69 #endif
70
71 #if defined (__SANITIZE_THREAD__) != __has_extension (thread_sanitizer)
72 #error
73 #endif