Skip to content

Commit e7e3248

Browse files
committed
[lld/mac] Convert undef-spell-corrector.s test to split-file
Differential Revision: https://reviews.llvm.org/D135888
1 parent ad03074 commit e7e3248

File tree

1 file changed

+50
-19
lines changed

1 file changed

+50
-19
lines changed
Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
# REQUIRES: x86
2-
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.o
2+
3+
# RUN: rm -rf %t && split-file %s %t
4+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/test.s -o %t/test.o
5+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/bcde-abcd-abde.s -o %t/bcde-abcd-abde.o
6+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/bbcde-abcdd.s -o %t/bbcde-abcdd.o
7+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/aabcde-abcdee.s -o %t/aabcde-abcdee.o
8+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/bacde.s -o %t/bacde.o
9+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/__Z3fooPi.s -o %t/__Z3fooPi.o
10+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/__Z3fooPKi-__Z3fooPi.s -o %t/__Z3fooPKi-__Z3fooPi.o
11+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/__Z3FOOPKi.s -o %t/__Z3FOOPKi.o
12+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %t/__Z3fooPKi-__Z3FOOPKi.s -o %t/__Z3fooPKi-__Z3FOOPKi.o
313

414
## Insert a character.
515
## The spell corrector is enabled for the first two "undefined symbol" diagnostics.
6-
# RUN: echo 'call bcde; call abcd; call abde' | llvm-mc -filetype=obj -triple=x86_64-apple-macos - -o %t1.o
7-
# RUN: not %lld %t.o %t1.o -o /dev/null 2>&1 | FileCheck --check-prefix=INSERT %s -DFILE=%t.o
16+
# RUN: not %lld %t/test.o %t/bcde-abcd-abde.o -o /dev/null 2>&1 | FileCheck --check-prefix=INSERT %s -DFILE=%t/test.o
817

918
## Symbols defined in DSO can be suggested.
10-
# RUN: %lld %t.o -dylib -o %t.dylib
11-
# RUN: not %lld %t.dylib %t1.o -o /dev/null 2>&1 | FileCheck --check-prefix=INSERT %s -DFILE=%t.dylib
19+
# RUN: %lld %t/test.o -dylib -o %t.dylib
20+
# RUN: not %lld %t.dylib %t/bcde-abcd-abde.o -o /dev/null 2>&1 | FileCheck --check-prefix=INSERT %s -DFILE=%t.dylib
1221

1322
# INSERT: error: undefined symbol: abde
1423
# INSERT-NEXT: >>> referenced by {{.*}}
@@ -23,8 +32,7 @@
2332
# INSERT-NOT: >>>
2433

2534
## Substitute a character.
26-
# RUN: echo 'call bbcde; call abcdd' | llvm-mc -filetype=obj -triple=x86_64-apple-macos - -o %t1.o
27-
# RUN: not %lld %t.o %t1.o -o /dev/null 2>&1 | FileCheck --check-prefix=SUBST %s
35+
# RUN: not %lld %t/test.o %t/bbcde-abcdd.o -o /dev/null 2>&1 | FileCheck --check-prefix=SUBST %s
2836

2937
# SUBST: error: undefined symbol: abcdd
3038
# SUBST-NEXT: >>> referenced by {{.*}}
@@ -34,8 +42,7 @@
3442
# SUBST-NEXT: >>> did you mean: abcde
3543

3644
## Delete a character.
37-
# RUN: echo 'call aabcde; call abcdee' | llvm-mc -filetype=obj -triple=x86_64-apple-macos - -o %t1.o
38-
# RUN: not %lld %t.o %t1.o -o /dev/null 2>&1 | FileCheck --check-prefix=DELETE %s
45+
# RUN: not %lld %t/test.o %t/aabcde-abcdee.o -o /dev/null 2>&1 | FileCheck --check-prefix=DELETE %s
3946

4047
# DELETE: error: undefined symbol: abcdee
4148
# DELETE-NEXT: >>> referenced by {{.*}}
@@ -45,35 +52,59 @@
4552
# DELETE-NEXT: >>> did you mean: abcde
4653

