diff options
author | Andrey Turetskiy <andrey.turetskiy@gmail.com> | 2016-02-10 11:57:06 +0000 |
---|---|---|
committer | Andrey Turetskiy <andrey.turetskiy@gmail.com> | 2016-02-10 11:57:06 +0000 |
commit | 2396c38a8a9962d23f66357b0932cf2795b0f360 (patch) | |
tree | 1956ac7118a4a4383014b13bf843c691c167dd67 /llvm/test/CodeGen/X86/mcu-abi.ll | |
parent | d985edaa6eedcb9d2d37fda45890a7a28aa2f884 (diff) | |
download | bcm5719-llvm-2396c38a8a9962d23f66357b0932cf2795b0f360.tar.gz bcm5719-llvm-2396c38a8a9962d23f66357b0932cf2795b0f360.zip |
[X86] Fix stack alignment for MCU target, by Anton Nadolskiy.
This patch fixes stack alignments for MCU (should be aligned to 4 bytes).
Differential Revision: http://reviews.llvm.org/D15646
llvm-svn: 260375
Diffstat (limited to 'llvm/test/CodeGen/X86/mcu-abi.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/mcu-abi.ll | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/mcu-abi.ll b/llvm/test/CodeGen/X86/mcu-abi.ll index 966fd4521f2..263ddcf080e 100644 --- a/llvm/test/CodeGen/X86/mcu-abi.ll +++ b/llvm/test/CodeGen/X86/mcu-abi.ll @@ -82,6 +82,8 @@ entry: ret i32 %i1 } +%struct.S = type { i8 } + ; CHECK-LABEL: test_lib_args: ; CHECK: movl %edx, %eax ; CHECK: calll __fixsfsi @@ -108,5 +110,50 @@ define i32 @test_fp128(fp128* %ptr) #0 { declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i32, i1) #1 +; CHECK-LABEL: test_alignment_d: +; CHECK-NOT: andl {{.+}}, %esp +define void @test_alignment_d() #0 { +entry: + %d = alloca double + store double 2.000000e+00, double* %d + call void @food(double* inreg %d) + ret void +} + +; CHECK-LABEL: test_alignment_i: +; CHECK-NOT: andl {{.+}}, %esp +define void @test_alignment_i() #0 { +entry: + %i = alloca i64 + store i64 2, i64* %i + call void @fooi(i64* inreg %i) + ret void +} + + +; CHECK-LABEL: test_alignment_s: +; CHECK-NOT: andl {{.+}}, %esp +define void @test_alignment_s() #0 { + %s = alloca %struct.S, align 4 + call void @foos(%struct.S* inreg %s) + ret void +} + + +; CHECK-LABEL: test_alignment_fp: +; CHECK-NOT: andl {{.+}}, %esp +define void @test_alignment_fp() #0 { +entry: + %f = alloca fp128 + store fp128 0xL00000000000000004000000000000000, fp128* %f + call void @foofp(fp128* inreg %f) + ret void +} + +declare void @food(double* inreg) +declare void @fooi(i64* inreg) +declare void @foos(%struct.S* inreg) +declare void @foofp(fp128* inreg) + attributes #0 = { nounwind "use-soft-float"="true"} attributes #1 = { nounwind argmemonly } |