1 // RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s
2 // RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s -o - | %clang_cc1 -Wall -Wextra -Wconversion -x c -fsyntax-only 2>&1 | FileCheck -check-prefix=COMPILE --implicit-check-not warning: %s
23 #if __has_include(<rewrite-includes3.h>)
24 #include <rewrite-includes3.h>
27 #define HAS_INCLUDE(x) __has_include(x)
29 #if HAS_INCLUDE(<rewrite-includes1.h>)
50 // CHECK: #if 0 /* disabled by -frewrite-includes */
51 // CHECK-NEXT: #if value1
53 // CHECK-NEXT: #endif /* disabled by -frewrite-includes */
54 // CHECK-NEXT: #if 1 /* evaluated by -frewrite-includes */
55 // CHECK-NEXT: # 6 "{{.*}}rewrite-includes-conditions.c"
57 // CHECK: #if 0 /* disabled by -frewrite-includes */
58 // CHECK-NEXT: #if value1 == value2
60 // CHECK-NEXT: #endif /* disabled by -frewrite-includes */
61 // CHECK-NEXT: #if 0 /* evaluated by -frewrite-includes */
62 // CHECK-NEXT: # 14 "{{.*}}rewrite-includes-conditions.c"
64 // CHECK: #if 0 /* disabled by -frewrite-includes */
66 // CHECK-NEXT: #elif value1 > value2
68 // CHECK-NEXT: #endif /* disabled by -frewrite-includes */
69 // CHECK-NEXT: #elif 0 /* evaluated by -frewrite-includes */
70 // CHECK-NEXT: # 16 "{{.*}}rewrite-includes-conditions.c"
72 // CHECK: #if 0 /* disabled by -frewrite-includes */
74 // CHECK-NEXT: #elif value1 < value2
76 // CHECK-NEXT: #endif /* disabled by -frewrite-includes */
77 // CHECK-NEXT: #elif 1 /* evaluated by -frewrite-includes */
78 // CHECK-NEXT: # 18 "{{.*}}rewrite-includes-conditions.c"
80 // CHECK: #if 0 /* disabled by -frewrite-includes */
81 // CHECK-NEXT: #if __has_include(<rewrite-includes3.h>)
83 // CHECK-NEXT: #endif /* disabled by -frewrite-includes */
84 // CHECK-NEXT: #if 1 /* evaluated by -frewrite-includes */
85 // CHECK-NEXT: # 24 "{{.*}}rewrite-includes-conditions.c"
87 // CHECK: #if 0 /* disabled by -frewrite-includes */
88 // CHECK-NEXT: #if HAS_INCLUDE(<rewrite-includes1.h>)
90 // CHECK-NEXT: #endif /* disabled by -frewrite-includes */
91 // CHECK-NEXT: #if 1 /* evaluated by -frewrite-includes */
92 // CHECK-NEXT: # 30 "{{.*}}rewrite-includes-conditions.c"
94 // CHECK: #if 0 /* disabled by -frewrite-includes */
95 // CHECK-NEXT: #if value1 < value2 \
96 // CHECK-NEXT: || value1 != value2
98 // CHECK-NEXT: #endif /* disabled by -frewrite-includes */
99 // CHECK-NEXT: #if 1 /* evaluated by -frewrite-includes */
100 // CHECK-NEXT: # 39 "{{.*}}rewrite-includes-conditions.c"
102 // CHECK: #if 0 /* disabled by -frewrite-includes */
103 // CHECK-NEXT: #if value1 /*
105 // CHECK-NEXT: #endif
106 // CHECK-NEXT: #endif /* disabled by -frewrite-includes */
107 // CHECK-NEXT: #if 1 /* evaluated by -frewrite-includes */
108 // CHECK-NEXT: # 44 "{{.*}}rewrite-includes-conditions.c"
110 // CHECK: {{^}}// ENDCOMPARE{{$}}
112 // COMPILE: Inputs{{[/\\]}}rewrite-includes3.h:1:31: warning: implicit conversion changes signedness:
113 // COMPILE: rewrite-includes-conditions.c:46:12: warning: unused variable 'unused'