|
1 | 1 | # REQUIRES: x86
|
| 2 | +# RUN: split-file %s %t |
2 | 3 |
|
3 |
| -# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.o |
4 |
| -# RUN: not %lld -undefined bogus -o /dev/null %t.o 2>&1 | \ |
| 4 | +# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t/live.o |
| 5 | +# RUN: not %lld -undefined bogus -o /dev/null %t/live.o 2>&1 | \ |
5 | 6 | # RUN: FileCheck %s -check-prefix=UNKNOWN
|
6 |
| -# RUN: not %lld -undefined error -o /dev/null %t.o 2>&1 | \ |
| 7 | +# RUN: not %lld -undefined error -o /dev/null %t/live.o 2>&1 | \ |
7 | 8 | # RUN: FileCheck %s -check-prefix=ERROR
|
8 | 9 |
|
9 |
| -# RUN: not %lld -undefined warning -o /dev/null %t.o 2>&1 | \ |
| 10 | +# RUN: not %lld -undefined warning -o /dev/null %t/live.o 2>&1 | \ |
10 | 11 | # RUN: FileCheck %s -check-prefix=INVAL-WARNING
|
11 |
| -# RUN: not %lld -undefined suppress -o /dev/null %t.o 2>&1 | \ |
| 12 | +# RUN: not %lld -undefined suppress -o /dev/null %t/live.o 2>&1 | \ |
12 | 13 | # RUN: FileCheck %s -check-prefix=INVAL-SUPPRESS
|
13 |
| -# RUN: %lld -undefined dynamic_lookup -lSystem -o %t.out %t.o 2>&1 | count 0 |
14 |
| -# RUN: llvm-objdump --macho --lazy-bind %t.out \ |
| 14 | +# RUN: %lld -undefined dynamic_lookup -lSystem -o %t/live.out %t/live.o 2>&1 | count 0 |
| 15 | +# RUN: llvm-objdump --macho --lazy-bind %t/live.out \ |
15 | 16 | # RUN: | FileCheck --check-prefix=BIND %s
|
16 | 17 |
|
17 | 18 | # RUN: %no_fatal_warnings_lld -lSystem -flat_namespace -undefined warning \
|
18 |
| -# RUN: -o %t.out %t.o 2>&1 | \ |
| 19 | +# RUN: -o %t/live.out %t/live.o 2>&1 | \ |
19 | 20 | # RUN: FileCheck %s -check-prefix=WARNING
|
20 |
| -# RUN: llvm-objdump --macho --lazy-bind %t.out \ |
| 21 | +# RUN: llvm-objdump --macho --lazy-bind %t/live.out \ |
21 | 22 | # RUN: | FileCheck --check-prefix=BIND %s
|
22 |
| -# RUN: %lld -flat_namespace -lSystem -undefined suppress -o %t.out %t.o 2>&1 | count 0 |
23 |
| -# RUN: llvm-objdump --macho --lazy-bind %t.out \ |
| 23 | +# RUN: %lld -flat_namespace -lSystem -undefined suppress -o %t/live.out %t/live.o \ |
| 24 | +# RUN: 2>&1 | count 0 |
| 25 | +# RUN: llvm-objdump --macho --lazy-bind %t/live.out \ |
24 | 26 | # RUN: | FileCheck --check-prefix=BIND %s
|
25 |
| -# RUN: %lld -flat_namespace -lSystem -undefined dynamic_lookup -o %t.out %t.o 2>&1 | count 0 |
26 |
| -# RUN: llvm-objdump --macho --lazy-bind %t.out \ |
| 27 | +# RUN: %lld -flat_namespace -lSystem -undefined dynamic_lookup -o \ |
| 28 | +# RUN: %t/live.out %t/live.o 2>&1 | count 0 |
| 29 | +# RUN: llvm-objdump --macho --lazy-bind %t/live.out \ |
27 | 30 | # RUN: | FileCheck --check-prefix=BIND %s
|
28 | 31 |
|
| 32 | +## Undefined symbols in dead code should not raise an error iff |
| 33 | +## -dead_strip is enabled. |
| 34 | +# RUN: not %lld -dylib -undefined error -o /dev/null %t/dead.o 2>&1 \ |
| 35 | +# RUN: | FileCheck --check-prefix=ERROR %s |
| 36 | +# RUN: not %lld -dylib -dead_strip -undefined error -o /dev/null %t/live.o 2>&1\ |
| 37 | +# RUN: | FileCheck --check-prefix=ERROR %s |
| 38 | +# RUN: %lld -dylib -dead_strip -undefined error -o /dev/null %t/dead.o |
| 39 | + |
29 | 40 | # ERROR: error: undefined symbol: _bar
|
30 | 41 | # ERROR-NEXT: >>> referenced by
|
31 | 42 |
|
|
45 | 56 | # BIND: Lazy bind table:
|
46 | 57 | # BIND: __DATA __la_symbol_ptr 0x{{[0-9a-f]*}} flat-namespace _bar
|
47 | 58 |
|
| 59 | +#--- live.s |
48 | 60 | .globl _main
|
49 | 61 | _main:
|
50 | 62 | callq _bar
|
51 | 63 | ret
|
| 64 | + |
| 65 | +#--- dead.s |
| 66 | +_dead: |
| 67 | + callq _bar |
| 68 | + ret |
0 commit comments