blob: 8beb5b1c894450d4734dd077c39b0b8783d6052c [file] [log] [blame]
Tim Northoverb4ddc082014-05-30 10:09:59 +00001; RUN: llc < %s -mtriple=thumbv7-apple-darwin -mcpu=cortex-a8 -arm-atomic-cfg-tidy=0 -O3 | FileCheck %s
Evan Cheng1ba14282010-04-15 18:42:28 +00002; 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
Elena Demikhovsky82a46eb2013-10-14 07:26:51 +000011; CHECK: sub.w r0, sp, #16
Jim Grosbach03f4be82010-09-03 18:37:12 +000012; CHECK: mov sp, r0
Evan Cheng1ba14282010-04-15 18:42:28 +000013 %vla_a = alloca i8, i32 %size, align 8
Elena Demikhovsky82a46eb2013-10-14 07:26:51 +000014; CHECK: sub.w r0, sp, #16
Jim Grosbach03f4be82010-09-03 18:37:12 +000015; CHECK: mov sp, r0
Evan Cheng1ba14282010-04-15 18:42:28 +000016 %vla_b = alloca i8, i32 %size, align 8
17 unreachable
18}