Skip to content

Commit 3792727

Browse files
committed
Fix the following CAS-related tests on Windows (#11236)
Clang :: ClangScanDeps/include-tree.c Clang :: ClangScanDeps/modules-cas-context-hash.c Clang :: ClangScanDeps/modules-cas-full-by-mod-name.c Clang :: ClangScanDeps/modules-cas-module-cache-hash.c Clang :: ClangScanDeps/modules-cas-trees-exclude-files-from-casfs.c Clang :: ClangScanDeps/modules-include-tree-implementation.c Clang :: ClangScanDeps/modules-include-tree-inferred.m Clang :: ClangScanDeps/modules-include-tree-missing-submodule.c Clang :: ClangScanDeps/modules-include-tree-pch-with-private.c Clang :: ClangScanDeps/modules-include-tree-submodules.c Clang :: ClangScanDeps/modules-include-tree-with-pch.c Clang :: ClangScanDeps/modules-include-tree-working-directory.c Clang :: ClangScanDeps/modules-include-tree.c Clang :: Index/Core/scan-deps-cas.m LLVM :: tools/llvm-cas/merge.test LLVM :: tools/llvm-cas/print-id.test LLVM :: tools/llvm-cas/validation.test (Cherry picked from commit 78d4387)
1 parent b43d666 commit 3792727

15 files changed

+153
-148
lines changed

clang/test/ClangScanDeps/include-tree.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
// Make sure order is as expected.
1313
// RUN: FileCheck %s -input-file %t/result1.txt -DPREFIX=%/t -check-prefix ORDER
1414

15-
// ORDER: {{.*}} - [[PREFIX]]/t.c
16-
// ORDER-NEXT: [[PREFIX]]/t.c
15+
// ORDER: {{.*}} - [[PREFIX]]{{[/\\]}}t.c
16+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}t.c
1717
// ORDER-NEXT: 1:1 <built-in>
18-
// ORDER-NEXT: [[PREFIX]]/top.h
19-
// ORDER-NEXT: [[PREFIX]]/n1.h
20-
// ORDER-NEXT: [[PREFIX]]/n2.h
21-
// ORDER-NEXT: [[PREFIX]]/n3.h
22-
// ORDER-NEXT: [[PREFIX]]/n3.h
23-
// ORDER-NEXT: [[PREFIX]]/n2.h
18+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}top.h
19+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}n1.h
20+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}n2.h
21+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}n3.h
22+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}n3.h
23+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}n2.h
2424
// ORDER-NEXT: Files:
25-
// ORDER-NEXT: [[PREFIX]]/t.c
26-
// ORDER-NEXT: [[PREFIX]]/top.h
27-
// ORDER-NEXT: [[PREFIX]]/n1.h
28-
// ORDER-NEXT: [[PREFIX]]/n2.h
29-
// ORDER-NEXT: [[PREFIX]]/n3.h
25+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}t.c
26+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}top.h
27+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}n1.h
28+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}n2.h
29+
// ORDER-NEXT: [[PREFIX]]{{[/\\]}}n3.h
3030
// ORDER-NOT: [[PREFIX]]
3131

3232
// Full dependency output
@@ -40,7 +40,7 @@
4040

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

4646
// FULL-NEXT: {
@@ -67,7 +67,7 @@
6767
// FULL-NEXT: "t.c"
6868
// FULL-NOT: "t.c"
6969
// FULL: ]
70-
// FULL: "executable": "[[CLANG]]"
70+
// FULL: "{{.*[\\/]clang(\.exe)?}}",
7171
// FULL: "file-deps": [
7272
// FULL-NEXT: "[[PREFIX]]/t.c"
7373
// FULL-NEXT: "[[PREFIX]]/top.h"
@@ -110,16 +110,16 @@
110110
//--- t.c
111111

112112
#include "top.h" // this is top
113-
// CHECK: [[@LINE]]:1 [[PREFIX]]/top.h
113+
// CHECK: [[@LINE]]:1 [[PREFIX]]{{[/\\]}}top.h
114114

115115
// Skipped because of macro guard.
116116
#include "n1.h"
117117

118118
#include "n3.h"
119-
// CHECK-DAG: [[@LINE]]:1 [[PREFIX]]/n3.h
119+
// CHECK-DAG: [[@LINE]]:1 [[PREFIX]]{{[/\\]}}n3.h
120120

121121
#include "n2.h"
122-
// CHECK-DAG: [[@LINE]]:1 [[PREFIX]]/n2.h
122+
// CHECK-DAG: [[@LINE]]:1 [[PREFIX]]{{[/\\]}}n2.h
123123

124124
//--- top.h
125125
#ifndef _TOP_H_
@@ -131,10 +131,10 @@ typedef int MyT;
131131

