1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
2 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=ARM
3 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
5 define i32 @VarArg() nounwind {
7 %i = alloca i32, align 4
8 %j = alloca i32, align 4
9 %k = alloca i32, align 4
10 %m = alloca i32, align 4
11 %n = alloca i32, align 4
12 %tmp = alloca i32, align 4
13 %0 = load i32, ptr %i, align 4
14 %1 = load i32, ptr %j, align 4
15 %2 = load i32, ptr %k, align 4
16 %3 = load i32, ptr %m, align 4
17 %4 = load i32, ptr %n, align 4
19 ; ARM: mov [[FP:r[0-9]+]], sp
20 ; ARM: sub sp, sp, #32
21 ; ARM: ldr r1, [[[FP]], #-4]
22 ; ARM: ldr r2, [[[FP]], #-8]
23 ; ARM: ldr r3, [[[FP]], #-12]
24 ; ARM: ldr [[Ra:r[0-9]+|lr]], [sp, #16]
25 ; ARM: ldr [[Rb:[lr]+[0-9]*]], [sp, #12]
27 ; ARM: str [[Ra]], [sp]
28 ; ARM: str [[Rb]], [sp, #4]
29 ; ARM: bl {{_?CallVariadic}}
31 ; THUMB: ldr r1, [sp, #28]
32 ; THUMB: ldr r2, [sp, #24]
33 ; THUMB: ldr r3, [sp, #20]
34 ; THUMB: ldr.w [[Ra:r[0-9]+]], [sp, #16]
35 ; THUMB: ldr.w [[Rb:r[0-9]+]], [sp, #12]
36 ; THUMB: str.w [[Ra]], [sp]
37 ; THUMB: str.w [[Rb]], [sp, #4]
38 ; THUMB: bl {{_?}}CallVariadic
39 %call = call i32 (i32, ...) @CallVariadic(i32 5, i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
40 store i32 %call, ptr %tmp, align 4
41 %5 = load i32, ptr %tmp, align 4
45 declare i32 @CallVariadic(i32, ...)