Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions clang/test/ClangScanDeps/include-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@

// RUN: cat %t/result1.txt > %t/full.txt
// RUN: echo "FULL DEPS START" >> %t/full.txt
// RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' >> %t/full.txt
// RUN: cat %t/deps.json >> %t/full.txt

// RUN: FileCheck %s -DPREFIX=%/t -DCLANG=%clang -check-prefix=FULL -input-file %t/full.txt
// RUN: cat %t/full.txt | %PathSanitizingFileCheck --sanitize PREFIX=%/t --sanitize CLANG=%/clang --enable-yaml-compatibility %s -check-prefix=FULL

// Capture the tree id from experimental-include-tree ; ensure that it matches
// the result from experimental-full.
// FULL: [[TREE_ID:llvmcas://[[:xdigit:]]+]] - [[PREFIX]]{{[/\\]}}t.c
// FULL: [[TREE_ID:llvmcas://[[:xdigit:]]+]] - PREFIX{{/|\\}}t.c
// FULL: FULL DEPS START

// FULL-NEXT: {
Expand All @@ -54,7 +54,7 @@
// FULL: "command-line": [
// FULL-NEXT: "-cc1"
// FULL: "-fcas-path"
// FULL-NEXT: "[[PREFIX]]/cas"
// FULL-NEXT: "PREFIX{{/|\\\\}}cas"
// FULL: "-disable-free"
// FULL: "-fcas-include-tree"
// FULL-NEXT: "[[TREE_ID]]"
Expand All @@ -67,17 +67,17 @@
// FULL-NEXT: "t.c"
// FULL-NOT: "t.c"
// FULL: ]
// FULL: "{{.*[\\/]clang(\.exe)?}}",
// FULL: "executable": "CLANG",
// FULL: "file-deps": [
// FULL-NEXT: "[[PREFIX]]/t.c"
// FULL-NEXT: "[[PREFIX]]/top.h"
// FULL-NEXT: "[[PREFIX]]/n1.h"
// FULL-NEXT: "[[PREFIX]]/n2.h"
// FULL-NEXT: "[[PREFIX]]/n3.h"
// FULL-NEXT: "[[PREFIX]]/n3.h"
// FULL-NEXT: "[[PREFIX]]/n2.h"
// FULL-NEXT: "PREFIX{{/|\\\\}}t.c"
// FULL-NEXT: "PREFIX{{/|\\\\}}top.h"
// FULL-NEXT: "PREFIX{{/|\\\\}}n1.h"
// FULL-NEXT: "PREFIX{{/|\\\\}}n2.h"
// FULL-NEXT: "PREFIX{{/|\\\\}}n3.h"
// FULL-NEXT: "PREFIX{{/|\\\\}}n3.h"
// FULL-NEXT: "PREFIX{{/|\\\\}}n2.h"
// FULL-NEXT: ]
// FULL: "input-file": "[[PREFIX]]/t.c"
// FULL: "input-file": "PREFIX{{/|\\\\}}t.c"
// FULL: }
// FULL: ]
// FULL: }
Expand Down
6 changes: 3 additions & 3 deletions clang/test/ClangScanDeps/modules-cas-context-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// RUN: -cas-path %t/cas2 -format experimental-include-tree-full \
// RUN: >> %t/result.json

// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
// RUN: cat %t/result.json | %PathSanitizingFileCheck --sanitize PREFIX=%/t --enable-yaml-compatibility %s

// CHECK: "modules": [
// CHECK: {
Expand All @@ -33,7 +33,7 @@
// CHECK: ],
// CHECK: "command-line": [
// CHECK: "-fmodule-file-cache-key"
// CHECK: "[[PREFIX]]/outputs/[[HASH]]/Mod-[[HASH]].pcm"
// CHECK: "PREFIX{{/|\\\\}}outputs{{/|\\\\}}[[HASH]]{{/|\\\\}}Mod-[[HASH]].pcm"
// CHECK: "llvmcas://[[KEY]]"
// CHECK: ]

Expand All @@ -57,7 +57,7 @@
// CHECK: ],
// CHECK: "command-line": [
// CHECK: "-fmodule-file-cache-key"
// CHECK: "[[PREFIX]]/outputs/[[HASH]]/Mod-[[HASH]].pcm"
// CHECK: "PREFIX{{/|\\\\}}outputs{{/|\\\\}}[[HASH]]{{/|\\\\}}Mod-[[HASH]].pcm"
// CHECK: "llvmcas://[[KEY]]"
// CHECK: ]

