1 // RUN: rm -rf %t.dir
2 // RUN: rm -rf %t.cdb
3 // RUN: mkdir -p %t.dir
4 // RUN: cp %s %t.dir/has_include_if_elif2.cpp
5 // RUN: mkdir %t.dir/Inputs
6 // RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
7 // RUN: cp %S/Inputs/header.h %t.dir/Inputs/header2.h
8 // RUN: cp %S/Inputs/header.h %t.dir/Inputs/header3.h
9 // RUN: cp %S/Inputs/header.h %t.dir/Inputs/header4.h
10 // RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/has_include_if_elif.json > %t.cdb
11 //
12 // RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-minimized-sources | \
13 // RUN:   FileCheck %s
14 // RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess | \
15 // RUN:   FileCheck %s
16 
17 #if __has_include("header.h")
18 #endif
19 
20 #if 0
21 #elif __has_include("header2.h")
22 #endif
23 
24 #define H3 __has_include("header3.h")
25 #if H3
26 #endif
27 
28 #define H4 __has_include("header4.h")
29 
30 #if 0
31 #elif H4
32 #endif
33 
34 // CHECK: has_include_if_elif2.cpp
35 // CHECK-NEXT: Inputs{{/|\\}}header.h
36 // CHECK-NEXT: Inputs{{/|\\}}header2.h
37 // CHECK-NEXT: Inputs{{/|\\}}header3.h
38 // CHECK-NEXT: Inputs{{/|\\}}header4.h
39