Evan Cheng | 0ea7d21 | 2010-04-15 18:42:28 +0000 | [diff] [blame] | 1 | ; 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 Espindola | 1e81966 | 2010-06-17 15:18:27 +0000 | [diff] [blame] | 7 | define void @t() nounwind ssp { |
Evan Cheng | 0ea7d21 | 2010-04-15 18:42:28 +0000 | [diff] [blame] | 8 | entry: |
| 9 | ; CHECK: t: |
Evan Cheng | 0ea7d21 | 2010-04-15 18:42:28 +0000 | [diff] [blame] | 10 | %size = mul i32 8, 2 |
Jim Grosbach | 65482b1 | 2010-09-03 18:37:12 +0000 | [diff] [blame] | 11 | ; CHECK: subs r0, #16 |
| 12 | ; CHECK: mov sp, r0 |
Evan Cheng | 0ea7d21 | 2010-04-15 18:42:28 +0000 | [diff] [blame] | 13 | %vla_a = alloca i8, i32 %size, align 8 |
Jim Grosbach | 65482b1 | 2010-09-03 18:37:12 +0000 | [diff] [blame] | 14 | ; CHECK: subs r0, #16 |
| 15 | ; CHECK: mov sp, r0 |
Evan Cheng | 0ea7d21 | 2010-04-15 18:42:28 +0000 | [diff] [blame] | 16 | %vla_b = alloca i8, i32 %size, align 8 |
| 17 | unreachable |
| 18 | } |