xref: /llvm-project/clang/test/ClangScanDeps/_Pragma-once.c (revision ee8ed0b3099e63ba0a18cca42b9cfdf098bc6201)
1 // Test scanning deps works with _Pragma syntax when not inside a macro.
2 
3 // RUN: rm -rf %t
4 // RUN: split-file %s %t
5 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
6 
7 // RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1
8 
9 //--- cdb.json.template
10 [{
11   "directory": "DIR",
12   "command": "clang -fsyntax-only DIR/tu.c",
13   "file": "DIR/tu.c"
14 }]
15 
16 //--- a.h
17 _Pragma("once")
18 #include "b.h"
19 
20 //--- b.h
21 #include "a.h"
22 
23 //--- tu.c
24 #include "a.h"
25