Michael Kuperstein | 5abc276 | 2016-03-18 23:19:29 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -sroa -S | FileCheck %s |
| 2 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 3 | target triple = "x86_64-pc-linux" |
| 4 | |
| 5 | ; Make sure we properly handle allocas where the allocated |
| 6 | ; size overflows a uint32_t. This specific constant results in |
| 7 | ; the size in bits being 32 after truncation to a 32-bit int. |
| 8 | ; CHECK-LABEL: fn1 |
| 9 | ; CHECK-NEXT: ret void |
| 10 | define void @fn1() { |
| 11 | %a = alloca [1073741825 x i32], align 16 |
| 12 | %t0 = bitcast [1073741825 x i32]* %a to i8* |
Matt Arsenault | f10061e | 2017-04-10 20:18:21 +0000 | [diff] [blame] | 13 | call void @llvm.lifetime.end.p0i8(i64 4294967300, i8* %t0) |
Michael Kuperstein | 5abc276 | 2016-03-18 23:19:29 +0000 | [diff] [blame] | 14 | ret void |
| 15 | } |
| 16 | |
Matt Arsenault | f10061e | 2017-04-10 20:18:21 +0000 | [diff] [blame] | 17 | declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) |