Juergen Ributzka | fa0eba6 | 2014-02-06 04:09:06 +0000 | [diff] [blame] | 1 | ; Test that opaque constants are not creating an infinite DAGCombine loop |
| 2 | ; RUN: llc < %s |
| 3 | ; XFAIL: r600, xcore |
| 4 | |
| 5 | @a = common global i32* null, align 8 |
| 6 | @c = common global i32 0, align 4 |
| 7 | @b = common global i32* null, align 8 |
| 8 | |
| 9 | ; Function Attrs: nounwind ssp uwtable |
| 10 | define void @fn() { |
| 11 | store i32* inttoptr (i64 68719476735 to i32*), i32** @a, align 8 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame^] | 12 | %1 = load i32, i32* @c, align 4 |
Juergen Ributzka | fa0eba6 | 2014-02-06 04:09:06 +0000 | [diff] [blame] | 13 | %2 = sext i32 %1 to i64 |
| 14 | %3 = lshr i64 %2, 12 |
| 15 | %4 = and i64 %3, 68719476735 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 16 | %5 = getelementptr inbounds i32, i32* null, i64 %4 |
Juergen Ributzka | fa0eba6 | 2014-02-06 04:09:06 +0000 | [diff] [blame] | 17 | store i32* %5, i32** @b, align 8 |
| 18 | ret void |
| 19 | } |