From 42fec0866c9f6fd07126d5ac3ea3cf52774e9cfa Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 24 Nov 2015 14:15:50 +0000 Subject: [PATCH] Add an already passing test. This tests that a declaration can resolve to an alias. I broke this locally while prototyping a change and it looks like a nice test to have. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253984 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../tools/gold/X86/Inputs/resolve-to-alias.ll | 4 ++++ test/tools/gold/X86/resolve-to-alias.ll | 24 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 test/tools/gold/X86/Inputs/resolve-to-alias.ll create mode 100644 test/tools/gold/X86/resolve-to-alias.ll diff --git a/test/tools/gold/X86/Inputs/resolve-to-alias.ll b/test/tools/gold/X86/Inputs/resolve-to-alias.ll new file mode 100644 index 00000000000..eff02a6f4d1 --- /dev/null +++ b/test/tools/gold/X86/Inputs/resolve-to-alias.ll @@ -0,0 +1,4 @@ +@bar = alias void (), void ()* @zed +define void @zed() { + ret void +} diff --git a/test/tools/gold/X86/resolve-to-alias.ll b/test/tools/gold/X86/resolve-to-alias.ll new file mode 100644 index 00000000000..cad5cdcb3f1 --- /dev/null +++ b/test/tools/gold/X86/resolve-to-alias.ll @@ -0,0 +1,24 @@ +; RUN: llvm-as %s -o %t.o +; RUN: llvm-as %p/Inputs/resolve-to-alias.ll -o %t2.o + +; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: --plugin-opt=emit-llvm \ +; RUN: -shared %t.o %t2.o -o %t.bc +; RUN: llvm-dis %t.bc -o - | FileCheck %s + +define void @foo() { + call void @bar() + ret void +} +declare void @bar() + +; CHECK: @bar = alias void (), void ()* @zed + +; CHECK: define void @foo() { +; CHECK-NEXT: call void @bar() +; CHECK-NEXT: ret void +; CHECK-NEXT: } + +; CHECK: define void @zed() { +; CHECK-NEXT: ret void +; CHECK-NEXT: } -- 2.34.1