[llvm-commits] [llvm] r83346 - /llvm/trunk/test/ExecutionEngine/stubs.ll
Jeffrey Yasskin
jyasskin at google.com
Mon Oct 5 16:51:08 PDT 2009
Author: jyasskin
Date: Mon Oct 5 18:51:08 2009
New Revision: 83346
URL: http://llvm.org/viewvc/llvm-project?rev=83346&view=rev
Log:
Add a test for http://llvm.org/PR3043.
Added:
llvm/trunk/test/ExecutionEngine/stubs.ll
Added: llvm/trunk/test/ExecutionEngine/stubs.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/ExecutionEngine/stubs.ll?rev=83346&view=auto
==============================================================================
--- llvm/trunk/test/ExecutionEngine/stubs.ll (added)
+++ llvm/trunk/test/ExecutionEngine/stubs.ll Mon Oct 5 18:51:08 2009
@@ -0,0 +1,35 @@
+; RUN: llvm-as < %s | lli -disable-lazy-compilation=false
+
+define i32 @main() nounwind {
+entry:
+ call void @lazily_compiled_address_is_consistent()
+ ret i32 0
+}
+
+; Test PR3043: @test should have the same address before and after
+; it's JIT-compiled.
+ at funcPtr = common global i1 ()* null, align 4
+ at lcaic_failure = internal constant [46 x i8] c"@lazily_compiled_address_is_consistent failed\00"
+
+define void @lazily_compiled_address_is_consistent() nounwind {
+entry:
+ store i1 ()* @test, i1 ()** @funcPtr
+ %pass = tail call i1 @test() ; <i32> [#uses=1]
+ br i1 %pass, label %pass_block, label %fail_block
+pass_block:
+ ret void
+fail_block:
+ call i32 @puts(i8* getelementptr([46 x i8]* @lcaic_failure, i32 0, i32 0))
+ call void @exit(i32 1)
+ unreachable
+}
+
+define i1 @test() nounwind {
+entry:
+ %tmp = load i1 ()** @funcPtr
+ %eq = icmp eq i1 ()* %tmp, @test
+ ret i1 %eq
+}
+
+declare i32 @puts(i8*) noreturn
+declare void @exit(i32) noreturn
More information about the llvm-commits
mailing list