[llvm] r253984 - Add an already passing test.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 24 06:15:50 PST 2015
Author: rafael
Date: Tue Nov 24 08:15:50 2015
New Revision: 253984
URL: http://llvm.org/viewvc/llvm-project?rev=253984&view=rev
Log:
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.
Added:
llvm/trunk/test/tools/gold/X86/Inputs/resolve-to-alias.ll
llvm/trunk/test/tools/gold/X86/resolve-to-alias.ll
Added: llvm/trunk/test/tools/gold/X86/Inputs/resolve-to-alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/Inputs/resolve-to-alias.ll?rev=253984&view=auto
==============================================================================
--- llvm/trunk/test/tools/gold/X86/Inputs/resolve-to-alias.ll (added)
+++ llvm/trunk/test/tools/gold/X86/Inputs/resolve-to-alias.ll Tue Nov 24 08:15:50 2015
@@ -0,0 +1,4 @@
+ at bar = alias void (), void ()* @zed
+define void @zed() {
+ ret void
+}
Added: llvm/trunk/test/tools/gold/X86/resolve-to-alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/gold/X86/resolve-to-alias.ll?rev=253984&view=auto
==============================================================================
--- llvm/trunk/test/tools/gold/X86/resolve-to-alias.ll (added)
+++ llvm/trunk/test/tools/gold/X86/resolve-to-alias.ll Tue Nov 24 08:15:50 2015
@@ -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: }
More information about the llvm-commits
mailing list