summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-11-24 14:15:50 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-11-24 14:15:50 +0000
commit23117e5a7b58a4a65c2d33925dd6725ed6485c05 (patch)
tree04bcffa2e503739bcb14df181d1e0bf1ca5305ce /llvm
parent8443d187e65bfe7bd569eb3e163ec98c5358d818 (diff)
downloadbcm5719-llvm-23117e5a7b58a4a65c2d33925dd6725ed6485c05.tar.gz
bcm5719-llvm-23117e5a7b58a4a65c2d33925dd6725ed6485c05.zip
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. llvm-svn: 253984
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/tools/gold/X86/Inputs/resolve-to-alias.ll4
-rw-r--r--llvm/test/tools/gold/X86/resolve-to-alias.ll24
2 files changed, 28 insertions, 0 deletions
diff --git a/llvm/test/tools/gold/X86/Inputs/resolve-to-alias.ll b/llvm/test/tools/gold/X86/Inputs/resolve-to-alias.ll
new file mode 100644
index 00000000000..eff02a6f4d1
--- /dev/null
+++ b/llvm/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/llvm/test/tools/gold/X86/resolve-to-alias.ll b/llvm/test/tools/gold/X86/resolve-to-alias.ll
new file mode 100644
index 00000000000..cad5cdcb3f1
--- /dev/null
+++ b/llvm/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: }
OpenPOWER on IntegriCloud