[lld] r266440 - Add an interesting GC testcase.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 15 08:26:52 PDT 2016


Author: rafael
Date: Fri Apr 15 10:26:52 2016
New Revision: 266440

URL: http://llvm.org/viewvc/llvm-project?rev=266440&view=rev
Log:
Add an interesting GC testcase.

It shows that we correctly look at liveness based on the final symbol
resolution.

Added:
    lld/trunk/test/ELF/Inputs/gc-sections-weak.s
    lld/trunk/test/ELF/gc-sections-weak.s

Added: lld/trunk/test/ELF/Inputs/gc-sections-weak.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/gc-sections-weak.s?rev=266440&view=auto
==============================================================================
--- lld/trunk/test/ELF/Inputs/gc-sections-weak.s (added)
+++ lld/trunk/test/ELF/Inputs/gc-sections-weak.s Fri Apr 15 10:26:52 2016
@@ -0,0 +1,8 @@
+.weak foo
+foo:
+        nop
+
+.data
+.global bar2
+bar2:
+.quad foo

Added: lld/trunk/test/ELF/gc-sections-weak.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gc-sections-weak.s?rev=266440&view=auto
==============================================================================
--- lld/trunk/test/ELF/gc-sections-weak.s (added)
+++ lld/trunk/test/ELF/gc-sections-weak.s Fri Apr 15 10:26:52 2016
@@ -0,0 +1,24 @@
+// REQUIRES: x86
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/gc-sections-weak.s -o %t2.o
+// RUN: ld.lld %t.o %t2.o -o %t.so -shared --gc-sections
+// RUN: llvm-readobj -s %t.so | FileCheck %s
+
+.global foo
+foo:
+nop
+
+.data
+.global bar1
+bar1:
+.quad foo
+
+// CHECK:      Name: .text
+// CHECK-NEXT: Type: SHT_PROGBITS
+// CHECK-NEXT: Flags [
+// CHECK-NEXT:   SHF_ALLOC
+// CHECK-NEXT:   SHF_EXECINSTR
+// CHECK-NEXT: ]
+// CHECK-NEXT: Address:
+// CHECK-NEXT: Offset:
+// CHECK-NEXT: Size: 1




More information about the llvm-commits mailing list