[ELF] - ICF: test we do not merge sections which relocations differs only in addend.

This is to test the following `return false` line which
was uncovered by our tests earlier:

https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L255

llvm-svn: 335357
This commit is contained in:
George Rimar 2018-06-22 15:21:38 +00:00
parent 9b9e25d34c
commit 0cde82ade5
1 changed files with 20 additions and 0 deletions

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

@ -0,0 +1,20 @@
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1
# RUN: ld.lld %t1 -o %t --icf=all --print-icf-sections 2>&1 | FileCheck -allow-empty %s
# Check that ICF does not merge 2 sections which relocations
# differs in addend only.
# CHECK-NOT: selected
.section .text
.globl _start
_start:
ret
.section .text.foo, "ax"
.quad _start + 1
.section .text.bar, "ax"
.quad _start + 2