132132
#define WHATEVER 1
133133
#include "n1.h"
134-
// CHECK-DAG: [[@LINE]]:1 [[PREFIX]]/n1.h
134+
// CHECK-DAG: [[@LINE]]:1 [[PREFIX]]{{[/\\]}}n1.h
135135

136136
#include "n3.h"
137-
// CHECK-DAG: [[@LINE]]:1 [[PREFIX]]/n3.h
137+
// CHECK-DAG: [[@LINE]]:1 [[PREFIX]]{{[/\\]}}n3.h
138138

139139
#define ANOTHER 2
140140

@@ -149,7 +149,7 @@ struct S {
149149

150150
int x1;
151151
#include "n2.h"
152-
// CHECK-DAG: [[@LINE]]:1 [[PREFIX]]/n2.h
152+
// CHECK-DAG: [[@LINE]]:1 [[PREFIX]]{{[/\\]}}n2.h
153153

154154
int x2;
155155

clang/test/ClangScanDeps/modules-cas-context-hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// RUN: -cas-path %t/cas2 -format experimental-include-tree-full \
1313
// RUN: >> %t/result.json
1414

15-
// RUN: cat %t/result.json | FileCheck %s -DPREFIX=%/t
15+
// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
1616

1717
// CHECK: "modules": [
1818
// CHECK: {
@@ -105,4 +105,4 @@ module Mod { header "Mod.h" }
105105
//--- Mod.h
106106

107107
//--- tu.c
108-
#include "Mod.h"
108+
#include "Mod.h"

clang/test/ClangScanDeps/modules-include-tree-implementation.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@
1717
// RUN: clang-cas-test -cas %t/cas -print-include-tree @%t/tu.casid | FileCheck %s -DPREFIX=%/t
1818
// RUN: %clang @%t/tu.rsp
1919

20-
// CHECK: [[PREFIX]]/tu.c llvmcas://{{[[:xdigit:]]+}}
20+
// CHECK: [[PREFIX]]{{[/\\]}}tu.c llvmcas://{{[[:xdigit:]]+}}
2121
// CHECK: 1:1 <built-in> llvmcas://{{[[:xdigit:]]+}}
2222

2323
// Note: this is surprising, but correct: when building the implementation files
2424
// of a module, the first include is textual but still uses the submodule
2525
// machinery. The second include is treated as a module import (unless in a PCH)
2626
// but will not actually import the module only trigger visibility changes.
2727

28-
// CHECK: 2:1 [[PREFIX]]/Mod.h llvmcas://{{[[:xdigit:]]+}}
28+
// CHECK: 2:1 [[PREFIX]]{{[/\\]}}Mod.h llvmcas://{{[[:xdigit:]]+}}
2929
// CHECK: Submodule: Mod
3030
// CHECK: 3:1 (Module for visibility only) Mod
3131

3232
// CHECK: Files:
33-
// CHECK: [[PREFIX]]/tu.c llvmcas://{{[[:xdigit:]]+}}
33+
// CHECK: [[PREFIX]]{{[/\\]}}tu.c llvmcas://{{[[:xdigit:]]+}}
3434
// CHECK-NOT: [[PREFIX]]/module.modulemap
35-
// CHECK: [[PREFIX]]/Mod.h llvmcas://{{[[:xdigit:]]+}}
35+
// CHECK: [[PREFIX]]{{[/\\]}}Mod.h llvmcas://{{[[:xdigit:]]+}}
3636
// CHECK-NOT: [[PREFIX]]/module.modulemap
3737

3838
// RUN: %deps-to-rsp %t/deps.json --tu-index 1 > %t/tu_missing_module.rsp

clang/test/ClangScanDeps/modules-include-tree-inferred.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818

1919
// CHECK: <module-includes> llvmcas://
2020
// CHECK: 1:1 <built-in> llvmcas://
21-
// CHECK: 2:1 [[PREFIX]]/Mod.framework/Headers/Mod.h llvmcas://
21+
// CHECK: 2:1 [[PREFIX]]{{[/\\]}}Mod.framework{{[/\\]}}Headers{{[/\\]}}Mod.h llvmcas://
2222
// CHECK: Submodule: Mod
2323
// CHECK: Module Map:
2424
// CHECK: Mod (framework)
2525
// CHECK: link Mod (framework)
2626
// CHECK: Files:
27-
// CHECK-NOT: [[PREFIX]]/module.modulemap
28-
// CHECK: [[PREFIX]]/Mod.framework/Headers/Mod.h llvmcas://
29-
// CHECK-NOT: [[PREFIX]]/module.modulemap
27+
// CHECK-NOT: [[PREFIX]]{{[/\\]}}module.modulemap
28+
// CHECK: [[PREFIX]]{{[/\\]}}Mod.framework{{[/\\]}}Headers{{[/\\]}}Mod.h llvmcas://
29+
// CHECK-NOT: [[PREFIX]]{{[/\\]}}module.modulemap
3030

3131
//--- cdb.json.template
3232
[{

clang/test/ClangScanDeps/modules-include-tree-missing-submodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
// CHECK-LABEL: MODULE Foo
3838
// CHECK: <module-includes> llvmcas://
3939
// CHECK: 1:1 <built-in> llvmcas://
40-
// CHECK: 2:1 [[PREFIX]]/Foo.framework/Headers/Foo.h llvmcas://
40+
// CHECK: 2:1 [[PREFIX]]{{[/\\]}}Foo.framework{{[/\\]}}Headers{{[/\\]}}Foo.h llvmcas://
4141
// CHECK: Submodule: Foo
4242
// CHECK-NOT: Bar
4343
// CHECK: Module Map:
@@ -50,7 +50,7 @@
5050
// CHECK: (PCH) <PCH> llvmcas://
5151
// CHECK: [[PREFIX]]/tu.c llvmcas://
5252
// CHECK: 1:1 <built-in> llvmcas://
53-
// CHECK: 2:1 (Spurious import) (Module) Foo.Bar [[PREFIX]]/Foo.framework/Headers/Bar.h llvmcas://
53+
// CHECK: 2:1 (Spurious import) (Module) Foo.Bar [[PREFIX]]{{[/\\]}}Foo.framework{{[/\\]}}Headers{{[/\\]}}Bar.h llvmcas://
5454

5555
// RUN: %clang @%t/tu.rsp
5656

clang/test/ClangScanDeps/modules-include-tree-pch-with-private.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
// CHECK-LABEL: MODULE Indirect2
4848
// CHECK: <module-includes> llvmcas://
4949
// CHECK: 1:1 <built-in> llvmcas://
50-
// CHECK: 2:1 [[PREFIX]]/indirect2.h llvmcas://
50+
// CHECK: 2:1 [[PREFIX]]{{[/\\]}}indirect2.h llvmcas://
5151
// CHECK: Submodule: Indirect2
5252
// CHECK: 2:1 (Module) Indirect1
5353
// CHECK: 3:1 (Module) Mod_Private

clang/test/ClangScanDeps/modules-include-tree-submodules.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// RUN: echo "TRANSLATION UNIT 2" >> %t/result.txt
3131
// RUN: clang-cas-test -cas %t/cas -print-include-tree @%t/tu2.casid >> %t/result.txt
3232

33-
// RUN: FileCheck %s -input-file %t/result.txt -DPREFIX=%/t
33+
// RUN: cat %t/result.txt | sed 's/\\/\//g' | FileCheck %s -DPREFIX=%/t
3434

3535
// Build the include-tree commands
3636
// RUN: %clang @%t/TwoSubs.rsp

clang/test/ClangScanDeps/modules-include-tree-with-pch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
// RUN: rm -rf %t/outputs
3535
// RUN: %clang @%t/tu.rsp
3636

37-
// RUN: FileCheck %s -input-file %t/deps.json -DPREFIX=%/t
37+
// RUN: cat %t/deps.json | sed 's/\\\\/\//g' | FileCheck %s -DPREFIX=%/t
3838

3939
// CHECK: {
4040
// CHECK-NEXT: "modules": [

clang/test/ClangScanDeps/modules-include-tree-working-directory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
// RUN: clang-cas-test -cas %t/cas -print-include-tree @%t/H.casid | FileCheck %s -DPREFIX=%/t
2424

2525
// CHEK:C <module-includes>
26-
// CHECK: 2:1 [[PREFIX]]/relative/h1.h llvmcas://
26+
// CHECK: 2:1 [[PREFIX]]{{[/\\]}}relative{{[/\\]}}h1.h llvmcas://
2727
// CHECK: Files:
28-
// CHECK: [[PREFIX]]/relative/h1.h llvmcas://
28+
// CHECK: [[PREFIX]]{{[/\\]}}relative{{[/\\]}}h1.h llvmcas://
2929

3030
//--- cdb.json.template
3131
[{

clang/test/ClangScanDeps/modules-include-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// RUN: clang-cas-test -cas %t/cas -print-include-tree @%t/tu.casid >> %t/result.txt
3434
// RUN: cat %t/deps.json >> %t/result.txt
3535

36-
// RUN: FileCheck %s -input-file %t/result.txt -DPREFIX=%/t
36+
// RUN: cat %t/result.txt | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
3737

3838
// CHECK-LABEL: MODULE Top
3939
// CHECK: <module-includes> llvmcas://{{[[:xdigit:]]+}}

0 commit comments

Comments
 (0)