Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/c-c++-common/cpp/has-include-next-1.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* { dg-do preprocess } */ | |
2 | |
3 #if __has_include_next ("stdlib.h") | |
4 #else | |
5 #error error 1 | |
6 #endif | |
7 #if __has_include_next (<stdlib.h>) | |
8 #else | |
9 #error error 2 | |
10 #endif | |
11 #if !__has_include_next ("stdlib.h") | |
12 #error error 3 | |
13 #elif !__has_include_next (<stdlib.h>) | |
14 #error error 4 | |
15 #endif | |
16 #if __has_include_next ("stdlib.h") && __has_include_next (<stdlib.h>) | |
17 #else | |
18 #error error 5 | |
19 #endif | |
20 #if !defined(__has_include_next) | |
21 #error error 6 | |
22 #endif | |
23 #ifndef __has_include_next | |
24 #error error 7 | |
25 #endif | |
26 #ifdef __has_include_next | |
27 #else | |
28 #error error 8 | |
29 #endif | |
30 #define m1 __has_include_next("stdlib.h") | |
31 #define m2 ("stdlib.h") | |
32 #define m3 ("has-include-1-nonexistent.h") | |
33 #define m4 has-include-1-nonexistent-2.h>) | |
34 #define m5 <stdlib.h> | |
35 #if !m1 | |
36 #error error 9 | |
37 #endif | |
38 #if !__has_include_next m2 | |
39 #error error 10 | |
40 #endif | |
41 #if __has_include_next m3 | |
42 #error error 11 | |
43 #endif | |
44 #if __has_include_next (<m4 | |
45 #error error 12 | |
46 #endif | |
47 #if !__has_include_next (m5) | |
48 #error error 13 | |
49 #endif | |
50 __has_include_next (<stdlib.h>) /* { dg-error "used outside of preprocessing directive" } */ | |
51 m1 /* { dg-error "used outside of preprocessing directive" } */ | |
52 #if 1 | |
53 m1 /* { dg-error "used outside of preprocessing directive" } */ | |
54 #endif | |
55 #if 0 | |
56 #elif 1 | |
57 m1 /* { dg-error "used outside of preprocessing directive" } */ | |
58 #endif | |
59 #if 0 | |
60 m1 | |
61 #endif | |
62 #if 0 | |
63 #elif 0 | |
64 m1 | |
65 #endif | |
66 #if __has_include_next "stdlib.h") /* { dg-error "missing" } */ | |
67 #endif | |
68 #if __has_include_next (stdlib.h) /* { dg-error "operator|missing" } */ | |
69 #endif | |
70 #if __has_include_next () /* { dg-error "operator|missing" } */ | |
71 #endif | |
72 #if __has_include_next ) /* { dg-error "operator|missing" } */ | |
73 #endif | |
74 #if __has_include_next ("stdlib.h) | |
75 #endif | |
76 /* { dg-error "operator|missing\[^\n\r]*after" "" { target *-*-* } .-2 } */ | |
77 /* { dg-warning "missing terminating" "" { target *-*-* } .-3 } */ | |
78 #if __has_include_next (stdlib.h>) /* { dg-error "operator|missing" } */ | |
79 #endif | |
80 #if __has_include_next ("stdlib.h" /* { dg-error "missing" } */ | |
81 #endif | |
82 #if __has_include_next ( /* { dg-error "operator|missing" } */ | |
83 #endif | |
84 #if __has_include_next /* { dg-error "operator|missing" } */ | |
85 #endif | |
86 #if __has_include_next"stdlib.h" /* { dg-error "missing" } */ | |
87 #endif | |
88 #if __has_include_next'h' /* { dg-error "operator|missing" } */ | |
89 #endif | |
90 #if __has_include_next('h' /* { dg-error "operator|missing" } */ | |
91 #endif | |
92 #if __has_include_next('h') /* { dg-error "operator" } */ | |
93 #endif | |
94 #define H(h) __has_include_next(h) | |
95 #if H(<stdlib.h>) | |
96 #else | |
97 #error error 14 | |
98 #endif | |
99 void | |
100 foo () | |
101 { | |
102 #pragma omp parallel if (__has_include_next ("<stdlib.h>")) | |
103 ; | |
104 } |