[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ClangScanDeps / submodule-order.c
blob3f2dbeccff3f07fcccd9c531c02a1390c5838e3c
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
3 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
4 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/deps1.json
5 // RUN: mv %t/tu2.c %t/tu.c
6 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/deps2.json
7 // RUN: diff -u %t/deps1.json %t/deps2.json
8 // RUN: FileCheck %s < %t/deps1.json
10 // CHECK: "-fmodule-file={{.*}}Indirect1
11 // CHECK-NOT: "-fmodule-file={{.*}}Indirect
12 // CHECK: "-fmodule-file={{.*}}Indirect2
13 // CHECK-NOT: "-fmodule-file={{.*}}Indirect
15 //--- cdb.json.template
17 "directory": "DIR",
18 "command": "clang -fsyntax-only DIR/tu.c -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache",
19 "file": "DIR/tu.c"
22 //--- module.modulemap
23 module Indirect1 { header "Indirect1.h" }
24 module Indirect2 { header "Indirect2.h" }
25 module Mod {
26 umbrella "Mod"
27 module * { export * }
30 //--- Indirect1.h
31 void indirect1(void);
33 //--- Indirect2.h
34 void indirect2(void);
36 //--- Mod/SubMod1.h
37 #include "../Indirect1.h"
39 //--- Mod/SubMod2.h
40 #include "../Indirect2.h"
42 //--- tu.c
43 #include "Mod/SubMod1.h"
44 #include "Mod/SubMod2.h"
45 void tu1(void) {
46 indirect1();
47 indirect2();
50 //--- tu2.c
51 #include "Mod/SubMod2.h"
52 #include "Mod/SubMod1.h"
53 void tu1(void) {
54 indirect1();
55 indirect2();