diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-12 16:37:02 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-12 16:37:02 +0000 |
commit | 5ce93b36f58351fe389de5189b2867256b3fcb2c (patch) | |
tree | 944d50d12cbc814a179260471312972297a06d3e /test | |
parent | 0787890d5d3ba4ba6e73035ff87a05bbc13f62e6 (diff) | |
download | external_llvm-5ce93b36f58351fe389de5189b2867256b3fcb2c.zip external_llvm-5ce93b36f58351fe389de5189b2867256b3fcb2c.tar.gz external_llvm-5ce93b36f58351fe389de5189b2867256b3fcb2c.tar.bz2 |
Transform -X/C to X/-C, implementing a README.txt entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/InstCombine/nsw.ll | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/nsw.ll b/test/Transforms/InstCombine/nsw.ll new file mode 100644 index 0000000..3218371 --- /dev/null +++ b/test/Transforms/InstCombine/nsw.ll @@ -0,0 +1,20 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | FileCheck %s + +; CHECK: define i32 @foo +; %y = sub i32 0, %x +; %z = sdiv i32 %y, 337 +; ret i32 %y +define i32 @foo(i32 %x) { + %y = sub i32 0, %x + %z = sdiv i32 %y, 337 + ret i32 %y +} + +; CHECK: define i32 @bar +; %y = sdiv i32 %x, -337 +; ret i32 %y +define i32 @bar(i32 %x) { + %y = sub nsw i32 0, %x + %z = sdiv i32 %y, 337 + ret i32 %y +} |