summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-08-13 16:50:20 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-08-13 16:50:20 +0000
commit82edf8d3297ea234698466ed7b7febb447e74ed1 (patch)
tree3477bb964cbc3b89e471cde25920ad65019f6753 /llvm/test/Transforms
parent5e6bd2f8a9bf3ddef78212488bfda466fa1bfd4f (diff)
downloadbcm5719-llvm-82edf8d3297ea234698466ed7b7febb447e74ed1.tar.gz
bcm5719-llvm-82edf8d3297ea234698466ed7b7febb447e74ed1.zip
[InstCombine] Limit simplifyAllocaArraySize constant folding to values that fit into a uint64_t
Fixes OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5223 llvm-svn: 339584
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/alloca-big.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/alloca-big.ll b/llvm/test/Transforms/InstCombine/alloca-big.ll
new file mode 100644
index 00000000000..bff5fcfe4e7
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/alloca-big.ll
@@ -0,0 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+; OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5223
+define void @test_bigalloc() {
+; CHECK-LABEL: @test_bigalloc(
+; CHECK-NEXT: [[TMP1:%.*]] = alloca [18446744069414584320 x i8], align 1
+; CHECK-NEXT: [[DOTSUB:%.*]] = getelementptr inbounds [18446744069414584320 x i8], [18446744069414584320 x i8]* [[TMP1]], i64 0, i64 0
+; CHECK-NEXT: store i8* [[DOTSUB]], i8** undef, align 8
+; CHECK-NEXT: ret void
+;
+ %1 = alloca i8, i864 -4294967296
+ %2 = getelementptr i8, i8* %1, i1 undef
+ store i8* %2, i8** undef
+ ret void
+}
OpenPOWER on IntegriCloud