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