[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / ClangScanDeps / diagnostics.c
blob8e3cf4c9f9fa6dfaeed22e5c194cfa1aecca986e
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]]/module.modulemap",
38 // CHECK-NEXT: "[[PREFIX]]/mod.h"
39 // CHECK-NEXT: ],
40 // CHECK-NEXT: "link-libraries": [],
41 // CHECK-NEXT: "name": "mod"
42 // CHECK-NEXT: }
43 // CHECK-NEXT: ],
44 // CHECK-NEXT: "translation-units": [
45 // CHECK-NEXT: {
46 // CHECK: "clang-context-hash": "[[HASH_TU:.*]],
47 // CHECK-NEXT: "clang-module-deps": [
48 // CHECK-NEXT: {
49 // CHECK-NEXT: "context-hash": "[[HASH_MOD]]",
50 // CHECK-NEXT: "module-name": "mod"
51 // CHECK-NEXT: }
52 // CHECK-NEXT: ],
53 // CHECK-NEXT: "command-line": [
54 // CHECK-NOT: "-fimplicit-modules"
55 // CHECK-NOT: "-fimplicit-module-maps"
56 // CHECK: ],
57 // CHECK: "file-deps": [
58 // CHECK-NEXT: "[[PREFIX]]/tu.c"
59 // CHECK-NEXT: ],
60 // CHECK-NEXT: "input-file": "[[PREFIX]]/tu.c"
61 // CHECK-NEXT: }