From 99298fc36afcf2fc1865e0c26bfba0a1ef0f3333 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 28 Jul 2014 20:42:29 +0000 Subject: [PATCH] Test the linker plugin handling of llvm.used. llvm-svn: 214116 --- llvm/test/tools/gold/emit-llvm.ll | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/llvm/test/tools/gold/emit-llvm.ll b/llvm/test/tools/gold/emit-llvm.ll index ebf0003..e7b2daa 100644 --- a/llvm/test/tools/gold/emit-llvm.ll +++ b/llvm/test/tools/gold/emit-llvm.ll @@ -3,7 +3,7 @@ ; RUN: ld -plugin %llvmshlibdir/LLVMgold.so \ ; RUN: --plugin-opt=emit-llvm \ ; RUN: -shared %t.o -o %t2.o -; RUN: llvm-dis %t2.o -o /dev/null +; RUN: llvm-dis %t2.o -o - | FileCheck %s ; RUN: ld -plugin %llvmshlibdir/LLVMgold.so \ ; RUN: --plugin-opt=also-emit-llvm \ @@ -16,3 +16,15 @@ ; RUN: llvm-dis %t4 -o /dev/null target triple = "x86_64-unknown-linux-gnu" + +; CHECK: define internal void @f() +define hidden void @f() { + ret void +} + +; CHECK: define hidden void @g() +define hidden void @g() { + ret void +} + +@llvm.used = appending global [1 x i8*] [ i8* bitcast (void ()* @g to i8*)] -- 2.7.4