diff options
| author | Bjorn Steinbrink <bsteinbr@gmail.com> | 2014-09-09 17:10:21 +0000 |
|---|---|---|
| committer | Bjorn Steinbrink <bsteinbr@gmail.com> | 2014-09-09 17:10:21 +0000 |
| commit | 3c3315080149c4e97f201b7f18d7e3b363a97f46 (patch) | |
| tree | 0398cb5ee8329d0984b698e6ae5986aa654fb103 | |
| parent | 8e95dc657eed596fce010c5a4a93ec224c967a18 (diff) | |
| download | bcm5719-llvm-3c3315080149c4e97f201b7f18d7e3b363a97f46.tar.gz bcm5719-llvm-3c3315080149c4e97f201b7f18d7e3b363a97f46.zip | |
Add a test for hoisting instructions with metadata out of then/else blocks
Test for the bug fixed in r215723.
llvm-svn: 217453
| -rw-r--r-- | llvm/test/Transforms/SimplifyCFG/hoist-with-range.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/hoist-with-range.ll b/llvm/test/Transforms/SimplifyCFG/hoist-with-range.ll new file mode 100644 index 00000000000..362aa9a42d1 --- /dev/null +++ b/llvm/test/Transforms/SimplifyCFG/hoist-with-range.ll @@ -0,0 +1,20 @@ +; RUN: opt < %s -simplifycfg -S | FileCheck %s + +define void @foo(i1 %c, i8* %p) { +; CHECK: if: +; CHECK-NEXT: load i8* %p, !range !0 +; CHECK: !0 = metadata !{i8 0, i8 1, i8 3, i8 5} +if: + br i1 %c, label %then, label %else +then: + %t = load i8* %p, !range !0 + br label %out +else: + %e = load i8* %p, !range !1 + br label %out +out: + ret void +} + +!0 = metadata !{ i8 0, i8 1 } +!1 = metadata !{ i8 3, i8 5 } |