Expand Down
22 changes: 11 additions & 11 deletions clang/test/ClangScanDeps/modules-cas-full-by-mod-name.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module transitive { header "transitive.h" }
// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json \
// RUN: -cas-path %t/cas -format experimental-full -module-name=root > %t/result.json
// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
// RUN: cat %t/result.json | %PathSanitizingFileCheck --sanitize PREFIX=%/t --enable-yaml-compatibility %s

// CHECK: {
// CHECK-NEXT: "modules": [
Expand All @@ -43,16 +43,16 @@ module transitive { header "transitive.h" }
// CHECK-NEXT: "module-name": "transitive"
// CHECK-NEXT: }
// CHECK-NEXT: ],
// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
// CHECK-NEXT: "clang-modulemap-file": "PREFIX{{/|\\\\}}module.modulemap",
// CHECK-NEXT: "command-line": [
// CHECK: "-fmodule-file-cache-key"
// CHECK-NEXT: "{{.*transitive-.*\.pcm}}"
// CHECK-NEXT: "[[TRANSITIVE_CACHE_KEY:llvmcas://[[:xdigit:]]+]]"
// CHECK: ],
// CHECK-NEXT: "context-hash": "{{.*}}",
// CHECK-NEXT: "file-deps": [
// CHECK-NEXT: "[[PREFIX]]/module.modulemap"
// CHECK-NEXT: "[[PREFIX]]/direct.h"
// CHECK-NEXT: "PREFIX{{/|\\\\}}module.modulemap"
// CHECK-NEXT: "PREFIX{{/|\\\\}}direct.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
// CHECK-NEXT: "name": "direct"
Expand All @@ -66,17 +66,17 @@ module transitive { header "transitive.h" }
// CHECK-NEXT: "module-name": "direct"
// CHECK-NEXT: }
// CHECK-NEXT: ],
// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
// CHECK-NEXT: "clang-modulemap-file": "PREFIX{{/|\\\\}}module.modulemap",
// CHECK-NEXT: "command-line": [
// CHECK: "-fmodule-file-cache-key"
// CHECK-NEXT: "{{.*direct-.*\.pcm}}"
// CHECK-NEXT: "[[DIRECT_CACHE_KEY]]"
// CHECK: ],
// CHECK-NEXT: "context-hash": "{{.*}}",
// CHECK-NEXT: "file-deps": [
// CHECK-NEXT: "[[PREFIX]]/module.modulemap"
// CHECK-NEXT: "[[PREFIX]]/root.h"
// CHECK-NEXT: "[[PREFIX]]/root/textual.h"
// CHECK-NEXT: "PREFIX{{/|\\\\}}module.modulemap"
// CHECK-NEXT: "PREFIX{{/|\\\\}}root.h"
// CHECK-NEXT: "PREFIX{{/|\\\\}}root{{/|\\\\}}textual.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
// CHECK-NEXT: "name": "root"
Expand All @@ -85,13 +85,13 @@ module transitive { header "transitive.h" }
// CHECK-NEXT: "cache-key": "[[TRANSITIVE_CACHE_KEY]]"
// CHECK-NEXT: "casfs-root-id": "[[LEFT_ROOT_ID]]"
// CHECK-NEXT: "clang-module-deps": [],
// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
// CHECK-NEXT: "clang-modulemap-file": "PREFIX{{/|\\\\}}module.modulemap",
// CHECK-NEXT: "command-line": [
// CHECK: ],
// CHECK-NEXT: "context-hash": "{{.*}}",
// CHECK-NEXT: "file-deps": [
// CHECK-NEXT: "[[PREFIX]]/module.modulemap"
// CHECK-NEXT: "[[PREFIX]]/transitive.h"
// CHECK-NEXT: "PREFIX{{/|\\\\}}module.modulemap"
// CHECK-NEXT: "PREFIX{{/|\\\\}}transitive.h"
// CHECK-NEXT: ],
// CHECK-NEXT: "link-libraries": [],
// CHECK-NEXT: "name": "transitive"
Expand Down
16 changes: 8 additions & 8 deletions clang/test/ClangScanDeps/modules-include-tree-submodules.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// RUN: echo "TRANSLATION UNIT 2" >> %t/result.txt
// RUN: clang-cas-test -cas %t/cas -print-include-tree @%t/tu2.casid >> %t/result.txt

