brintos

brintos / llvm-project-archived public Read only

0
0
Text · 854 B · b8b5bb8 Raw
40 lines · cpp
1// RUN: rm -rf %t2// RUN: split-file %s %t3 4//--- cdb.json.in5[{6  "directory": "DIR",7  "command": "clang -c DIR/tu.c -o DIR/tu.o -IDIR/include",8  "file": "DIR/tu.c"9}]10//--- include/header1.h11//--- include/header2.h12//--- include/header3.h13//--- include/header4.h14//--- tu.c15#if __has_include("header1.h")16#endif17 18#if 019#elif __has_include("header2.h")20#endif21 22#define H3 __has_include("header3.h")23#if H324#endif25 26#define H4 __has_include("header4.h")27#if 028#elif H429#endif30 31// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.in > %t/cdb.json32// RUN: clang-scan-deps -compilation-database %t/cdb.json -mode preprocess-dependency-directives | FileCheck %s33// RUN: clang-scan-deps -compilation-database %t/cdb.json -mode preprocess | FileCheck %s34 35// CHECK: tu.c36// CHECK-NEXT: header1.h37// CHECK-NEXT: header2.h38// CHECK-NEXT: header3.h39// CHECK-NEXT: header4.h40