[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ClangScanDeps / macro-expansions.cpp
blobc8c21f87e6007fcda3ee9ad63b277975f437100b
1 // This checks that there's no issue with the preprocessor handling user or built-in macro
2 // expansion during dependency scanning.
4 // RUN: rm -rf %t
5 // RUN: split-file %s %t
6 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
8 // RUN: clang-scan-deps -compilation-database %t/cdb.json | FileCheck %s
10 // CHECK: test.o:
11 // CHECK-NEXT: test.cpp
12 // CHECK-NEXT: header1.h
13 // CHECK-NEXT: header2.h
15 //--- cdb.json.template
17 "directory" : "DIR",
18 "command" : "clang -target x86_64-apple-macosx10.7 -c DIR/test.cpp -o DIR/test.o",
19 "file" : "DIR/test.o"
22 //--- test.cpp
23 #define FN_MACRO(x) 1
24 #if FN_MACRO(a)
25 #include "header1.h"
26 #endif
28 #if __has_cpp_attribute(clang::fallthrough)
29 #include "header2.h"
30 #endif
32 //--- header1.h
33 #ifndef _HEADER1_H_
34 #define _HEADER1_H_
35 #endif
37 //--- header2.h
38 #ifndef _HEADER2_H_
39 #define _HEADER2_H_
40 #endif