1 ; RUN: llc < %s -mtriple=arm-linux-androideabi -mattr=+v4t -verify-machineinstrs | FileCheck %s -check-prefix=ARM-android
2 ; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -verify-machineinstrs | FileCheck %s -check-prefix=ARM-linux
3 ; RUN: llc < %s -mtriple=arm-linux-androideabi -mattr=+v4t -filetype=obj
4 ; RUN: llc < %s -mtriple=arm-linux-unknown-gnueabi -mattr=+v4t -filetype=obj
6 ; Just to prevent the alloca from being optimized away
7 declare void @dummy_use(ptr, i32)
9 define i32 @test_basic(i32 %l) #0 {
10 %mem = alloca i32, i32 %l
11 call void @dummy_use (ptr %mem, i32 %l)
12 %terminate = icmp eq i32 %l, 0
13 br i1 %terminate, label %true, label %false
19 %newlen = sub i32 %l, 1
20 %retvalue = call i32 @test_basic(i32 %newlen)
23 ; ARM-linux: test_basic:
25 ; ARM-linux: push {r4, r5}
26 ; ARM-linux-NEXT: mrc p15, #0, r4, c13, c0, #3
27 ; ARM-linux-NEXT: mov r5, sp
28 ; ARM-linux-NEXT: ldr r4, [r4, #4]
29 ; ARM-linux-NEXT: cmp r4, r5
30 ; ARM-linux-NEXT: bls .LBB0_2
32 ; ARM-linux: mov r4, #16
33 ; ARM-linux-NEXT: mov r5, #0
34 ; ARM-linux-NEXT: stmdb sp!, {lr}
35 ; ARM-linux-NEXT: bl __morestack
36 ; ARM-linux-NEXT: ldm sp!, {lr}
37 ; ARM-linux-NEXT: pop {r4, r5}
38 ; ARM-linux-NEXT: bx lr
40 ; ARM-linux: pop {r4, r5}
43 ; ARM-android: test_basic:
45 ; ARM-android: push {r4, r5}
46 ; ARM-android-NEXT: mrc p15, #0, r4, c13, c0, #3
47 ; ARM-android-NEXT: mov r5, sp
48 ; ARM-android-NEXT: ldr r4, [r4, #252]
49 ; ARM-android-NEXT: cmp r4, r5
50 ; ARM-android-NEXT: bls .LBB0_2
52 ; ARM-android: mov r4, #16
53 ; ARM-android-NEXT: mov r5, #0
54 ; ARM-android-NEXT: stmdb sp!, {lr}
55 ; ARM-android-NEXT: bl __morestack
56 ; ARM-android-NEXT: ldm sp!, {lr}
57 ; ARM-android-NEXT: pop {r4, r5}
58 ; ARM-android-NEXT: bx lr
60 ; ARM-android: pop {r4, r5}
64 attributes #0 = { "split-stack" }