Sanjay Patel | ee770e9 | 2018-03-08 22:05:27 +0000 | [diff] [blame] | 1 | ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
Mehdi Amini | 590a270 | 2015-01-16 03:00:58 +0000 | [diff] [blame] | 2 | ; RUN: opt -reassociate %s -S -o - | FileCheck %s |
| 3 | |
| 4 | ; Reassociate pass used to crash on these example |
| 5 | |
Sanjay Patel | ee770e9 | 2018-03-08 22:05:27 +0000 | [diff] [blame] | 6 | @g = global i32 0 |
Mehdi Amini | 590a270 | 2015-01-16 03:00:58 +0000 | [diff] [blame] | 7 | |
| 8 | define float @undef1() { |
Sanjay Patel | ee770e9 | 2018-03-08 22:05:27 +0000 | [diff] [blame] | 9 | ; CHECK-LABEL: @undef1( |
| 10 | ; CHECK-NEXT: ret float fadd (float bitcast (i32 ptrtoint (i32* @g to i32) to float), float fadd (float bitcast (i32 ptrtoint (i32* @g to i32) to float), float fadd (float fsub (float -0.000000e+00, float bitcast (i32 ptrtoint (i32* @g to i32) to float)), float fsub (float -0.000000e+00, float bitcast (i32 ptrtoint (i32* @g to i32) to float))))) |
| 11 | ; |
| 12 | %t0 = fadd fast float bitcast (i32 ptrtoint (i32* @g to i32) to float), bitcast (i32 ptrtoint (i32* @g to i32) to float) |
| 13 | %t1 = fsub fast float bitcast (i32 ptrtoint (i32* @g to i32) to float), %t0 |
| 14 | %t2 = fadd fast float bitcast (i32 ptrtoint (i32* @g to i32) to float), %t1 |
| 15 | ret float %t2 |
Mehdi Amini | 590a270 | 2015-01-16 03:00:58 +0000 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | define void @undef2() { |
Sanjay Patel | ee770e9 | 2018-03-08 22:05:27 +0000 | [diff] [blame] | 19 | ; CHECK-LABEL: @undef2( |
| 20 | ; CHECK-NEXT: unreachable |
| 21 | ; |
| 22 | %t0 = fadd fast float bitcast (i32 ptrtoint (i32* @g to i32) to float), bitcast (i32 ptrtoint (i32* @g to i32) to float) |
| 23 | %t1 = fadd fast float %t0, 1.0 |
| 24 | %t2 = fsub fast float %t0, %t1 |
| 25 | %t3 = fmul fast float %t2, 2.0 |
Mehdi Amini | 590a270 | 2015-01-16 03:00:58 +0000 | [diff] [blame] | 26 | unreachable |
| 27 | } |
Sanjay Patel | ee770e9 | 2018-03-08 22:05:27 +0000 | [diff] [blame] | 28 | |