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.
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
13 // CHECK-NEXT: "modules": [
15 // CHECK: "command-line": [
16 // CHECK: "-dependency-file"
18 // CHECK: "context-hash": "[[HASH1:.*]]"
19 // CHECK: "name": "Mod"
22 // CHECK: "command-line": [
23 // CHECK-NOT: "-dependency-file"
25 // CHECK: "context-hash": "[[HASH2:.*]]"
26 // CHECK: "name": "Mod"
29 // CHECK-NEXT: "translation-units": [
31 // CHECK: "clang-module-deps": [
33 // CHECK-NEXT: "context-hash": "[[HASH1]]"
34 // CHECK-NEXT: "module-name": "Mod"
37 // CHECK-NEXT: "command-line": [
38 // CHECK: "-dependency-file"
40 // CHECK: "input-file": "{{.*}}tu1.c"
43 // CHECK: "clang-module-deps": [
45 // CHECK-NEXT: "context-hash": "[[HASH2]]"
46 // CHECK-NEXT: "module-name": "Mod"
49 // CHECK-NEXT: "command-line": [
51 // CHECK-NOT: "-dependency-file"
53 // CHECK: "input-file": "{{.*}}tu2.c"
55 //--- cdb.json.template
59 "command": "clang -MD -MF DIR/tu1.d -fsyntax-only DIR/tu1.c -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache",
64 "command": "clang -fsyntax-only DIR/tu2.c -fmodules -fimplicit-module-maps -fmodules-cache-path=DIR/cache",
69 //--- module.modulemap
70 module Mod
{ header
"Mod.h" }