Easwaran Raman | 22eb80a | 2016-06-27 22:31:53 +0000 | [diff] [blame^] | 1 | ; RUN: opt -inline -S < %s | FileCheck %s |
| 2 | %struct.A = type { i32 } |
| 3 | |
| 4 | define void @callee1(i32 %M) { |
| 5 | entry: |
| 6 | %vla = alloca i32, i32 %M, align 16 |
| 7 | ret void |
| 8 | } |
| 9 | |
| 10 | define void @callee2(i32 %M) { |
| 11 | entry: |
| 12 | %vla = alloca %struct.A, i32 %M, align 16 |
| 13 | ret void |
| 14 | } |
| 15 | |
| 16 | define void @callee3(i128 %M) { |
| 17 | entry: |
| 18 | %vla = alloca i32, i128 %M, align 16 |
| 19 | ret void |
| 20 | } |
| 21 | |
| 22 | ; CHECK-LABEL: @caller |
| 23 | define void @caller() #0 { |
| 24 | entry: |
| 25 | call void @caller() |
| 26 | ; CHECK-NOT: call void @callee1 |
| 27 | call void @callee1(i32 256) |
| 28 | ; CHECK: call void @callee2 |
| 29 | call void @callee2(i32 4096) |
| 30 | ; CHECK: call void @callee3 |
| 31 | ; This is to test that there is no overflow in computing allocated size |
| 32 | ; call void @callee3(i128 0x8000000000000000); |
| 33 | call void @callee3(i128 9223372036854775808); |
| 34 | ret void |
| 35 | } |
| 36 | |