blob: d3ba14658f6e8ba2af5dabcc9c42528d46786c5d [file] [log] [blame]
Eric Christopher990dd3d2011-08-15 20:50:36 +00001; RUN: opt < %s -S -ipsccp | FileCheck %s
2
3@_ZL6test1g = internal global i32 42, align 4
4
5define void @_Z7test1f1v() nounwind {
6entry:
David Blaikiea79ac142015-02-27 21:17:42 +00007 %tmp = load i32, i32* @_ZL6test1g, align 4
Eric Christopher990dd3d2011-08-15 20:50:36 +00008 %cmp = icmp eq i32 %tmp, 0
9 br i1 %cmp, label %if.then, label %if.end
10
11if.then: ; preds = %entry
12 store i32 0, i32* @_ZL6test1g, align 4
13 br label %if.end
14
15if.end: ; preds = %if.then, %entry
16 ret void
17}
18
19; CHECK: @_Z7test1f2v()
20; CHECK: entry:
21; CHECK-NEXT: ret i32 42
22define i32 @_Z7test1f2v() nounwind {
23entry:
David Blaikiea79ac142015-02-27 21:17:42 +000024 %tmp = load i32, i32* @_ZL6test1g, align 4
Eric Christopher990dd3d2011-08-15 20:50:36 +000025 ret i32 %tmp
26}