Home | History | Annotate | Download | only in Thumb2
      1 ; rdar://8465407
      2 ; RUN: llc < %s -mtriple=thumbv7-apple-ios -arm-atomic-cfg-tidy=0 | FileCheck %s
      3 
      4 %struct.buf = type opaque
      5 
      6 declare void @bar() nounwind optsize
      7 
      8 define void @foo() nounwind optsize {
      9 ; CHECK-LABEL: foo:
     10 ; CHECK: push
     11 ; CHECK: mov r7, sp
     12 ; CHECK: sub sp, #4
     13 entry:
     14   %m.i = alloca %struct.buf*, align 4
     15   br label %bb
     16 
     17 bb:
     18   br i1 undef, label %bb3, label %bb2
     19 
     20 bb2:
     21   call void @bar() nounwind optsize
     22   br i1 undef, label %bb, label %bb3
     23 
     24 bb3:
     25   br i1 undef, label %return, label %bb
     26 
     27 return:
     28 ; CHECK: %return
     29 ; 'mov sp, r7' would have left sp in an invalid state
     30 ; CHECK-NOT: mov sp, r7
     31 ; CHECK-NOT: sub, sp, #4
     32 ; CHECK: add sp, #4
     33   ret void
     34 }
     35