[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
This commit is contained in:
George Rimar 2018-06-25 11:37:27 +00:00
parent cff2caac75
commit afcd983a49
1 changed files with 20 additions and 0 deletions

20
lld/test/ELF/icf13.s Normal file
View File

@ -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