// RUN: cat %t/result.txt | sed 's/\\/\//g' | FileCheck %s -DPREFIX=%/t
// RUN: cat %t/result.txt | %PathSanitizingFileCheck --sanitize PREFIX=%/t %s

// Build the include-tree commands
// RUN: %clang @%t/TwoSubs.rsp
Expand All @@ -39,27 +39,27 @@
// RUN: not %clang @%t/tu2.rsp 2>&1 | FileCheck %s -check-prefix=TU2

// CHECK: MODULE TwoSubs
// CHECK: 2:1 [[PREFIX]]/Sub1.h llvmcas://{{[[:xdigit:]]+}}
// CHECK: 2:1 PREFIX{{/|\\}}Sub1.h llvmcas://{{[[:xdigit:]]+}}
// CHECK: Submodule: TwoSubs.Sub1
// CHECK: 3:1 [[PREFIX]]/Sub2.h llvmcas://{{[[:xdigit:]]+}}
// CHECK: 3:1 PREFIX{{/|\\}}Sub2.h llvmcas://{{[[:xdigit:]]+}}
// CHECK: Submodule: TwoSubs.Sub2

// CHECK: MODULE WithExplicit
// CHECK: 2:1 [[PREFIX]]/TopLevel.h llvmcas://{{[[:xdigit:]]+}}
// CHECK: 2:1 PREFIX{{/|\\}}TopLevel.h llvmcas://{{[[:xdigit:]]+}}
// CHECK: Submodule: WithExplicit
// CHECK: 3:1 [[PREFIX]]/Implicit.h llvmcas://{{[[:xdigit:]]+}}
// CHECK: 3:1 PREFIX{{/|\\}}Implicit.h llvmcas://{{[[:xdigit:]]+}}
// CHECK: Submodule: WithExplicit.Implicit
// CHECK: 4:1 [[PREFIX]]/Explicit.h llvmcas://{{[[:xdigit:]]+}}
// CHECK: 4:1 PREFIX{{/|\\}}Explicit.h llvmcas://{{[[:xdigit:]]+}}
// CHECK: Submodule: WithExplicit.Explicit

// CHECK: TRANSLATION UNIT 1
// CHECK: [[PREFIX]]/tu1.c llvmcas://{{[[:xdigit:]]+}}
// CHECK: PREFIX{{/|\\}}tu1.c llvmcas://{{[[:xdigit:]]+}}
// CHECK: 1:1 <built-in> llvmcas://{{[[:xdigit:]]+}}
// CHECK: 2:1 (Module) TwoSubs.Sub1
// CHECK: 3:1 (Module) WithExplicit

// CHECK: TRANSLATION UNIT 2
// CHECK: [[PREFIX]]/tu2.c llvmcas://{{[[:xdigit:]]+}}
// CHECK: PREFIX{{/|\\}}tu2.c llvmcas://{{[[:xdigit:]]+}}
// CHECK: 1:1 <built-in> llvmcas://{{[[:xdigit:]]+}}
// CHECK: 2:1 (Module) TwoSubs.Sub2
// CHECK: 3:1 (Module) WithExplicit.Explicit
Expand Down
28 changes: 14 additions & 14 deletions clang/test/ClangScanDeps/modules-include-tree-with-pch.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@
// RUN: rm -rf %t/outputs
// RUN: %clang @%t/tu.rsp

// RUN: cat %t/deps.json | sed 's/\\\\/\//g' | FileCheck %s -DPREFIX=%/t
// RUN: cat %t/deps.json | %PathSanitizingFileCheck --sanitize PREFIX=%/t --enable-yaml-compatibility %s

