1 ; RUN: %lli -jit-kind=mcjit -remote-mcjit -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s
2 ; XFAIL: target={{.*-windows-(gnu|msvc)}}
3 ; REQUIRES: thread_support
4 ; UNSUPPORTED: target=powerpc64-unknown-linux-gnu
5 ; Remove UNSUPPORTED for powerpc64-unknown-linux-gnu if problem caused by r266663 is fixed
7 define i32 @main() nounwind {
9 call void @lazily_compiled_address_is_consistent()
13 ; Test PR3043: @test should have the same address before and after
15 @funcPtr = common global ptr null, align 4
16 @lcaic_failure = internal constant [46 x i8] c"@lazily_compiled_address_is_consistent failed\00"
18 define void @lazily_compiled_address_is_consistent() nounwind {
20 store ptr @test, ptr @funcPtr
21 %pass = tail call i1 @test() ; <i32> [#uses=1]
22 br i1 %pass, label %pass_block, label %fail_block
26 call i32 @puts(ptr @lcaic_failure)
27 call void @exit(i32 1)
31 define i1 @test() nounwind {
33 %tmp = load ptr, ptr @funcPtr
34 %eq = icmp eq ptr %tmp, @test
38 declare i32 @puts(ptr) noreturn
39 declare void @exit(i32) noreturn