| Davide Italiano | f54f2f0 | 2016-05-05 21:05:36 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -S -passes=ipsccp | FileCheck %s |
| Eric Christopher | 990dd3d | 2011-08-15 20:50:36 +0000 | [diff] [blame] | 2 | ; RUN: opt < %s -S -ipsccp | FileCheck %s |
| 3 | |
| 4 | @_ZL6test1g = internal global i32 42, align 4 |
| 5 | |
| 6 | define void @_Z7test1f1v() nounwind { |
| 7 | entry: |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 8 | %tmp = load i32, i32* @_ZL6test1g, align 4 |
| Eric Christopher | 990dd3d | 2011-08-15 20:50:36 +0000 | [diff] [blame] | 9 | %cmp = icmp eq i32 %tmp, 0 |
| 10 | br i1 %cmp, label %if.then, label %if.end |
| 11 | |
| 12 | if.then: ; preds = %entry |
| 13 | store i32 0, i32* @_ZL6test1g, align 4 |
| 14 | br label %if.end |
| 15 | |
| 16 | if.end: ; preds = %if.then, %entry |
| 17 | ret void |
| 18 | } |
| 19 | |
| 20 | ; CHECK: @_Z7test1f2v() |
| 21 | ; CHECK: entry: |
| 22 | ; CHECK-NEXT: ret i32 42 |
| 23 | define i32 @_Z7test1f2v() nounwind { |
| 24 | entry: |
| David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 25 | %tmp = load i32, i32* @_ZL6test1g, align 4 |
| Eric Christopher | 990dd3d | 2011-08-15 20:50:36 +0000 | [diff] [blame] | 26 | ret i32 %tmp |
| 27 | } |