diff options
author | George Rimar <grimar@accesssoftek.com> | 2018-06-25 11:37:27 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2018-06-25 11:37:27 +0000 |
commit | afcd983a496ca6adc764ae55d2f2c4ae90a04d1d (patch) | |
tree | 9960e0d75eee741bc2c73f942d7f265f9da333ac | |
parent | cff2caac75a270a81b7ea08b9f091c6567378fb3 (diff) | |
download | bcm5719-llvm-afcd983a496ca6adc764ae55d2f2c4ae90a04d1d.tar.gz bcm5719-llvm-afcd983a496ca6adc764ae55d2f2c4ae90a04d1d.zip |
[ELF] - ICF: test we do not merge sectinons which relocations points to symbols of the different types.
This test case covers the following line of code:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L261
Previously it was uncovered.
llvm-svn: 335453
-rw-r--r-- | lld/test/ELF/icf13.s | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lld/test/ELF/icf13.s b/lld/test/ELF/icf13.s new file mode 100644 index 00000000000..251b446b48a --- /dev/null +++ b/lld/test/ELF/icf13.s @@ -0,0 +1,20 @@ +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1 +# RUN: ld.lld -shared -z notext %t1 -o %t --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s + +## Check ICF does not collect sections which relocations point to symbols +## of the different types. Like to defined and undefined symbols in this test case. + +# CHECK-NOT: selected + +.globl und + +.section .text +.globl _start +_start: + ret + +.section .text.foo, "ax" +.quad _start + +.section .text.bar, "ax" +.quad und |