Matthias Braun | d0d5cbe | 2015-04-13 18:47:19 +0000 | [diff] [blame] | 1 | ; RUN: llc -o - %s | FileCheck %s |
Matthias Braun | a283cb3 | 2015-04-13 17:16:33 +0000 | [diff] [blame] | 2 | ; The selection DAG select(select()) normalisation crashed for different types |
| 3 | ; on the condition inputs. |
| 4 | target datalayout = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64" |
| 5 | target triple = "mips--" |
| 6 | |
Matthias Braun | d0d5cbe | 2015-04-13 18:47:19 +0000 | [diff] [blame] | 7 | ; CHECK-LABEL: foobar |
| 8 | ; CHECK: sltiu ${{[0-9]*}}, ${{[0-9]*}}, 42 |
| 9 | ; CHECK: sltiu ${{[0-9]*}}, ${{[0-9]*}}, 23 |
| 10 | ; CHECK: and ${{[0-9]*}}, ${{[0-9]*}}, ${{[0-9]*}} |
| 11 | ; CHECK: sltu ${{[0-9]*}}, ${{[0-9]*}}, ${{[0-9]*}} |
| 12 | ; CHECK: addiu ${{[0-9]*}}, ${{[0-9]*}}, -1 |
| 13 | ; CHECK: movn ${{[0-9]*}}, ${{[0-9]*}}, ${{[0-9]*}} |
| 14 | ; CHECK: jr $ra |
| 15 | ; CHECK: move ${{[0-9]*}}, ${{[0-9]*}} |
| 16 | define i64 @foobar(i32 %arg) #0 { |
Matthias Braun | a283cb3 | 2015-04-13 17:16:33 +0000 | [diff] [blame] | 17 | entry: |
Matthias Braun | d0d5cbe | 2015-04-13 18:47:19 +0000 | [diff] [blame] | 18 | %cmp0 = icmp ult i32 %arg, 23 |
| 19 | %cmp1 = icmp ult i32 %arg, 42 |
| 20 | %and = and i1 %cmp0, %cmp1 |
| 21 | %cmp2 = icmp ugt i32 %arg, 0 |
| 22 | %sext = sext i1 %cmp1 to i64 |
| 23 | %retval.0 = select i1 %and, i64 %sext, i64 0 |
Matthias Braun | a283cb3 | 2015-04-13 17:16:33 +0000 | [diff] [blame] | 24 | ret i64 %retval.0 |
| 25 | } |