llvm.org GIT mirror llvm / f000957
Add an ipsccp test. Migrated from test/FrontendC++. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137646 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 8 years ago
1 changed file(s) with 26 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -S -ipsccp | FileCheck %s
1
2 @_ZL6test1g = internal global i32 42, align 4
3
4 define void @_Z7test1f1v() nounwind {
5 entry:
6 %tmp = load i32* @_ZL6test1g, align 4
7 %cmp = icmp eq i32 %tmp, 0
8 br i1 %cmp, label %if.then, label %if.end
9
10 if.then: ; preds = %entry
11 store i32 0, i32* @_ZL6test1g, align 4
12 br label %if.end
13
14 if.end: ; preds = %if.then, %entry
15 ret void
16 }
17
18 ; CHECK: @_Z7test1f2v()
19 ; CHECK: entry:
20 ; CHECK-NEXT: ret i32 42
21 define i32 @_Z7test1f2v() nounwind {
22 entry:
23 %tmp = load i32* @_ZL6test1g, align 4
24 ret i32 %tmp
25 }