Home | History | Annotate | Download | only in AArch64
      1 ; RUN: llc < %s | FileCheck %s
      2 ; Make sure we don't crash in AArch64RedundantCopyElimination when a
      3 ; MachineBasicBlock is empty.  PR29035.
      4 
      5 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
      6 target triple = "aarch64-unknown-linux-gnu"
      7 
      8 declare i8* @bar()
      9 
     10 ; CHECK-LABEL: foo:
     11 ; CHECK: tbz
     12 ; CHECK: orr
     13 ; CHECK: ret
     14 ; CHECK: bl bar
     15 ; CHECK: cbnz
     16 ; CHECK: ret
     17 define i1 @foo(i1 %start) {
     18 entry:
     19   br i1 %start, label %cleanup, label %if.end
     20 
     21 if.end:                                           ; preds = %if.end, %entry
     22   %call = tail call i8* @bar()
     23   %cmp = icmp eq i8* %call, null
     24   br i1 %cmp, label %cleanup, label %if.end
     25 
     26 cleanup:                                          ; preds = %if.end, %entry
     27   %retval.0 = phi i1 [ true, %entry ], [ false, %if.end ]
     28   ret i1 %retval.0
     29 }
     30