blob: 3f1b9eb8d9d093b7eba7328ea890d372db062400 [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
Rafael Espindola1e819662010-06-17 15:18:27 +00007define void @t() nounwind ssp {
Evan Cheng0ea7d212010-04-15 18:42:28 +00008entry:
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}