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 | |
| 7 | define arm_apcscc void @t() nounwind ssp { |
| 8 | entry: |
| 9 | ; CHECK: t: |
| 10 | ; CHECK: mvn r0, #7 |
| 11 | ; CHECK: ands sp, r0 |
| 12 | ; CHECK: mov r1, sp |
| 13 | ; CHECK: mov sp, r1 |
| 14 | ; Yes, this is stupid codegen, but it's correct. |
| 15 | ; CHECK: sub sp, #16 |
| 16 | ; CHECK: mov r1, sp |
| 17 | ; CHECK: mov sp, r1 |
| 18 | ; CHECK: ands sp, r0 |
| 19 | %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 | } |