@@ -1,16 +1,19 @@ |
|
|
1 |
1 |
# REQUIRES: x86 |
|
2 |
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %S/Inputs/shared.s -o %ta.o |
|
3 |
+# RUN: ld.lld -shared -soname=ta %ta.o -o %ta.so |
2 |
4 |
|
3 |
5 |
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o |
4 |
6 |
# RUN: llvm-objcopy %t1.o %t1copy.o |
5 |
7 |
# RUN: llvm-objcopy --localize-symbol=h1 %t1.o %t1changed.o |
6 |
8 |
# RUN: ld.lld -r %t1.o -o %t1reloc.o |
7 |
9 |
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/icf-safe.s -o %t2.o |
8 |
|
-# RUN: ld.lld %t1.o %t2.o -o %t2 --icf=safe --print-icf-sections | FileCheck %s |
|
10 |
+# RUN: ld.lld %t1.o %t2.o -o %t2 --icf=safe --print-icf-sections --export-dynamic | FileCheck %s |
9 |
11 |
# RUN: ld.lld %t1copy.o %t2.o -o %t2 --icf=safe --print-icf-sections | FileCheck %s |
10 |
12 |
# RUN: ld.lld %t1.o %t2.o -o %t3 --icf=safe --print-icf-sections -shared | FileCheck --check-prefix=EXPORT %s |
11 |
|
-# RUN: ld.lld %t1.o %t2.o -o %t3 --icf=safe --print-icf-sections --export-dynamic | FileCheck --check-prefix=EXPORT %s |
|
13 |
+## Exported symbols are suppressed for ICF when dynamic linking is enabled. |
|
14 |
+# RUN: ld.lld %t1.o %t2.o %ta.so -o %t3 --icf=safe --print-icf-sections --export-dynamic | FileCheck --check-prefix=EXPORT %s |
12 |
15 |
# RUN: ld.lld %t1.o %t2.o -o %t2 --icf=all --print-icf-sections | FileCheck --check-prefix=ALL %s |
13 |
|
-# RUN: ld.lld %t1.o %t2.o -o %t2 --icf=all --print-icf-sections --export-dynamic | FileCheck --check-prefix=ALL-EXPORT %s |
|
16 |
+# RUN: ld.lld %t1.o %t2.o %ta.so -o %t2 --icf=all --print-icf-sections --export-dynamic | FileCheck --check-prefix=ALL-EXPORT %s |
14 |
17 |
# RUN: ld.lld %t1changed.o -o %t4 --icf=safe 2>&1 | FileCheck --check-prefix=SH_LINK_0 %s |
15 |
18 |
# RUN: ld.lld %t1reloc.o -o %t4 --icf=safe 2>&1 | FileCheck --check-prefix=SH_LINK_0 %s |
16 |
19 |
|