[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ClangScanDeps / generate-modules-path-args.c
bloba303b5883bd3df88446581b11cb740a3ab835a39
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: sed "s|DIR|%/t|g" %t/cdb_without.json.template > %t/cdb_without.json
5 // RUN: clang-scan-deps -compilation-database %t/cdb.json \
6 // RUN: -format experimental-full > %t/deps.json
7 // RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
8 // RUN: clang-scan-deps -compilation-database %t/cdb.json \
9 // RUN: -format experimental-full -dependency-target foo > %t/deps_mt1.json
10 // RUN: cat %t/deps_mt1.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s -check-prefix=DEPS_MT1
11 // RUN: clang-scan-deps -compilation-database %t/cdb.json \
12 // RUN: -format experimental-full -dependency-target foo -dependency-target bar > %t/deps_mt2.json
13 // RUN: cat %t/deps_mt2.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s -check-prefix=DEPS_MT2
14 // RUN: clang-scan-deps -compilation-database %t/cdb_without.json \
15 // RUN: -format experimental-full > %t/deps_without.json
16 // RUN: cat %t/deps_without.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t -check-prefix=WITHOUT %s
18 // CHECK: {
19 // CHECK-NEXT: "modules": [
20 // CHECK-NEXT: {
21 // CHECK: "command-line": [
22 // CHECK-NEXT: "-cc1"
23 // CHECK: "-serialize-diagnostic-file"
24 // CHECK-NEXT: "[[PREFIX]]{{.*}}Mod{{.*}}.diag"
25 // CHECK: "-MT"
26 // CHECK-NEXT: "[[PREFIX]]{{.*}}Mod{{.*}}.pcm"
27 // CHECK: "-dependency-file"
28 // CHECK-NEXT: "[[PREFIX]]{{.*}}Mod{{.*}}.d"
29 // CHECK: ],
31 // DEPS_MT1: "-MT"
32 // DEPS_MT1-NEXT: "foo"
34 // DEPS_MT2: "-MT"
35 // DEPS_MT2-NEXT: "foo"
36 // DEPS_MT2-NEXT: "-MT"
37 // DEPS_MT2-NEXT: "bar"
39 // WITHOUT: {
40 // WITHOUT-NEXT: "modules": [
41 // WITHOUT-NEXT: {
42 // WITHOUT: "command-line": [
43 // WITHOUT-NEXT: "-cc1"
44 // WITHOUT-NOT: "-serialize-diagnostic-file"
45 // WITHOUT-NOT: "-dependency-file"
46 // WITHOUT-NOT: "-MT"
47 // WITHOUT: ],
49 //--- cdb.json.template
51 "directory": "DIR",
52 "command": "clang -fsyntax-only DIR/tu.c -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache -serialize-diagnostics DIR/tu.diag -MD -MT tu -MF DIR/tu.d",
53 "file": "DIR/tu.c"
56 //--- cdb_without.json.template
58 "directory": "DIR",
59 "command": "clang -fsyntax-only DIR/tu.c -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache",
60 "file": "DIR/tu.c"
63 //--- module.modulemap
64 module Mod { header "Mod.h" }
66 //--- Mod.h
68 //--- tu.c
69 #include "Mod.h"