summaryrefslogtreecommitdiff
path: root/clang/test/ClangScanDeps/_Pragma-once.c
blob: 573f82c85698f778d529819e764db903f3f290c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Test scanning deps works with _Pragma syntax when not inside a macro.

// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json

// RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1

//--- cdb.json.template
[{
  "directory": "DIR",
  "command": "clang -fsyntax-only DIR/tu.c",
  "file": "DIR/tu.c"
}]

//--- a.h
_Pragma("once")
#include "b.h"

//--- b.h
#include "a.h"

//--- tu.c
#include "a.h"