// CHECK: {
// CHECK-NEXT: "modules": [
// CHECK-NEXT: {
// CHECK: "clang-module-deps": []
// CHECK: "clang-modulemap-file": "[[PREFIX]]/module.modulemap"
// CHECK: "clang-modulemap-file": "PREFIX{{/|\\\\}}module.modulemap"
// CHECK: "command-line": [
// CHECK-NEXT: "-cc1"
// CHECK: "-fcas-path"
// CHECK-NEXT: "[[PREFIX]]/cas"
// CHECK-NEXT: "PREFIX{{/|\\\\}}cas"
// CHECK: "-o"
// CHECK-NEXT: "[[PREFIX]]/outputs/{{.*}}/Right-{{.*}}.pcm"
// CHECK-NEXT: "PREFIX{{/|\\\\}}outputs{{/|\\\\}}{{.*}}{{/|\\\\}}Right-{{.*}}.pcm"
// CHECK: "-disable-free"
// CHECK: "-fno-pch-timestamp"
// CHECK: "-fcas-include-tree"
// CHECK-NEXT: "[[RIGHT_TREE:llvmcas://[[:xdigit:]]+]]"
// CHECK: "-fcache-compile-job"
// CHECK: "-emit-module"
// CHECK: "-fmodule-file=[[PREFIX]]/outputs/{{.*}}/Top-{{.*}}.pcm"
// CHECK: "-fmodule-file=PREFIX{{/|\\\\}}outputs{{/|\\\\}}{{.*}}{{/|\\\\}}Top-{{.*}}.pcm"
// CHECK: "-fmodule-file-cache-key"
// CHECK-NEXT: "[[PREFIX]]/{{.*}}/Top-{{.*}}.pcm"
// CHECK-NEXT: "PREFIX{{/|\\\\}}{{.*}}{{/|\\\\}}Top-{{.*}}.pcm"
// CHECK-NEXT: "llvmcas://{{[[:xdigit:]]+}}"
// CHECK: "-x"
// CHECK-NEXT: "c"
Expand All @@ -64,8 +64,8 @@
// CHECK: "-fno-implicit-modules"
// CHECK: ]
// CHECK: "file-deps": [
// CHECK-NEXT: "[[PREFIX]]/module.modulemap"
// CHECK-NEXT: "[[PREFIX]]/Right.h"
// CHECK-NEXT: "PREFIX{{/|\\\\}}module.modulemap"
// CHECK-NEXT: "PREFIX{{/|\\\\}}Right.h"
// CHECK-NEXT: ]
// CHECK: "name": "Right"
// CHECK: }
Expand All @@ -83,27 +83,27 @@
// CHECK: "command-line": [
// CHECK-NEXT: "-cc1"
// CHECK: "-fcas-path"
// CHECK-NEXT: "[[PREFIX]]/cas"
// CHECK-NEXT: "PREFIX{{/|\\\\}}cas"
// CHECK-NOT: -fmodule-map-file=
// CHECK: "-disable-free"
// CHECK: "-fcas-include-tree"
// CHECK-NEXT: "llvmcas://{{[[:xdigit:]]+}}"
// CHECK: "-fcache-compile-job"
// CHECK: "-fsyntax-only"
// CHECK: "-fmodule-file-cache-key"
// CHECK-NEXT: "[[PREFIX]]/outputs/{{.*}}/Right-{{.*}}.pcm"
// CHECK-NEXT: "PREFIX{{/|\\\\}}outputs{{/|\\\\}}{{.*}}{{/|\\\\}}Right-{{.*}}.pcm"
// CHECK-NEXT: "llvmcas://{{[[:xdigit:]]+}}"
// CHECK: "-x"
// CHECK-NEXT: "c"
// CHECK: "-fmodule-file=Right=[[PREFIX]]/outputs/{{.*}}/Right-{{.*}}.pcm"
// CHECK: "-fmodule-file=Right=PREFIX{{/|\\\\}}outputs{{/|\\\\}}{{.*}}{{/|\\\\}}Right-{{.*}}.pcm"
// CHECK: "-fmodules"
// CHECK: "-fno-implicit-modules"
// CHECK: ]
// CHECK: "file-deps": [
// CHECK-NEXT: "[[PREFIX]]/tu.c"
// CHECK-NEXT: "[[PREFIX]]/prefix.h.pch"
// CHECK-NEXT: "PREFIX{{/|\\\\}}tu.c"
// CHECK-NEXT: "PREFIX{{/|\\\\}}prefix.h.pch"
// CHECK-NEXT: ]
// CHECK: "input-file": "[[PREFIX]]/tu.c"
// CHECK: "input-file": "PREFIX{{/|\\\\}}tu.c"
// CHECK: }
// CHECK-NEXT: ]
// CHECK-NEXT: }
Expand Down
Loading