blob: 486c064cfa7a15c772998f7db6cb2813c41a8e4c [file] [log] [blame]
Evan Cheng1ba14282010-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 Espindola29dda212010-06-17 15:18:27 +00007define void @t() nounwind ssp {
Evan Cheng1ba14282010-04-15 18:42:28 +00008entry:
Stephen Lind24ab202013-07-14 06:24:09 +00009; CHECK-LABEL: t:
Evan Cheng1ba14282010-04-15 18:42:28 +000010 %size = mul i32 8, 2
Jim Grosbach03f4be82010-09-03 18:37:12 +000011; CHECK: subs r0, #16
12; CHECK: mov sp, r0
Evan Cheng1ba14282010-04-15 18:42:28 +000013 %vla_a = alloca i8, i32 %size, align 8
Jim Grosbach03f4be82010-09-03 18:37:12 +000014; CHECK: subs r0, #16
15; CHECK: mov sp, r0
Evan Cheng1ba14282010-04-15 18:42:28 +000016 %vla_b = alloca i8, i32 %size, align 8
17 unreachable
18}