|
9 | 9 | # RUN: cp a.so b.so |
10 | 10 | # RUN: llvm-mc -filetype=obj -triple=x86_64 empty.s -o empty.o && ld.lld -shared empty.o -o empty.so |
11 | 11 |
|
12 | | -# RUN: ld.lld --allow-shlib-undefined main.o a.so -o /dev/null |
13 | | -# RUN: not ld.lld --no-allow-shlib-undefined main.o a.so -o /dev/null 2>&1 | FileCheck %s |
| 12 | +# RUN: ld.lld --allow-shlib-undefined main.o a.so |
| 13 | +# RUN: not ld.lld --no-allow-shlib-undefined main.o a.so 2>&1 | FileCheck %s |
14 | 14 | ## Executable linking defaults to --no-allow-shlib-undefined. |
15 | | -# RUN: not ld.lld main.o a.so -o /dev/null 2>&1 | FileCheck %s |
16 | | -# RUN: ld.lld main.o a.so --noinhibit-exec -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARN |
17 | | -# RUN: ld.lld main.o a.so --warn-unresolved-symbols -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARN |
| 15 | +# RUN: not ld.lld main.o a.so 2>&1 | FileCheck %s |
| 16 | +# RUN: ld.lld main.o a.so --noinhibit-exec 2>&1 | FileCheck %s --check-prefix=WARN |
| 17 | +# RUN: ld.lld main.o a.so --warn-unresolved-symbols 2>&1 | FileCheck %s --check-prefix=WARN |
18 | 18 | ## -shared linking defaults to --allow-shlib-undefined. |
19 | | -# RUN: ld.lld -shared main.o a.so -o /dev/null |
| 19 | +# RUN: ld.lld -shared main.o a.so |
20 | 20 |
|
21 | 21 | ## DSO with undefines should link with or without any of these options. |
22 | | -# RUN: ld.lld -shared --allow-shlib-undefined a.o -o /dev/null |
23 | | -# RUN: ld.lld -shared --no-allow-shlib-undefined a.o -o /dev/null |
| 22 | +# RUN: ld.lld -shared --allow-shlib-undefined a.o |
| 23 | +# RUN: ld.lld -shared --no-allow-shlib-undefined a.o |
24 | 24 |
|
25 | 25 | ## Perform checking even if an unresolved symbol is first seen in a regular object file. |
26 | | -# RUN: not ld.lld --gc-sections main.o ref.o a.so -o /dev/null 2>&1 | FileCheck %s |
| 26 | +# RUN: not ld.lld --gc-sections main.o ref.o a.so 2>&1 | FileCheck %s |
27 | 27 |
|
28 | 28 | ## Check that the error is reported for each shared library where the symbol |
29 | 29 | ## is referenced. |
30 | | -# RUN: not ld.lld main.o a.so empty.so b.so -o /dev/null 2>&1 | FileCheck %s --check-prefix=CHECK2 |
| 30 | +# RUN: not ld.lld main.o a.so empty.so b.so 2>&1 | FileCheck %s --check-prefix=CHECK2 |
31 | 31 |
|
32 | 32 | ## Test some cases when a relocatable object file provides a non-exported definition. |
33 | | -# RUN: not ld.lld main.o a.so def-hidden.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=NONEXPORTED |
34 | | -# RUN: not ld.lld main.o def-hidden.o a.so -o /dev/null 2>&1 | FileCheck %s --check-prefix=NONEXPORTED |
35 | | -# RUN: not ld.lld main.o a.so def-hidden.o -shared --no-allow-shlib-undefined -o /dev/null 2>&1 | FileCheck %s --check-prefix=NONEXPORTED |
36 | | -# RUN: ld.lld main.o a.so def-hidden.o --allow-shlib-undefined --fatal-warnings -o /dev/null |
| 33 | +# RUN: not ld.lld main.o a.so def-hidden.o 2>&1 | FileCheck %s --check-prefix=NONEXPORTED |
| 34 | +# RUN: not ld.lld main.o def-hidden.o a.so 2>&1 | FileCheck %s --check-prefix=NONEXPORTED |
| 35 | +# RUN: not ld.lld main.o a.so def-hidden.o -shared --no-allow-shlib-undefined 2>&1 | FileCheck %s --check-prefix=NONEXPORTED |
| 36 | +# RUN: ld.lld main.o a.so def-hidden.o --allow-shlib-undefined --fatal-warnings |
37 | 37 | ## Test a relocatable object file definition that is converted to STB_LOCAL. |
38 | | -# RUN: not ld.lld main.o a.so def-hidden.o --version-script=local.ver -o /dev/null 2>&1 | FileCheck %s --check-prefix=NONEXPORTED |
39 | | -# RUN: not ld.lld main.o def-hidden.o a.so --version-script=local.ver -o /dev/null 2>&1 | FileCheck %s --check-prefix=NONEXPORTED |
| 38 | +# RUN: not ld.lld main.o a.so def-hidden.o --version-script=local.ver 2>&1 | FileCheck %s --check-prefix=NONEXPORTED |
| 39 | +# RUN: not ld.lld main.o def-hidden.o a.so --version-script=local.ver 2>&1 | FileCheck %s --check-prefix=NONEXPORTED |
40 | 40 |
|
41 | 41 | ## The section containing the definition is discarded, and we report an error. |
42 | | -# RUN: not ld.lld --gc-sections main.o a.so def-hidden.o -o /dev/null 2>&1 | FileCheck %s |
| 42 | +# RUN: not ld.lld --gc-sections main.o a.so def-hidden.o 2>&1 | FileCheck %s |
43 | 43 | ## The definition def.so is ignored. |
44 | 44 | # RUN: ld.lld -shared def.o -o def.so |
45 | | -# RUN: ld.lld --gc-sections main.o a.so def.so def-hidden.o --fatal-warnings -o /dev/null |
| 45 | +# RUN: ld.lld --gc-sections main.o a.so def.so def-hidden.o --fatal-warnings |
46 | 46 |
|
47 | 47 | # CHECK-NOT: error: |
48 | 48 | # CHECK: error: undefined reference: x1{{$}} |
|
0 commit comments