aboutsummaryrefslogtreecommitdiff
path: root/test/ELF/icf-i386.s
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-26 19:24:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-26 19:24:42 +0000
commite06a19b85dfce9ea18be97247d4ca315963edc5c (patch)
treeea315682e394f1c39a30049e4497e1a723f18e3c /test/ELF/icf-i386.s
parentbe08ec96063be8c1a1a8621eccd05a4ebeecfb42 (diff)
downloadsrc-e06a19b85dfce9ea18be97247d4ca315963edc5c.tar.gz
src-e06a19b85dfce9ea18be97247d4ca315963edc5c.zip
Vendor import of lld trunk r301441:vendor/lld/lld-trunk-r301441
Notes
Notes: svn path=/vendor/lld/dist/; revision=317453 svn path=/vendor/lld/lld-trunk-r301441/; revision=317454; tag=vendor/lld/lld-trunk-r301441
Diffstat (limited to 'test/ELF/icf-i386.s')
-rw-r--r--test/ELF/icf-i386.s25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/ELF/icf-i386.s b/test/ELF/icf-i386.s
new file mode 100644
index 000000000000..292883e16fe5
--- /dev/null
+++ b/test/ELF/icf-i386.s
@@ -0,0 +1,25 @@
+# REQUIRES: x86
+# This test is to make sure that we can handle implicit addends properly.
+
+# RUN: llvm-mc -filetype=obj -triple=i386-unknown-linux %s -o %t
+# RUN: ld.lld %t -o %t2 --icf=all --verbose | FileCheck %s
+
+# CHECK: selected .text.f1
+# CHECK: removed .text.f2
+# CHECK-NOT: removed .text.f3
+
+.globl _start, f1, f2, f3
+_start:
+ ret
+
+.section .text.f1, "ax"
+f1:
+ movl $42, 4(%edi)
+
+.section .text.f2, "ax"
+f2:
+ movl $42, 4(%edi)
+
+.section .text.f3, "ax"
+f3:
+ movl $42, 8(%edi)