|
1 | 1 | # 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 |
3 | 13 |
|
4 | 14 | ## Insert a character.
|
5 | 15 | ## 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 |
8 | 17 |
|
9 | 18 | ## 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 |
12 | 21 |
|
13 | 22 | # INSERT: error: undefined symbol: abde
|
14 | 23 | # INSERT-NEXT: >>> referenced by {{.*}}
|
|
23 | 32 | # INSERT-NOT: >>>
|
24 | 33 |
|
25 | 34 | ## 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 |
28 | 36 |
|
29 | 37 | # SUBST: error: undefined symbol: abcdd
|
30 | 38 | # SUBST-NEXT: >>> referenced by {{.*}}
|
|
34 | 42 | # SUBST-NEXT: >>> did you mean: abcde
|
35 | 43 |
|
36 | 44 | ## 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 |
39 | 46 |
|
40 | 47 | # DELETE: error: undefined symbol: abcdee
|
41 | 48 | # DELETE-NEXT: >>> referenced by {{.*}}
|
|
45 | 52 | # DELETE-NEXT: >>> did you mean: abcde
|
46 | 53 |
|
47 | 54 | ## 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 |
50 | 56 |
|
51 | 57 | # TRANSPOSE: error: undefined symbol: bacde
|
52 | 58 | # TRANSPOSE-NEXT: >>> referenced by {{.*}}
|
53 | 59 | # TRANSPOSE-NEXT: >>> did you mean: abcde
|
54 | 60 |
|
55 | 61 | ## 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 |
58 | 63 | ## 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 |
61 | 65 |
|
62 | 66 | # CONST: error: undefined symbol: foo(int*)
|
63 | 67 | # CONST-NEXT: >>> referenced by {{.*}}
|
64 | 68 | # CONST-NEXT: >>> did you mean: foo(int const*)
|
65 | 69 |
|
66 | 70 | ## 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 |
71 | 73 |
|
72 | 74 | # CASE: error: undefined symbol: FOO(int const*)
|
73 | 75 | # CASE-NEXT: >>> referenced by {{.*}}
|
74 | 76 | # CASE-NEXT: >>> did you mean: foo(int const*)
|
75 | 77 |
|
| 78 | +#--- test.s |
76 | 79 | .globl _main, abcde, __Z3fooPKi
|
77 | 80 | _main:
|
78 | 81 | abcde:
|
79 | 82 | __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