[lld] r265853 - Add an interesting test case we already pass.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 8 14:33:04 PDT 2016
Author: rafael
Date: Fri Apr 8 16:33:04 2016
New Revision: 265853
URL: http://llvm.org/viewvc/llvm-project?rev=265853&view=rev
Log:
Add an interesting test case we already pass.
We had no tests for the interaction of relocations pointing to tail
merged strings.
Added:
lld/trunk/test/ELF/merge-shared-str.s
Added: lld/trunk/test/ELF/merge-shared-str.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/merge-shared-str.s?rev=265853&view=auto
==============================================================================
--- lld/trunk/test/ELF/merge-shared-str.s (added)
+++ lld/trunk/test/ELF/merge-shared-str.s Fri Apr 8 16:33:04 2016
@@ -0,0 +1,28 @@
+// REQUIRES: x86
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+// RUN: ld.lld %t.o -o %t.so -shared -O3
+// RUN: llvm-readobj -r -s %t.so | FileCheck %s
+
+
+ .section foo,"aMS", at progbits,1
+ .asciz "bar"
+ .asciz "ar"
+
+ .text
+ .quad foo + 4
+
+
+// CHECK: Name: foo
+// CHECK-NEXT: Type: SHT_PROGBITS
+// CHECK-NEXT: Flags [
+// CHECK-NEXT: SHF_ALLOC
+// CHECK-NEXT: SHF_MERGE
+// CHECK-NEXT: SHF_STRINGS
+// CHECK-NEXT: ]
+// CHECK-NEXT: Address: 0x1C8
+
+// CHECK: Relocations [
+// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
+// CHECK-NEXT: 0x{{.*}} R_X86_64_RELATIVE - 0x1C9
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
More information about the llvm-commits
mailing list