diff options
| author | Eric Christopher <echristo@apple.com> | 2011-08-15 20:50:36 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2011-08-15 20:50:36 +0000 |
| commit | 990dd3d0fbb341a3bcce3168e02a920536d87369 (patch) | |
| tree | 5fa97079a01988d5da94ca42a091986fb2d5d660 /llvm/test/Transforms/IPConstantProp | |
| parent | 944f4923a4514d1b26c602cb4f41529525d00de5 (diff) | |
| download | bcm5719-llvm-990dd3d0fbb341a3bcce3168e02a920536d87369.tar.gz bcm5719-llvm-990dd3d0fbb341a3bcce3168e02a920536d87369.zip | |
Add an ipsccp test. Migrated from test/FrontendC++.
llvm-svn: 137646
Diffstat (limited to 'llvm/test/Transforms/IPConstantProp')
| -rw-r--r-- | llvm/test/Transforms/IPConstantProp/global.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/test/Transforms/IPConstantProp/global.ll b/llvm/test/Transforms/IPConstantProp/global.ll new file mode 100644 index 00000000000..67152937bee --- /dev/null +++ b/llvm/test/Transforms/IPConstantProp/global.ll @@ -0,0 +1,26 @@ +; RUN: opt < %s -S -ipsccp | FileCheck %s + +@_ZL6test1g = internal global i32 42, align 4 + +define void @_Z7test1f1v() nounwind { +entry: + %tmp = load i32* @_ZL6test1g, align 4 + %cmp = icmp eq i32 %tmp, 0 + br i1 %cmp, label %if.then, label %if.end + +if.then: ; preds = %entry + store i32 0, i32* @_ZL6test1g, align 4 + br label %if.end + +if.end: ; preds = %if.then, %entry + ret void +} + +; CHECK: @_Z7test1f2v() +; CHECK: entry: +; CHECK-NEXT: ret i32 42 +define i32 @_Z7test1f2v() nounwind { +entry: + %tmp = load i32* @_ZL6test1g, align 4 + ret i32 %tmp +} |

