1 ; RUN: opt < %s -deadargelim -S | FileCheck %s
3 declare void @llvm.va_start(i8*)
5 define internal i32 @va_func(i32 %a, i32 %b, ...) {
7 call void @llvm.va_start(i8* %valist)
12 ; Function derived from AArch64 ABI, where 8 integer arguments go in
13 ; registers but the 9th goes on the stack. We really don't want to put
14 ; just 7 args in registers and then start on the stack since any
15 ; va_arg implementation already present in va_func won't be expecting
17 define i32 @call_va(i32 %in) {
19 store i32 42, i32* %stacked
20 %res = call i32(i32, i32, ...) @va_func(i32 %in, i32 %in, [6 x i32] undef, i32* byval %stacked)
22 ; CHECK: call i32 (i32, i32, ...) @va_func(i32 undef, i32 %in, [6 x i32] undef, i32* byval %stacked)
25 define internal i32 @va_deadret_func(i32 %a, i32 %b, ...) {
27 call void @llvm.va_start(i8* %valist)
32 define void @call_deadret(i32 %in) {
34 store i32 42, i32* %stacked
35 call i32 (i32, i32, ...) @va_deadret_func(i32 undef, i32 %in, [6 x i32] undef, i32* byval %stacked)
37 ; CHECK: call void (i32, i32, ...) @va_deadret_func(i32 undef, i32 undef, [6 x i32] undef, i32* byval %stacked)