[lld] r264925 - [LTO] Add a test to ensure we treat externally available symbols correctly.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 30 14:01:14 PDT 2016
Author: davide
Date: Wed Mar 30 16:01:14 2016
New Revision: 264925
URL: http://llvm.org/viewvc/llvm-project?rev=264925&view=rev
Log:
[LTO] Add a test to ensure we treat externally available symbols correctly.
We already get it right, but there was no coverage for it.
Added:
lld/trunk/test/ELF/lto/Inputs/available-externally.ll
lld/trunk/test/ELF/lto/available-externally.ll
Added: lld/trunk/test/ELF/lto/Inputs/available-externally.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/Inputs/available-externally.ll?rev=264925&view=auto
==============================================================================
--- lld/trunk/test/ELF/lto/Inputs/available-externally.ll (added)
+++ lld/trunk/test/ELF/lto/Inputs/available-externally.ll Wed Mar 30 16:01:14 2016
@@ -0,0 +1,6 @@
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @zed() {
+ ret void
+}
Added: lld/trunk/test/ELF/lto/available-externally.ll
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/lto/available-externally.ll?rev=264925&view=auto
==============================================================================
--- lld/trunk/test/ELF/lto/available-externally.ll (added)
+++ lld/trunk/test/ELF/lto/available-externally.ll Wed Mar 30 16:01:14 2016
@@ -0,0 +1,22 @@
+; RUN: llvm-as %s -o %t1.o
+; RUN: llvm-as %p/Inputs/available-externally.ll -o %t2.o
+; RUN: ld.lld %t1.o %t2.o -m elf_x86_64 -o %t.so -shared -save-temps
+; RUN: llvm-dis < %t.so.lto.bc | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @foo() {
+ call void @bar()
+ call void @zed()
+ ret void
+}
+define available_externally void @bar() {
+ ret void
+}
+define available_externally void @zed() {
+ ret void
+}
+
+; CHECK: define available_externally void @bar() {
+; CHECK: define void @zed() {
More information about the llvm-commits
mailing list