[RISCV] Add shrinkwrap test cases showing gaps in current impl
[llvm-project.git] / clang / test / ClangScanDeps / more-content-after-headerguard.c
blob5c47508e03ab3fe404bd84d002356665e38d0d7a
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
7 // CHECK: t.c
8 // CHECK: top.h
9 // CHECK: n1.h
10 // CHECK: n2.h
11 // CHECK: n3.h
13 //--- cdb.json.template
16 "directory": "DIR",
17 "command": "clang -fsyntax-only DIR/t.c",
18 "file": "DIR/t.c"
22 //--- t.c
24 #include "top.h"
25 #define INCLUDE_N3
26 #include "top.h"
28 //--- top.h
29 #ifndef _TOP_H_
30 #define _TOP_H_
32 #include "n1.h"
34 #endif
36 // More stuff after following '#endif', should invalidate the macro guard optimization,
37 // and allow `top.h` to get re-included.
38 #include "n2.h"
40 //--- n1.h
42 //--- n2.h
43 #ifdef INCLUDE_N3
44 #include "n3.h"
45 #endif
47 //--- n3.h