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