1 ; RUN: llc < %s -mtriple=thumb-linux-unknown-gnueabi -verify-machineinstrs | FileCheck %s -check-prefix=Thumb-linux 2 ; RUN: llc < %s -mtriple=thumb-linux-androideabi -verify-machineinstrs | FileCheck %s -check-prefix=Thumb-android 3 ; RUN: llc < %s -mtriple=thumb-linux-unknown-gnueabi -filetype=obj 4 ; RUN: llc < %s -mtriple=thumb-linux-androideabi -filetype=obj 5 6 ; Just to prevent the alloca from being optimized away 7 declare void @dummy_use(i32*, i32) 8 9 define i32 @test_basic(i32 %l) #0 { 10 %mem = alloca i32, i32 %l 11 call void @dummy_use (i32* %mem, i32 %l) 12 %terminate = icmp eq i32 %l, 0 13 br i1 %terminate, label %true, label %false 14 15 true: 16 ret i32 0 17 18 false: 19 %newlen = sub i32 %l, 1 20 %retvalue = call i32 @test_basic(i32 %newlen) 21 ret i32 %retvalue 22 23 ; Thumb-linux: test_basic: 24 25 ; Thumb-linux: push {r4, r5} 26 ; Thumb-linux: mov r5, sp 27 ; Thumb-linux-NEXT: ldr r4, .LCPI0_0 28 ; Thumb-linux-NEXT: ldr r4, [r4] 29 ; Thumb-linux-NEXT: cmp r4, r5 30 ; Thumb-linux-NEXT: blo .LBB0_2 31 32 ; Thumb-linux: mov r4, #16 33 ; Thumb-linux-NEXT: mov r5, #0 34 ; Thumb-linux-NEXT: push {lr} 35 ; Thumb-linux-NEXT: bl __morestack 36 ; Thumb-linux-NEXT: pop {r4} 37 ; Thumb-linux-NEXT: mov lr, r4 38 ; Thumb-linux-NEXT: pop {r4, r5} 39 ; Thumb-linux-NEXT: bx lr 40 41 ; Thumb-linux: pop {r4, r5} 42 43 ; Thumb-android: test_basic: 44 45 ; Thumb-android: push {r4, r5} 46 ; Thumb-android: mov r5, sp 47 ; Thumb-android-NEXT: ldr r4, .LCPI0_0 48 ; Thumb-android-NEXT: ldr r4, [r4] 49 ; Thumb-android-NEXT: cmp r4, r5 50 ; Thumb-android-NEXT: blo .LBB0_2 51 52 ; Thumb-android: mov r4, #16 53 ; Thumb-android-NEXT: mov r5, #0 54 ; Thumb-android-NEXT: push {lr} 55 ; Thumb-android-NEXT: bl __morestack 56 ; Thumb-android-NEXT: pop {r4} 57 ; Thumb-android-NEXT: mov lr, r4 58 ; Thumb-android-NEXT: pop {r4, r5} 59 ; Thumb-android-NEXT: bx lr 60 61 ; Thumb-android: pop {r4, r5} 62 63 } 64 65 attributes #0 = { "split-stack" } 66