xref: /llvm-project/clang/test/ClangScanDeps/modules-minimize-module.c (revision 2248164a9ab791a3ed1b9586dc340b5303155021)
1*2248164aSJan Svoboda // RUN: rm -rf %t
2*2248164aSJan Svoboda // RUN: split-file %s %t
3*2248164aSJan Svoboda 
4*2248164aSJan Svoboda // This test checks that source files of modules undergo dependency directives
5*2248164aSJan Svoboda // scan. If a.h would not, the scan would fail when lexing `#error`.
6*2248164aSJan Svoboda 
7*2248164aSJan Svoboda //--- module.modulemap
8*2248164aSJan Svoboda module A { header "a.h" }
9*2248164aSJan Svoboda 
10*2248164aSJan Svoboda //--- a.h
11*2248164aSJan Svoboda #error blah
12*2248164aSJan Svoboda 
13*2248164aSJan Svoboda //--- tu.c
14*2248164aSJan Svoboda #include "a.h"
15*2248164aSJan Svoboda 
16*2248164aSJan Svoboda //--- cdb.json.in
17*2248164aSJan Svoboda [{
18*2248164aSJan Svoboda   "directory": "DIR",
19*2248164aSJan Svoboda   "file": "DIR/tu.c",
20*2248164aSJan Svoboda   "command": "clang -c DIR/tu.c -fmodules -fmodules-cache-path=DIR/cache"
21*2248164aSJan Svoboda }]
22*2248164aSJan Svoboda 
23*2248164aSJan Svoboda // RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.in > %t/cdb.json
24*2248164aSJan Svoboda // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/deps.json
25