4754
## Transpose.
48-
# RUN: echo 'call bacde' | llvm-mc -filetype=obj -triple=x86_64-apple-macos - -o %t1.o
49-
# RUN: not %lld %t.o %t1.o -o /dev/null 2>&1 | FileCheck --check-prefix=TRANSPOSE %s
55+
# RUN: not %lld %t/test.o %t/bacde.o -o /dev/null 2>&1 | FileCheck --check-prefix=TRANSPOSE %s
5056

5157
# TRANSPOSE: error: undefined symbol: bacde
5258
# TRANSPOSE-NEXT: >>> referenced by {{.*}}
5359
# TRANSPOSE-NEXT: >>> did you mean: abcde
5460

5561
## Missing const qualifier.
56-
# RUN: echo 'call __Z3fooPi' | llvm-mc -filetype=obj -triple=x86_64-apple-macos - -o %t1.o
57-
# RUN: not %lld %t.o %t1.o -demangle -o /dev/null 2>&1 | FileCheck --check-prefix=CONST %s
62+
# RUN: not %lld %t/test.o %t/__Z3fooPi.o -demangle -o /dev/null 2>&1 | FileCheck --check-prefix=CONST %s
5863
## Local defined symbols.
59-
# RUN: echo '__Z3fooPKi: call __Z3fooPi' | llvm-mc -filetype=obj -triple=x86_64-apple-macos - -o %t1.o
60-
# RUN: not %lld %t1.o -demangle -o /dev/null 2>&1 | FileCheck --check-prefix=CONST %s
64+
# RUN: not %lld %t/__Z3fooPKi-__Z3fooPi.o -demangle -o /dev/null 2>&1 | FileCheck --check-prefix=CONST %s
6165

6266
# CONST: error: undefined symbol: foo(int*)
6367
# CONST-NEXT: >>> referenced by {{.*}}
6468
# CONST-NEXT: >>> did you mean: foo(int const*)
6569

6670
## Case mismatch.
67-
# RUN: echo 'call __Z3FOOPKi' | llvm-mc -filetype=obj -triple=x86_64-apple-macos - -o %t1.o
68-
# RUN: not %lld %t.o %t1.o -demangle -o /dev/null 2>&1 | FileCheck --check-prefix=CASE %s
69-
# RUN: echo '__Z3fooPKi: call __Z3FOOPKi' | llvm-mc -filetype=obj -triple=x86_64-apple-macos - -o %t1.o
70-
# RUN: not %lld %t1.o -demangle -o /dev/null 2>&1 | FileCheck --check-prefix=CASE %s
71+
# RUN: not %lld %t/test.o %t/__Z3FOOPKi.o -demangle -o /dev/null 2>&1 | FileCheck --check-prefix=CASE %s
72+
# RUN: not %lld %t/__Z3fooPKi-__Z3FOOPKi.o -demangle -o /dev/null 2>&1 | FileCheck --check-prefix=CASE %s
7173

7274
# CASE: error: undefined symbol: FOO(int const*)
7375
# CASE-NEXT: >>> referenced by {{.*}}
7476
# CASE-NEXT: >>> did you mean: foo(int const*)
7577

78+
#--- test.s
7679
.globl _main, abcde, __Z3fooPKi
7780
_main:
7881
abcde:
7982
__Z3fooPKi:
83+
84+
#--- bcde-abcd-abde.s
85+
call bcde
86+
call abcd
87+
call abde
88+
89+
#--- bbcde-abcdd.s
90+
call bbcde
91+
call abcdd
92+
93+
#--- aabcde-abcdee.s
94+
call aabcde
95+
call abcdee
96+
97+
#--- bacde.s
98+
call bacde
99+
100+
#--- __Z3fooPi.s
101+
call __Z3fooPi
102+
103+
#--- __Z3fooPKi-__Z3fooPi.s
104+
__Z3fooPKi: call __Z3fooPi
105+
106+
#--- __Z3FOOPKi.s
107+
call __Z3FOOPKi
108+
109+
#--- __Z3fooPKi-__Z3FOOPKi.s
110+
__Z3fooPKi: call __Z3FOOPKi

0 commit comments

Comments
 (0)