| Dan Gohman | 1880092 | 2009-09-11 18:01:28 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -instcombine -S | grep {ret i32 10} |
| Chris Lattner | 184f1be | 2009-04-13 05:44:34 +0000 | [diff] [blame] | 2 | |
| 3 | @g1 = available_externally constant i32 1 | ||||
| 4 | @g2 = linkonce_odr constant i32 2 | ||||
| 5 | @g3 = weak_odr constant i32 3 | ||||
| 6 | @g4 = internal constant i32 4 | ||||
| 7 | |||||
| 8 | define i32 @test() { | ||||
| 9 | %A = load i32* @g1 | ||||
| 10 | %B = load i32* @g2 | ||||
| 11 | %C = load i32* @g3 | ||||
| 12 | %D = load i32* @g4 | ||||
| 13 | |||||
| 14 | %a = add i32 %A, %B | ||||
| 15 | %b = add i32 %a, %C | ||||
| 16 | %c = add i32 %b, %D | ||||
| 17 | ret i32 %c | ||||
| 18 | } | ||||
| 19 | |||||