OSDN Git Service

Add an already passing test.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 24 Nov 2015 14:15:50 +0000 (14:15 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 24 Nov 2015 14:15:50 +0000 (14:15 +0000)
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

test/tools/gold/X86/Inputs/resolve-to-alias.ll [new file with mode: 0644]
test/tools/gold/X86/resolve-to-alias.ll [new file with mode: 0644]

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 (file)
index 0000000..eff02a6
--- /dev/null
@@ -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 (file)
index 0000000..cad5cdc
--- /dev/null
@@ -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: }