xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/a2q-stackalign.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=ppc64 -mcpu=a2 | FileCheck -check-prefix=CHECK-A2 %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=ppc64 -mcpu=a2q | FileCheck -check-prefix=CHECK-A2Q %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=ppc64 -mtriple=powerpc64-bgq-linux -mcpu=a2 | FileCheck -check-prefix=CHECK-BGQ %s
4*9880d681SAndroid Build Coastguard Workertarget datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
5*9880d681SAndroid Build Coastguard Workertarget triple = "powerpc64-unknown-linux-gnu"
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdeclare i32 @bar(i8* %a) nounwind;
8*9880d681SAndroid Build Coastguard Workerdefine i32 @foo() nounwind {
9*9880d681SAndroid Build Coastguard Worker  %p = alloca i8, i8 115
10*9880d681SAndroid Build Coastguard Worker  store i8 0, i8* %p
11*9880d681SAndroid Build Coastguard Worker  %r = call i32 @bar(i8* %p)
12*9880d681SAndroid Build Coastguard Worker  ret i32 %r
13*9880d681SAndroid Build Coastguard Worker}
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker; Without QPX, the allocated stack frame is 240 bytes, but with QPX
16*9880d681SAndroid Build Coastguard Worker; (because we require 32-byte alignment), it is 256 bytes.
17*9880d681SAndroid Build Coastguard Worker; CHECK-A2: @foo
18*9880d681SAndroid Build Coastguard Worker; CHECK-A2: stdu 1, -240(1)
19*9880d681SAndroid Build Coastguard Worker; CHECK-A2Q: @foo
20*9880d681SAndroid Build Coastguard Worker; CHECK-A2Q: stdu 1, -256(1)
21*9880d681SAndroid Build Coastguard Worker; CHECK-BGQ: @foo
22*9880d681SAndroid Build Coastguard Worker; CHECK-BGQ: stdu 1, -256(1)
23*9880d681SAndroid Build Coastguard Worker
24