summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorMichael Zolotukhin <mzolotukhin@apple.com>2016-05-24 00:51:01 +0000
committerMichael Zolotukhin <mzolotukhin@apple.com>2016-05-24 00:51:01 +0000
commit3898b2b587e07b427e8e5126d4b077f02a61b9f1 (patch)
tree2001c2a910d1cf2cf65029f7baace991b29bcd8d /llvm/test/Transforms
parent3e78e2d43fa2ba1c8c92078598b14f952e42c4a1 (diff)
downloadbcm5719-llvm-3898b2b587e07b427e8e5126d4b077f02a61b9f1.tar.gz
bcm5719-llvm-3898b2b587e07b427e8e5126d4b077f02a61b9f1.zip
[LoopUnrollAnalyzer] Fix a crash in UnrolledInstAnalyzer::visitCastInst.
This fixes PR27847. llvm-svn: 270517
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/LoopUnroll/full-unroll-crashers.ll21
1 files changed, 20 insertions, 1 deletions
diff --git a/llvm/test/Transforms/LoopUnroll/full-unroll-crashers.ll b/llvm/test/Transforms/LoopUnroll/full-unroll-crashers.ll
index e932851042a..991cb309bf4 100644
--- a/llvm/test/Transforms/LoopUnroll/full-unroll-crashers.ll
+++ b/llvm/test/Transforms/LoopUnroll/full-unroll-crashers.ll
@@ -1,5 +1,5 @@
; Check that we don't crash on corner cases.
-; RUN: opt < %s -S -loop-unroll -unroll-max-iteration-count-to-analyze=1000 -unroll-threshold=10 -unroll-percent-dynamic-cost-saved-threshold=20 -o /dev/null
+; RUN: opt < %s -S -loop-unroll -unroll-max-iteration-count-to-analyze=1000 -unroll-threshold=1 -unroll-percent-dynamic-cost-saved-threshold=20 -o /dev/null
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
@known_constant = internal unnamed_addr constant [10 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1], align 16
@@ -100,3 +100,22 @@ for.body:
for.exit:
ret <4 x i32> %r
}
+
+define void @ptrtoint_cast() optsize {
+entry:
+ br label %for.body
+
+for.body:
+ br i1 true, label %for.inc, label %if.then
+
+if.then:
+ %arraydecay = getelementptr inbounds [1 x i32], [1 x i32]* null, i64 0, i64 0
+ %x = ptrtoint i32* %arraydecay to i64
+ br label %for.inc
+
+for.inc:
+ br i1 false, label %for.body, label %for.cond.cleanup
+
+for.cond.cleanup:
+ ret void
+}
OpenPOWER on IntegriCloud