Home | History | Annotate | Download | only in InstCombine
      1 ; RUN: opt -S -instcombine < %s | FileCheck %s
      2 
      3 ; Checking for a crash
      4 
      5 declare void @use.i1(i1 %val)
      6 declare void @use.i64(i64 %val)
      7 
      8 define i64 @f(i32 %x) {
      9 ; CHECK-LABEL: @f(
     10  entry:
     11   %x.wide = sext i32 %x to i64
     12   %minus.x = sub i32 0, %x
     13   %minus.x.wide = sext i32 %minus.x to i64
     14   %c = icmp slt i32 %x, 0
     15   %val = select i1 %c, i64 %x.wide, i64 %minus.x.wide
     16   call void @use.i1(i1 %c)
     17   call void @use.i64(i64 %x.wide)
     18   ret i64 %val
     19 ; CHECK: ret i64 %val
     20 }
     21