39 lines · plain
1; RUN: %lli -jit-kind=mcjit -disable-lazy-compilation=false -relocation-model=pic -code-model=small %s2; XFAIL: target={{(mips|mipsel)-.*}}, target={{(i686|i386).*}}, target={{(aarch64|arm).*}}, target={{.*-(cygwin|windows-cygnus)}}3; This test segfaults on cygwin, but succeeds with cygwin-elf. Unfortunately,4; cygwin-elf breaks the remote tests due to lack of __register_frame.5 6define i32 @main() nounwind {7entry:8 call void @lazily_compiled_address_is_consistent()9 ret i32 010}11 12; Test PR3043: @test should have the same address before and after13; it's JIT-compiled.14@funcPtr = common global ptr null, align 415@lcaic_failure = internal constant [46 x i8] c"@lazily_compiled_address_is_consistent failed\00"16 17define void @lazily_compiled_address_is_consistent() nounwind {18entry:19 store ptr @test, ptr @funcPtr20 %pass = tail call i1 @test() ; <i32> [#uses=1]21 br i1 %pass, label %pass_block, label %fail_block22pass_block:23 ret void24fail_block:25 call i32 @puts(ptr @lcaic_failure)26 call void @exit(i32 1)27 unreachable28}29 30define i1 @test() nounwind {31entry:32 %tmp = load ptr, ptr @funcPtr33 %eq = icmp eq ptr %tmp, @test34 ret i1 %eq35}36 37declare i32 @puts(ptr) noreturn38declare void @exit(i32) noreturn39