From 2c3e0051c31c3f5b2328b447eadf1cf9c4427442 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Wed, 6 May 2015 11:46:36 -0700 Subject: Update aosp/master LLVM for rebase to r235153 Change-Id: I9bf53792f9fc30570e81a8d80d296c681d005ea7 (cherry picked from commit 0c7f116bb6950ef819323d855415b2f2b0aad987) --- test/ExecutionEngine/MCJIT/2002-12-16-ArgTest.ll | 2 +- .../MCJIT/2008-06-05-APInt-OverAShr.ll | 2 +- test/ExecutionEngine/MCJIT/fpbitcast.ll | 2 +- test/ExecutionEngine/MCJIT/hello-sm-pic.ll | 12 -------- test/ExecutionEngine/MCJIT/hello2.ll | 2 +- test/ExecutionEngine/OrcLazy/anonymous_globals.ll | 18 +++++++++++ test/ExecutionEngine/OrcLazy/hello.ll | 35 ++++++++++++++++++++++ test/ExecutionEngine/OrcLazy/private_linkage.ll | 12 ++++++++ test/ExecutionEngine/OrcLazy/trivial_retval_1.ll | 26 ---------------- .../ExecutionEngine/OrcMCJIT/2002-12-16-ArgTest.ll | 2 +- .../OrcMCJIT/2008-06-05-APInt-OverAShr.ll | 2 +- test/ExecutionEngine/OrcMCJIT/fpbitcast.ll | 2 +- test/ExecutionEngine/OrcMCJIT/hello-sm-pic.ll | 12 -------- test/ExecutionEngine/OrcMCJIT/hello2.ll | 2 +- .../RuntimeDyld/X86/ELF_x64-64_PIC_relocations.s | 31 +++++++++++++++++++ .../RuntimeDyld/X86/Inputs/ExternalGlobal.ll | 2 ++ .../RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s | 7 +++++ test/ExecutionEngine/fma3-jit.ll | 2 +- test/ExecutionEngine/frem.ll | 2 +- test/ExecutionEngine/test-interp-vec-loadstore.ll | 6 ++-- 20 files changed, 118 insertions(+), 63 deletions(-) delete mode 100644 test/ExecutionEngine/MCJIT/hello-sm-pic.ll create mode 100644 test/ExecutionEngine/OrcLazy/anonymous_globals.ll create mode 100644 test/ExecutionEngine/OrcLazy/hello.ll create mode 100644 test/ExecutionEngine/OrcLazy/private_linkage.ll delete mode 100644 test/ExecutionEngine/OrcLazy/trivial_retval_1.ll delete mode 100644 test/ExecutionEngine/OrcMCJIT/hello-sm-pic.ll create mode 100644 test/ExecutionEngine/RuntimeDyld/X86/ELF_x64-64_PIC_relocations.s create mode 100644 test/ExecutionEngine/RuntimeDyld/X86/Inputs/ExternalGlobal.ll (limited to 'test/ExecutionEngine') diff --git a/test/ExecutionEngine/MCJIT/2002-12-16-ArgTest.ll b/test/ExecutionEngine/MCJIT/2002-12-16-ArgTest.ll index 1ddc5ce..7b1cb16 100644 --- a/test/ExecutionEngine/MCJIT/2002-12-16-ArgTest.ll +++ b/test/ExecutionEngine/MCJIT/2002-12-16-ArgTest.ll @@ -13,7 +13,7 @@ declare i32 @printf(i8*, ...) define i32 @main(i32 %argc, i8** %argv) { bb0: - call i32 (i8*, ...)* @printf( i8* getelementptr ([10 x i8], [10 x i8]* @.LC0, i64 0, i64 0), i32 %argc ) ; :0 [#uses=0] + call i32 (i8*, ...) @printf( i8* getelementptr ([10 x i8], [10 x i8]* @.LC0, i64 0, i64 0), i32 %argc ) ; :0 [#uses=0] %cast224 = bitcast i8** %argv to i8* ; [#uses=1] %local = alloca i8* ; [#uses=3] store i8* %cast224, i8** %local diff --git a/test/ExecutionEngine/MCJIT/2008-06-05-APInt-OverAShr.ll b/test/ExecutionEngine/MCJIT/2008-06-05-APInt-OverAShr.ll index 4e4ad2a..c0a5d3b 100644 --- a/test/ExecutionEngine/MCJIT/2008-06-05-APInt-OverAShr.ll +++ b/test/ExecutionEngine/MCJIT/2008-06-05-APInt-OverAShr.ll @@ -48,7 +48,7 @@ cond_false: ; preds = %entry cond_next: ; preds = %cond_false, %cond_true %tmp5 = getelementptr [10 x i8], [10 x i8]* @.str, i32 0, i32 0 ; [#uses=1] %tmp6 = load i32, i32* %iftmp.0, align 4 ; [#uses=1] - %tmp7 = call i32 (i8*, ...)* @printf( i8* noalias %tmp5, i32 %tmp6 ) nounwind ; [#uses=0] + %tmp7 = call i32 (i8*, ...) @printf( i8* noalias %tmp5, i32 %tmp6 ) nounwind ; [#uses=0] br label %return return: ; preds = %cond_next diff --git a/test/ExecutionEngine/MCJIT/fpbitcast.ll b/test/ExecutionEngine/MCJIT/fpbitcast.ll index bd7beb8..670c142 100644 --- a/test/ExecutionEngine/MCJIT/fpbitcast.ll +++ b/test/ExecutionEngine/MCJIT/fpbitcast.ll @@ -13,7 +13,7 @@ define i32 @main() { %res = call i32 @test(double 3.14) %ptr = getelementptr [4 x i8], [4 x i8]* @format, i32 0, i32 0 - call i32 (i8*,...)* @printf(i8* %ptr, i32 %res) + call i32 (i8*,...) @printf(i8* %ptr, i32 %res) ret i32 0 } diff --git a/test/ExecutionEngine/MCJIT/hello-sm-pic.ll b/test/ExecutionEngine/MCJIT/hello-sm-pic.ll deleted file mode 100644 index 4843f4e..0000000 --- a/test/ExecutionEngine/MCJIT/hello-sm-pic.ll +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: %lli -relocation-model=pic -code-model=small %s > /dev/null -; XFAIL: mips, i686, i386, darwin, aarch64, arm - -@.LC0 = internal global [12 x i8] c"Hello World\00" ; <[12 x i8]*> [#uses=1] - -declare i32 @puts(i8*) - -define i32 @main() { - %reg210 = call i32 @puts( i8* getelementptr ([12 x i8], [12 x i8]* @.LC0, i64 0, i64 0) ) ; [#uses=0] - ret i32 0 -} - diff --git a/test/ExecutionEngine/MCJIT/hello2.ll b/test/ExecutionEngine/MCJIT/hello2.ll index 13b2588..31a1a6e 100644 --- a/test/ExecutionEngine/MCJIT/hello2.ll +++ b/test/ExecutionEngine/MCJIT/hello2.ll @@ -6,7 +6,7 @@ declare void @printf([13 x i8]*, ...) define void @bar() { - call void ([13 x i8]*, ...)* @printf( [13 x i8]* @msg ) + call void ([13 x i8]*, ...) @printf( [13 x i8]* @msg ) ret void } diff --git a/test/ExecutionEngine/OrcLazy/anonymous_globals.ll b/test/ExecutionEngine/OrcLazy/anonymous_globals.ll new file mode 100644 index 0000000..c4c09a0 --- /dev/null +++ b/test/ExecutionEngine/OrcLazy/anonymous_globals.ll @@ -0,0 +1,18 @@ +; RUN: lli -jit-kind=orc-lazy %s + +define private void @0() { +entry: + ret void +} + +define private void @"\01L_foo"() { +entry: + ret void +} + +define i32 @main(i32 %argc, i8** nocapture readnone %argv) { +entry: + call void @0() + tail call void @"\01L_foo"() + ret i32 0 +} diff --git a/test/ExecutionEngine/OrcLazy/hello.ll b/test/ExecutionEngine/OrcLazy/hello.ll new file mode 100644 index 0000000..795224e --- /dev/null +++ b/test/ExecutionEngine/OrcLazy/hello.ll @@ -0,0 +1,35 @@ +; RUN: lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout %s | FileCheck %s +; +; CHECK: Hello +; CHECK: [ {{.*}}main$orc_body ] +; CHECK: Goodbye + +%class.Foo = type { i8 } + +@f = global %class.Foo zeroinitializer, align 1 +@__dso_handle = external global i8 +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_hello.cpp, i8* null }] +@str = private unnamed_addr constant [6 x i8] c"Hello\00" +@str2 = private unnamed_addr constant [8 x i8] c"Goodbye\00" + +define linkonce_odr void @_ZN3FooD1Ev(%class.Foo* nocapture readnone %this) unnamed_addr align 2 { +entry: + %puts.i = tail call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str2, i64 0, i64 0)) + ret void +} + +declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*) + +define i32 @main(i32 %argc, i8** nocapture readnone %argv) { +entry: + ret i32 0 +} + +define internal void @_GLOBAL__sub_I_hello.cpp() { +entry: + %puts.i.i.i = tail call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)) + %0 = tail call i32 @__cxa_atexit(void (i8*)* bitcast (void (%class.Foo*)* @_ZN3FooD1Ev to void (i8*)*), i8* getelementptr inbounds (%class.Foo, %class.Foo* @f, i64 0, i32 0), i8* @__dso_handle) + ret void +} + +declare i32 @puts(i8* nocapture readonly) diff --git a/test/ExecutionEngine/OrcLazy/private_linkage.ll b/test/ExecutionEngine/OrcLazy/private_linkage.ll new file mode 100644 index 0000000..11813dd --- /dev/null +++ b/test/ExecutionEngine/OrcLazy/private_linkage.ll @@ -0,0 +1,12 @@ +; RUN: lli -jit-kind=orc-lazy %s + +define private void @_ZL3foov() { +entry: + ret void +} + +define i32 @main(i32 %argc, i8** nocapture readnone %argv) { +entry: + tail call void @_ZL3foov() + ret i32 0 +} diff --git a/test/ExecutionEngine/OrcLazy/trivial_retval_1.ll b/test/ExecutionEngine/OrcLazy/trivial_retval_1.ll deleted file mode 100644 index 701f22c..0000000 --- a/test/ExecutionEngine/OrcLazy/trivial_retval_1.ll +++ /dev/null @@ -1,26 +0,0 @@ -; RUN: sh -c 'lli -jit-kind=orc-lazy %s; echo $?' | FileCheck %s -; CHECK: {{^30$}} -define i32 @baz() { -entry: - ret i32 2 -} - -define i32 @bar() { -entry: - %call = call i32 @baz() - %mul = mul nsw i32 3, %call - ret i32 %mul -} - -define i32 @foo() { -entry: - %call = call i32 @bar() - %mul = mul nsw i32 5, %call - ret i32 %mul -} - -define i32 @main(i32 %argc, i8** %argv) { -entry: - %call = call i32 @foo() - ret i32 %call -} diff --git a/test/ExecutionEngine/OrcMCJIT/2002-12-16-ArgTest.ll b/test/ExecutionEngine/OrcMCJIT/2002-12-16-ArgTest.ll index e8eb693..825892e 100644 --- a/test/ExecutionEngine/OrcMCJIT/2002-12-16-ArgTest.ll +++ b/test/ExecutionEngine/OrcMCJIT/2002-12-16-ArgTest.ll @@ -13,7 +13,7 @@ declare i32 @printf(i8*, ...) define i32 @main(i32 %argc, i8** %argv) { bb0: - call i32 (i8*, ...)* @printf( i8* getelementptr ([10 x i8], [10 x i8]* @.LC0, i64 0, i64 0), i32 %argc ) ; :0 [#uses=0] + call i32 (i8*, ...) @printf( i8* getelementptr ([10 x i8], [10 x i8]* @.LC0, i64 0, i64 0), i32 %argc ) ; :0 [#uses=0] %cast224 = bitcast i8** %argv to i8* ; [#uses=1] %local = alloca i8* ; [#uses=3] store i8* %cast224, i8** %local diff --git a/test/ExecutionEngine/OrcMCJIT/2008-06-05-APInt-OverAShr.ll b/test/ExecutionEngine/OrcMCJIT/2008-06-05-APInt-OverAShr.ll index 9dc3e5b..f67ae6a 100644 --- a/test/ExecutionEngine/OrcMCJIT/2008-06-05-APInt-OverAShr.ll +++ b/test/ExecutionEngine/OrcMCJIT/2008-06-05-APInt-OverAShr.ll @@ -48,7 +48,7 @@ cond_false: ; preds = %entry cond_next: ; preds = %cond_false, %cond_true %tmp5 = getelementptr [10 x i8], [10 x i8]* @.str, i32 0, i32 0 ; [#uses=1] %tmp6 = load i32, i32* %iftmp.0, align 4 ; [#uses=1] - %tmp7 = call i32 (i8*, ...)* @printf( i8* noalias %tmp5, i32 %tmp6 ) nounwind ; [#uses=0] + %tmp7 = call i32 (i8*, ...) @printf( i8* noalias %tmp5, i32 %tmp6 ) nounwind ; [#uses=0] br label %return return: ; preds = %cond_next diff --git a/test/ExecutionEngine/OrcMCJIT/fpbitcast.ll b/test/ExecutionEngine/OrcMCJIT/fpbitcast.ll index 767b580..d2dbe31 100644 --- a/test/ExecutionEngine/OrcMCJIT/fpbitcast.ll +++ b/test/ExecutionEngine/OrcMCJIT/fpbitcast.ll @@ -13,7 +13,7 @@ define i32 @main() { %res = call i32 @test(double 3.14) %ptr = getelementptr [4 x i8], [4 x i8]* @format, i32 0, i32 0 - call i32 (i8*,...)* @printf(i8* %ptr, i32 %res) + call i32 (i8*,...) @printf(i8* %ptr, i32 %res) ret i32 0 } diff --git a/test/ExecutionEngine/OrcMCJIT/hello-sm-pic.ll b/test/ExecutionEngine/OrcMCJIT/hello-sm-pic.ll deleted file mode 100644 index 59b47af..0000000 --- a/test/ExecutionEngine/OrcMCJIT/hello-sm-pic.ll +++ /dev/null @@ -1,12 +0,0 @@ -; RUN: %lli -jit-kind=orc-mcjit -relocation-model=pic -code-model=small %s > /dev/null -; XFAIL: mips, i686, i386, darwin, aarch64, arm - -@.LC0 = internal global [12 x i8] c"Hello World\00" ; <[12 x i8]*> [#uses=1] - -declare i32 @puts(i8*) - -define i32 @main() { - %reg210 = call i32 @puts( i8* getelementptr ([12 x i8], [12 x i8]* @.LC0, i64 0, i64 0) ) ; [#uses=0] - ret i32 0 -} - diff --git a/test/ExecutionEngine/OrcMCJIT/hello2.ll b/test/ExecutionEngine/OrcMCJIT/hello2.ll index 8f071cd..bb6a9cf 100644 --- a/test/ExecutionEngine/OrcMCJIT/hello2.ll +++ b/test/ExecutionEngine/OrcMCJIT/hello2.ll @@ -6,7 +6,7 @@ declare void @printf([13 x i8]*, ...) define void @bar() { - call void ([13 x i8]*, ...)* @printf( [13 x i8]* @msg ) + call void ([13 x i8]*, ...) @printf( [13 x i8]* @msg ) ret void } diff --git a/test/ExecutionEngine/RuntimeDyld/X86/ELF_x64-64_PIC_relocations.s b/test/ExecutionEngine/RuntimeDyld/X86/ELF_x64-64_PIC_relocations.s new file mode 100644 index 0000000..7598967 --- /dev/null +++ b/test/ExecutionEngine/RuntimeDyld/X86/ELF_x64-64_PIC_relocations.s @@ -0,0 +1,31 @@ +# RUN: llvm-mc -triple=x86_64-pc-linux -relocation-model=pic -filetype=obj -o %T/test_ELF1_x86-64.o %s +# RUN: llvm-mc -triple=x86_64-pc-linux -relocation-model=pic -filetype=obj -o %T/test_ELF2_x86-64.o %s +# RUN: llc -mtriple=x86_64-pc-linux -relocation-model=pic -filetype=obj -o %T/test_ELF_ExternalGlobal_x86-64.o %S/Inputs/ExternalGlobal.ll +# RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify %T/test_ELF1_x86-64.o %T/test_ELF_ExternalGlobal_x86-64.o +# Test that we can load this code twice at memory locations more than 2GB apart +# RUN: llvm-rtdyld -triple=x86_64-pc-linux -verify -map-section test_ELF1_x86-64.o,.got=0x10000 -map-section test_ELF2_x86-64.o,.text=0x100000000 -map-section test_ELF2_x86-64.o,.got=0x100010000 %T/test_ELF1_x86-64.o %T/test_ELF2_x86-64.o %T/test_ELF_ExternalGlobal_x86-64.o + +# Assembly obtained by compiling the following and adding checks: +# @G = external global i8* +# +# define i8* @foo() { +# %ret = load i8** @G +# ret i32 %ret +# } +# + +# + .text + .file "ELF_x64-64_PIC_relocations.ll" + .align 16, 0x90 + .type foo,@function +foo: # @foo +# BB#0: + movq G@GOTPCREL(%rip), %rax + movl (%rax), %eax + retq +.Ltmp0: + .size foo, .Ltmp0-foo + + + .section ".note.GNU-stack","",@progbits diff --git a/test/ExecutionEngine/RuntimeDyld/X86/Inputs/ExternalGlobal.ll b/test/ExecutionEngine/RuntimeDyld/X86/Inputs/ExternalGlobal.ll new file mode 100644 index 0000000..51002aa --- /dev/null +++ b/test/ExecutionEngine/RuntimeDyld/X86/Inputs/ExternalGlobal.ll @@ -0,0 +1,2 @@ +@F = global i8 0 +@G = global i8* @F diff --git a/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s b/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s index 502f276..f28e4d2 100644 --- a/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s +++ b/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s @@ -31,6 +31,13 @@ insn3: movl $0, %eax retq +# Test processing of the __eh_frame section. +# rtdyld-check: *{8}(section_addr(test_x86-64.o, __eh_frame) + 0x20) = eh_frame_test - (section_addr(test_x86-64.o, __eh_frame) + 0x20) +eh_frame_test: + .cfi_startproc + retq + .cfi_endproc + .comm y,4,2 .section __DATA,__data diff --git a/test/ExecutionEngine/fma3-jit.ll b/test/ExecutionEngine/fma3-jit.ll index fe62854..b68b7ae 100644 --- a/test/ExecutionEngine/fma3-jit.ll +++ b/test/ExecutionEngine/fma3-jit.ll @@ -10,7 +10,7 @@ define i32 @main() { %fma = tail call double @llvm.fma.f64(double 3.0, double 3.0, double 3.0) nounwind readnone %ptr1 = getelementptr [4 x i8], [4 x i8]* @msg_double, i32 0, i32 0 - call i32 (i8*,...)* @printf(i8* %ptr1, double %fma) + call i32 (i8*,...) @printf(i8* %ptr1, double %fma) ret i32 0 } diff --git a/test/ExecutionEngine/frem.ll b/test/ExecutionEngine/frem.ll index 2276677..aedaae3 100644 --- a/test/ExecutionEngine/frem.ll +++ b/test/ExecutionEngine/frem.ll @@ -14,7 +14,7 @@ define i32 @main() { %flt = load float, float* @flt %float2 = frem float %flt, 5.0 %double1 = fpext float %float2 to double - call i32 (i8*, ...)* @printf(i8* getelementptr ([18 x i8], [18 x i8]* @str, i32 0, i64 0), double %double1) + call i32 (i8*, ...) @printf(i8* getelementptr ([18 x i8], [18 x i8]* @str, i32 0, i64 0), double %double1) call i32 @fflush(i8* null) ret i32 0 } diff --git a/test/ExecutionEngine/test-interp-vec-loadstore.ll b/test/ExecutionEngine/test-interp-vec-loadstore.ll index 6819724..b66a935 100644 --- a/test/ExecutionEngine/test-interp-vec-loadstore.ll +++ b/test/ExecutionEngine/test-interp-vec-loadstore.ll @@ -73,7 +73,7 @@ define i32 @main() { br i1 %res_i, label %Print_int, label %Double Print_int: %ptr0 = getelementptr [17 x i8], [17 x i8]* @msg_int, i32 0, i32 0 - call i32 (i8*,...)* @printf(i8* %ptr0) + call i32 (i8*,...) @printf(i8* %ptr0) br label %Double Double: store <4 x double> , <4 x double>* %b, align 16 @@ -117,7 +117,7 @@ Double: br i1 %res_double, label %Print_double, label %Float Print_double: %ptr1 = getelementptr [20 x i8], [20 x i8]* @msg_double, i32 0, i32 0 - call i32 (i8*,...)* @printf(i8* %ptr1) + call i32 (i8*,...) @printf(i8* %ptr1) br label %Float Float: store <4 x float> , <4 x float>* %c, align 16 @@ -161,7 +161,7 @@ Float: br i1 %res_float, label %Print_float, label %Exit Print_float: %ptr2 = getelementptr [19 x i8], [19 x i8]* @msg_float, i32 0, i32 0 - call i32 (i8*,...)* @printf(i8* %ptr2) + call i32 (i8*,...) @printf(i8* %ptr2) br label %Exit Exit: -- cgit v1.1