blob: fea2dca6a27344a2333f345e3d0af67069dfe1d6 [file] [log] [blame]
Evan Cheng0ea7d212010-04-15 18:42:28 +00001; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -O3 | FileCheck %s
2; rdar://7493908
3
4; Make sure the result of the first dynamic_alloc isn't copied back to sp more
5; than once. We'll deal with poor codegen later.
6
7define arm_apcscc void @t() nounwind ssp {
8entry:
9; CHECK: t:
Evan Cheng3a1588a2010-04-15 22:20:34 +000010; CHECK: mov r0, sp
11; CHECK: bfc r0, #0, #3
12; CHECK: subs r0, #16
13; CHECK: mov sp, r0
Evan Cheng0ea7d212010-04-15 18:42:28 +000014; Yes, this is stupid codegen, but it's correct.
Evan Cheng3a1588a2010-04-15 22:20:34 +000015; CHECK: mov r0, sp
16; CHECK: bfc r0, #0, #3
17; CHECK: subs r0, #16
18; CHECK: mov sp, r0
Evan Cheng0ea7d212010-04-15 18:42:28 +000019 %size = mul i32 8, 2
20 %vla_a = alloca i8, i32 %size, align 8
21 %vla_b = alloca i8, i32 %size, align 8
22 unreachable
23}