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
--- /dev/null
+@bar = alias void (), void ()* @zed
+define void @zed() {
+ ret void
+}
--- /dev/null
+; 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: }