diff options
author | Dan Gohman <gohman@apple.com> | 2010-04-22 01:35:11 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-04-22 01:35:11 +0000 |
commit | b9d744b7fd2468e365ff3f18b29d20c4726e8060 (patch) | |
tree | af6c45c6f40a50f01aad706ea62df8f681ca1737 /test | |
parent | 5f94709298dcd743d1aa97a0fd6b7168c2f343a3 (diff) | |
download | external_llvm-b9d744b7fd2468e365ff3f18b29d20c4726e8060.zip external_llvm-b9d744b7fd2468e365ff3f18b29d20c4726e8060.tar.gz external_llvm-b9d744b7fd2468e365ff3f18b29d20c4726e8060.tar.bz2 |
Don't attempt to analyze values which are obviously undef. This fixes some
assertion failures in extreme cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102042 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Analysis/ScalarEvolution/undefined.ll | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/Analysis/ScalarEvolution/undefined.ll b/test/Analysis/ScalarEvolution/undefined.ll new file mode 100644 index 0000000..b1f4446 --- /dev/null +++ b/test/Analysis/ScalarEvolution/undefined.ll @@ -0,0 +1,39 @@ +; RUN: opt -analyze -scalar-evolution < %s | FileCheck %s + +; ScalarEvolution shouldn't attempt to interpret expressions which have +; undefined results. + +define void @foo(i64 %x) { + + %a = udiv i64 %x, 0 +; CHECK: --> (%x /u 0) + + %B = shl i64 %x, 64 +; CHECK: --> %B + + %b = ashr i64 %B, 64 +; CHECK: --> %b + + %c = lshr i64 %x, 64 +; CHECK: --> %c + + %d = shl i64 %x, 64 +; CHECK: --> %d + + %E = shl i64 %x, -1 +; CHECK: --> %E + + %e = ashr i64 %E, -1 +; CHECK: --> %e + + %f = lshr i64 %x, -1 +; CHECK: --> %f + + %g = shl i64 %x, -1 +; CHECK: --> %g + + %h = bitcast i64 undef to i64 +; CHECK: --> undef + + ret void +} |