[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / ClangScanDeps / diagnostics.c
blob42aeca16cddc44d14467461a0a4c7ab6e75cf6ee
1 // RUN: rm -rf %t
2 // RUN: split-file %s %t
4 //--- cdb.json.template
7 "directory": "DIR",
8 "command": "clang -c DIR/tu.c -fmodules -target i386-apple-ios14.0-simulator -fmodules-cache-path=DIR/cache -Wno-error=invalid-ios-deployment-target -o DIR/tu.o",
9 "file": "DIR/tu.c"
12 //--- mod.h
13 //--- module.modulemap
14 module mod { header "mod.h" }
15 //--- tu.c
16 #include "mod.h"
18 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
19 // RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full 2>&1 > %t/result.json
20 // RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
22 // Check that the '-Wno-error=invalid-ios-deployment-target' option is being
23 // respected and invalid arguments like '-target i386-apple-ios14.0-simulator'
24 // do not result in an error.
26 // CHECK-NOT: error:
27 // CHECK: {
28 // CHECK-NEXT: "modules": [
29 // CHECK-NEXT: {
30 // CHECK-NEXT: "clang-module-deps": [],
31 // CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
32 // CHECK-NEXT: "command-line": [
33 // CHECK-NEXT: "-cc1"
34 // CHECK: ],
35 // CHECK-NEXT: "context-hash": "[[HASH_MOD:.*]]",
36 // CHECK-NEXT: "file-deps": [
37 // CHECK-NEXT: "[[PREFIX]]/mod.h"
38 // CHECK-NEXT: "[[PREFIX]]/module.modulemap"
39 // CHECK-NEXT: ],
40 // CHECK-NEXT: "name": "mod"
41 // CHECK-NEXT: }
42 // CHECK-NEXT: ],
43 // CHECK-NEXT: "translation-units": [
44 // CHECK-NEXT: {
45 // CHECK: "clang-context-hash": "[[HASH_TU:.*]],
46 // CHECK-NEXT: "clang-module-deps": [
47 // CHECK-NEXT: {
48 // CHECK-NEXT: "context-hash": "[[HASH_MOD]]",
49 // CHECK-NEXT: "module-name": "mod"
50 // CHECK-NEXT: }
51 // CHECK-NEXT: ],
52 // CHECK-NEXT: "command-line": [
53 // CHECK-NOT: "-fimplicit-modules"
54 // CHECK-NOT: "-fimplicit-module-maps"
55 // CHECK: ],
56 // CHECK: "file-deps": [
57 // CHECK-NEXT: "[[PREFIX]]/tu.c"
58 // CHECK-NEXT: ],
59 // CHECK-NEXT: "input-file": "[[PREFIX]]/tu.c"
60 // CHECK-NEXT: }