[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / ClangScanDeps / modules-context-hash-outputs.c
blob5e63e60a703705c4633fe848316a11016f2e6a19
1 // If secondary output files such as .d are enabled, ensure it affects the
2 // module context hash since it may impact the resulting module build commands.
4 // RUN: rm -rf %t
5 // RUN: split-file %s %t
6 // RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
8 // RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 \
9 // RUN: -format experimental-full > %t/deps.json
10 // RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
12 // CHECK: {
13 // CHECK-NEXT: "modules": [
14 // CHECK: {
15 // CHECK: "command-line": [
16 // CHECK: "-dependency-file"
17 // CHECK: ]
18 // CHECK: "context-hash": "[[HASH1:.*]]"
19 // CHECK: "name": "Mod"
20 // CHECK-NEXT: }
21 // CHECK-NEXT: {
22 // CHECK: "command-line": [
23 // CHECK-NOT: "-dependency-file"
24 // CHECK: ]
25 // CHECK: "context-hash": "[[HASH2:.*]]"
26 // CHECK: "name": "Mod"
27 // CHECK-NEXT: }
28 // CHECK-NEXT: ]
29 // CHECK-NEXT: "translation-units": [
30 // CHECK-NEXT: {
31 // CHECK: "clang-module-deps": [
32 // CHECK-NEXT: {
33 // CHECK-NEXT: "context-hash": "[[HASH1]]"
34 // CHECK-NEXT: "module-name": "Mod"
35 // CHECK-NEXT: }
36 // CHECK-NEXT: ]
37 // CHECK-NEXT: "command-line": [
38 // CHECK: "-dependency-file"
39 // CHECK: ]
40 // CHECK: "input-file": "{{.*}}tu1.c"
41 // CHECK-NEXT: }
42 // CHECK: {
43 // CHECK: "clang-module-deps": [
44 // CHECK-NEXT: {
45 // CHECK-NEXT: "context-hash": "[[HASH2]]"
46 // CHECK-NEXT: "module-name": "Mod"
47 // CHECK-NEXT: }
48 // CHECK-NEXT: ]
49 // CHECK-NEXT: "command-line": [
50 // CHECK-NOT: "-MF"
51 // CHECK-NOT: "-dependency-file"
52 // CHECK: ]
53 // CHECK: "input-file": "{{.*}}tu2.c"
55 //--- cdb.json.template
58 "directory": "DIR",
59 "command": "clang -MD -MF DIR/tu1.d -fsyntax-only DIR/tu1.c -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache",
60 "file": "DIR/tu1.c"
63 "directory": "DIR",
64 "command": "clang -fsyntax-only DIR/tu2.c -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache",
65 "file": "DIR/tu2.c"
69 //--- module.modulemap
70 module Mod { header "Mod.h" }
72 //--- Mod.h
74 //--- tu1.c
75 #include "Mod.h"
77 //--- tu2.c
78 #include "Mod.h"