• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=thumb-linux-androideabi -mcpu=arm1156t2-s -mattr=+thumb2 -verify-machineinstrs | FileCheck %s -check-prefix=THUMB
3; RUN: llc < %s -mtriple=arm-linux-androideabi -mcpu=arm1156t2-s -verify-machineinstrs | FileCheck %s -check-prefix=ARM
4
5
6; Just to prevent the alloca from being optimized away
7declare void @dummy_use(i32*, i32)
8
9define void @test_basic() #0 {
10; THUMB-LABEL: test_basic:
11; THUMB:       @ %bb.0:
12; THUMB-NEXT:    push {r4, r5}
13; THUMB-NEXT:    mrc p15, #0, r4, c13, c0, #3
14; THUMB-NEXT:    mov r5, sp
15; THUMB-NEXT:    ldr.w r4, [r4, #252]
16; THUMB-NEXT:    cmp r4, r5
17; THUMB-NEXT:    blo .LBB0_2
18; THUMB-NEXT:  @ %bb.1:
19; THUMB-NEXT:    mov r4, #48
20; THUMB-NEXT:    mov r5, #0
21; THUMB-NEXT:    push {lr}
22; THUMB-NEXT:    bl __morestack
23; THUMB-NEXT:    ldr lr, [sp], #4
24; THUMB-NEXT:    pop {r4, r5}
25; THUMB-NEXT:    bx lr
26; THUMB-NEXT:  .LBB0_2:
27; THUMB-NEXT:    pop {r4, r5}
28; THUMB-NEXT:    .save {r7, lr}
29; THUMB-NEXT:    push {r7, lr}
30; THUMB-NEXT:    .pad #40
31; THUMB-NEXT:    sub sp, #40
32; THUMB-NEXT:    mov r0, sp
33; THUMB-NEXT:    movs r1, #10
34; THUMB-NEXT:    bl dummy_use
35; THUMB-NEXT:    add sp, #40
36; THUMB-NEXT:    pop {r7, pc}
37;
38; ARM-LABEL: test_basic:
39; ARM:       @ %bb.0:
40; ARM-NEXT:    push {r4, r5}
41; ARM-NEXT:    mrc p15, #0, r4, c13, c0, #3
42; ARM-NEXT:    mov r5, sp
43; ARM-NEXT:    ldr r4, [r4, #252]
44; ARM-NEXT:    cmp r4, r5
45; ARM-NEXT:    blo .LBB0_2
46; ARM-NEXT:  @ %bb.1:
47; ARM-NEXT:    mov r4, #48
48; ARM-NEXT:    mov r5, #0
49; ARM-NEXT:    stmdb sp!, {lr}
50; ARM-NEXT:    bl __morestack
51; ARM-NEXT:    ldm sp!, {lr}
52; ARM-NEXT:    pop {r4, r5}
53; ARM-NEXT:    bx lr
54; ARM-NEXT:  .LBB0_2:
55; ARM-NEXT:    pop {r4, r5}
56; ARM-NEXT:    .save {r11, lr}
57; ARM-NEXT:    push {r11, lr}
58; ARM-NEXT:    .pad #40
59; ARM-NEXT:    sub sp, sp, #40
60; ARM-NEXT:    mov r0, sp
61; ARM-NEXT:    mov r1, #10
62; ARM-NEXT:    bl dummy_use
63; ARM-NEXT:    add sp, sp, #40
64; ARM-NEXT:    pop {r11, pc}
65  %mem = alloca i32, i32 10
66  call void @dummy_use (i32* %mem, i32 10)
67  ret void
68}
69
70attributes #0 = { "split-stack" }
71