Skip to content

Commit a4f8bc1

Browse files
committed
[Index] Remove %T usage in index tests
This was removed in llvm#160028. Update to use the unique %t instead. Resolves rdar://161469815.
1 parent cb79f5b commit a4f8bc1

File tree

5 files changed

+30
-24
lines changed

5 files changed

+30
-24
lines changed
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
// RUN: rm -rf %t.idx %t.mcp
2-
// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -mmacosx-version-min=10.7 -c %s -o %t.o -index-store-path %t.idx -fmodules -fmodules-cache-path=%t.mcp -Xclang -fdisable-module-hash -I %S/Inputs/module
3-
// RUN: c-index-test core -aggregate-json %t.idx -o %t.json
4-
// RUN: sed -e "s:%S::g" -e "s:%T::g" %t.json > %t.final.json
5-
// RUN: diff -u %s.json %t.final.json
6-
71
@import ModDep;
82

93
// REQUIRES: shell
4+
5+
// RUN: rm -rf %t
6+
// RUN: mkdir %t
7+
8+
// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -mmacosx-version-min=10.7 -c %s -o %t/json.o -index-store-path %t/idx -fmodules -fmodules-cache-path=%t/mcp -Xclang -fdisable-module-hash -I %S/Inputs/module
9+
// RUN: c-index-test core -aggregate-json %t/idx -o %t/output.json
10+
// RUN: sed -e "s:%S::g" -e "s:%t::g" %t/output.json > %t/final.json
11+
// RUN: diff -u %s.json %t/final.json

clang/test/Index/Store/json-with-module.m.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"files": [
3-
"/json-with-module.m.tmp.mcp/ModDep.pcm",
4-
"/json-with-module.m.tmp.mcp/ModTop.pcm",
3+
"/mcp/ModDep.pcm",
4+
"/mcp/ModTop.pcm",
55
"/Inputs/module/ModDep.h",
66
"/Inputs/module/ModTop.h",
77
"/Inputs/module/ModTopSub1.h",
88
"/Inputs/module/ModTopSub2.h",
9-
"/json-with-module.m.tmp.o",
9+
"/json.o",
1010
"/json-with-module.m",
1111
"/Inputs/module/module.modulemap"
1212
],
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
// RUN: rm -rf %t.idx
2-
// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -mmacosx-version-min=10.7 -x c-header %S/Inputs/head.h -o %t.h.pch -index-store-path %t.idx
3-
// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -mmacosx-version-min=10.7 -c %s -o %t.o -index-store-path %t.idx -include %t.h -Werror
4-
// RUN: c-index-test core -aggregate-json %t.idx -o %t.json
5-
// RUN: sed -e "s:%S::g" -e "s:%T::g" %t.json > %t.final.json
6-
// RUN: diff -u %s.json %t.final.json
7-
81
int main() {
92
test1_func();
103
}
114

125
// REQUIRES: shell
6+
7+
// RUN: rm -rf %t
8+
// RUN: mkdir %t
9+
10+
// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -mmacosx-version-min=10.7 -x c-header %S/Inputs/head.h -o %t/head.h.pch -index-store-path %t/idx
11+
// RUN: %clang -target x86_64-apple-darwin -arch x86_64 -mmacosx-version-min=10.7 -c %s -o %t/head.o -index-store-path %t/idx -include %t/head.h -Werror
12+
// RUN: c-index-test core -aggregate-json %t/idx -o %t/output.json
13+
// RUN: sed -e "s:%S::g" -e "s:%t::g" %t/output.json > %t/final.json
14+
// RUN: diff -u %s.json %t/final.json

clang/test/Index/Store/json-with-pch.c.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"files": [
3-
"/json-with-pch.c.tmp.h.pch",
3+
"/head.h.pch",
44
"/Inputs/head.h",
5-
"/json-with-pch.c.tmp.o",
5+
"/head.o",
66
"/json-with-pch.c"
77
],
88
"symbols": [
@@ -50,13 +50,13 @@
5050
"occurrences": [
5151
{
5252
"symbol": 2,
53-
"line": 8,
53+
"line": 1,
5454
"col": 5,
5555
"roles": "Def"
5656
},
5757
{
5858
"symbol": 0,
59-
"line": 9,
59+
"line": 2,
6060
"col": 3,
6161
"roles": "Ref,Call,RelCall,RelCont",
6262
"relations": [

clang/test/Index/Store/syntax-only.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
// RUN: rm -rf %t.idx
2-
// RUN: %clang -fsyntax-only %s -index-store-path %t.idx -o %T/syntax-only.c.myoutfile
3-
// RUN: c-index-test core -print-unit %t.idx | FileCheck %s -check-prefix=CHECK-UNIT
4-
// RUN: c-index-test core -print-record %t.idx | FileCheck %s -check-prefix=CHECK-RECORD
1+
// RUN: rm -rf %t
2+
// RUN: mkdir %t
3+
//
4+
// RUN: %clang -fsyntax-only %s -index-store-path %t/idx -o %t/syntax-only.c.myoutfile
5+
// RUN: c-index-test core -print-unit %t/idx | FileCheck %s -check-prefix=CHECK-UNIT
6+
// RUN: c-index-test core -print-record %t/idx | FileCheck %s -check-prefix=CHECK-RECORD
57

68
// CHECK-UNIT: out-file: {{.*}}/syntax-only.c.myoutfile
79
// CHECK-RECORD: function/C | foo | c:@F@foo

0 commit comments

Comments
 (0)