Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Preprocessor / include-next.c
blob4b9a0e870cecd2ab78798b6634c050b5d841fa63
1 // RUN: %clang_cc1 -verify %s -E -o /dev/null -I%S/Inputs/include-next-1 -I%S/Inputs/include-next-2 -DTEST=1
2 // RUN: %clang_cc1 -verify %s -E -o /dev/null -I%S/Inputs/include-next-1 -I%S/Inputs/include-next-2 -DTEST=2
3 // RUN: %clang_cc1 -verify %s -E -o /dev/null -I%S/Inputs/include-next-1 -I%S/Inputs/include-next-2 -DTEST=3
5 #if TEST == 1
6 // expected-warning@+1 {{#include_next in primary source file}}
7 #include_next "bar.h"
8 #if BAR != 1
9 #error wrong bar
10 #endif
12 #elif TEST == 2
13 // expected-no-diagnostics
14 #include "foo.h"
15 #if BAR != 2
16 #error wrong bar
17 #endif
19 #elif TEST == 3
20 // expected-warning@foo.h:1 {{#include_next in file found relative to primary source file or found by absolute path}}
21 #include "Inputs/include-next-1/foo.h"
22 #if BAR != 1
23 #error wrong bar
24 #endif
25 #undef BAR
27 #else
28 #error unknown test
29 #endif