[llvm] r214916 - Add a test showing the interaction of linker scripts and plugin.

Rafael Espindola rafael.espindola at gmail.com
Tue Aug 5 12:56:53 PDT 2014


Author: rafael
Date: Tue Aug  5 14:56:53 2014
New Revision: 214916

URL: http://llvm.org/viewvc/llvm-project?rev=214916&view=rev
Log:
Add a test showing the interaction of linker scripts and plugin.

In particular, the linker script is processed early enough for function g
to be internalized.

Added:
    llvm/trunk/test/tools/gold/Inputs/linker-script.export
    llvm/trunk/test/tools/gold/linker-script.ll

Added: llvm/trunk/test/tools/gold/Inputs/linker-script.export
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/Inputs/linker-script.export?rev=214916&view=auto
==============================================================================
--- llvm/trunk/test/tools/gold/Inputs/linker-script.export (added)
+++ llvm/trunk/test/tools/gold/Inputs/linker-script.export Tue Aug  5 14:56:53 2014
@@ -0,0 +1,5 @@
+{
+  global:
+    f;
+  local: *;
+};

Added: llvm/trunk/test/tools/gold/linker-script.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/linker-script.ll?rev=214916&view=auto
==============================================================================
--- llvm/trunk/test/tools/gold/linker-script.ll (added)
+++ llvm/trunk/test/tools/gold/linker-script.ll Tue Aug  5 14:56:53 2014
@@ -0,0 +1,17 @@
+; RUN: llvm-as %s -o %t.o
+
+; RUN: ld -plugin %llvmshlibdir/LLVMgold.so \
+; RUN:    --plugin-opt=emit-llvm \
+; RUN:    -shared %t.o -o %t2.o \
+; RUN:    -version-script=%p/Inputs/linker-script.export
+; RUN: llvm-dis %t2.o -o - | FileCheck %s
+
+; CHECK: define void @f()
+define void @f() {
+  ret void
+}
+
+; CHECK: define internal void @g()
+define void @g() {
+  ret void
+}





More information about the llvm-commits mailing list