xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/inalloca-regparm.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=i686-windows-msvc < %s -o /dev/null
2*9880d681SAndroid Build Coastguard Worker; RUN: not llc -mtriple=x86_64-windows-msvc %s -o /dev/null 2>&1 | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker; This will compile successfully on x86 but not x86_64, because %b will become a
5*9880d681SAndroid Build Coastguard Worker; register parameter.
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdeclare x86_thiscallcc i32 @f(i32 %a, i32* inalloca %b)
8*9880d681SAndroid Build Coastguard Workerdefine void @g() {
9*9880d681SAndroid Build Coastguard Worker  %b = alloca inalloca i32
10*9880d681SAndroid Build Coastguard Worker  store i32 2, i32* %b
11*9880d681SAndroid Build Coastguard Worker  call x86_thiscallcc i32 @f(i32 0, i32* inalloca %b)
12*9880d681SAndroid Build Coastguard Worker  ret void
13*9880d681SAndroid Build Coastguard Worker}
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard Worker; CHECK: cannot use inalloca attribute on a register parameter
16