1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -stackrealign -stack-alignment=32 -march=x86-64 -mattr=+avx -mtriple=i686-apple-darwin10 | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; PR11468 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Workerdefine void @f(i64 %sz) uwtable { 5*9880d681SAndroid Build Coastguard Workerentry: 6*9880d681SAndroid Build Coastguard Worker %a = alloca i32, align 32 7*9880d681SAndroid Build Coastguard Worker store volatile i32 0, i32* %a, align 32 8*9880d681SAndroid Build Coastguard Worker ; force to push r14 on stack 9*9880d681SAndroid Build Coastguard Worker call void asm sideeffect "nop", "~{r14},~{dirflag},~{fpsr},~{flags}"() nounwind, !srcloc !0 10*9880d681SAndroid Build Coastguard Worker ret void 11*9880d681SAndroid Build Coastguard Worker 12*9880d681SAndroid Build Coastguard Worker; CHECK: _f 13*9880d681SAndroid Build Coastguard Worker; CHECK: pushq %rbp 14*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_offset %rbp, -16 15*9880d681SAndroid Build Coastguard Worker; CHECK: movq %rsp, %rbp 16*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_def_cfa_register %rbp 17*9880d681SAndroid Build Coastguard Worker 18*9880d681SAndroid Build Coastguard Worker; We first push register on stack, and then realign it, so that 19*9880d681SAndroid Build Coastguard Worker; .cfi_offset value is correct 20*9880d681SAndroid Build Coastguard Worker; CHECK: pushq %r14 21*9880d681SAndroid Build Coastguard Worker; CHECK: andq $-32, %rsp 22*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_offset %r14, -24 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Worker; Restore %rsp from %rbp and subtract the total size of saved regsiters. 25*9880d681SAndroid Build Coastguard Worker; CHECK: leaq -8(%rbp), %rsp 26*9880d681SAndroid Build Coastguard Worker 27*9880d681SAndroid Build Coastguard Worker; Pop saved registers. 28*9880d681SAndroid Build Coastguard Worker; CHECK: popq %r14 29*9880d681SAndroid Build Coastguard Worker; CHECK: popq %rbp 30*9880d681SAndroid Build Coastguard Worker} 31*9880d681SAndroid Build Coastguard Worker 32*9880d681SAndroid Build Coastguard Worker!0 = !{i32 125} 33*9880d681SAndroid Build Coastguard Worker 34