1 ; RUN: llc < %s -stack-symbol-ordering=0 -mcpu=generic -stackrealign -mattr=+avx -mtriple=x86_64-apple-darwin10 | FileCheck %s
3 declare void @t1_helper(ptr)
4 declare void @t3_helper(ptr, ptr)
6 ; Test when forcing stack alignment
7 define i32 @t8() nounwind uwtable {
9 %a = alloca i32, align 4
10 call void @t1_helper(ptr %a) nounwind
11 %0 = load i32, ptr %a, align 4
12 %add = add nsw i32 %0, 13
16 ; CHECK: movq %rsp, %rbp
17 ; CHECK: andq $-32, %rsp
18 ; CHECK-NEXT: subq $32, %rsp
19 ; CHECK: movq %rbp, %rsp
24 define i32 @t9(i64 %sz) nounwind uwtable {
26 %a = alloca i32, align 4
27 %vla = alloca i32, i64 %sz, align 16
28 call void @t3_helper(ptr %a, ptr %vla) nounwind
29 %0 = load i32, ptr %a, align 4
30 %add = add nsw i32 %0, 13
35 ; CHECK: movq %rsp, %rbp
37 ; CHECK: andq $-32, %rsp
38 ; CHECK: subq $32, %rsp
39 ; CHECK: movq %rsp, %rbx
41 ; CHECK: leaq -8(%rbp), %rsp
45 !llvm.module.flags = !{!0}
46 !0 = !{i32 2, !"override-stack-alignment", i32 32}