[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / ClangScanDeps / depscan-lex-has-include.c
blob4d46e8d7d19e26348c70a22863f10d750b9eb54b
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
5 // RUN: clang-scan-deps -compilation-database %t/cdb.json | FileCheck %s
6 // CHECK: t.c
7 // CHECK: something.h
9 // RUN: sed -e "s|DIR|%/t|g" %t/cdb-error.json.template > %t/cdb-error.json
10 // RUN: not clang-scan-deps -compilation-database %t/cdb-error.json 2>&1 | FileCheck %s -check-prefix=ERROR
11 // ERROR: error: expected '>'
12 // ERROR: error: expected value in expression
14 //--- cdb.json.template
17 "directory": "DIR",
18 "command": "clang -fsyntax-only DIR/t.c -I DIR",
19 "file": "DIR/t.c"
23 //--- cdb-error.json.template
26 "directory": "DIR",
27 "command": "clang -fsyntax-only DIR/error.c",
28 "file": "DIR/error.c"
32 //--- t.c
34 #define something
36 // Make sure the include is lexed as a literal, ignoring the macro.
37 #if __has_include(<something/something.h>)
38 #include <something/something.h>
39 #endif
41 //--- something/something.h
43 //--- error.c
44 #if __has_include(<something/something.h)
45 #define MAC
46 #endif