1 ; RUN: llc < %s -mtriple=thumbv6-apple-darwin | FileCheck %s
2 ; RUN: llc < %s -mtriple=thumbv6-apple-darwin -regalloc=basic | FileCheck %s
5 @__bar = external hidden global i8*
6 @__baz = external hidden global i8*
12 %size = alloca i32, align 4
13 %0 = load i8** @__bar, align 4
14 %1 = icmp eq i8* %0, null
15 br i1 %1, label %bb1, label %bb3
19 store i32 1026, i32* %size, align 4
20 %2 = alloca [1026 x i8], align 1
21 ; CHECK: mov [[R0:r[0-9]+]], sp
22 ; CHECK: adds {{r[0-9]+}}, [[R0]], {{r[0-9]+}}
23 %3 = getelementptr inbounds [1026 x i8]* %2, i32 0, i32 0
24 %4 = call i32 @_called_func(i8* %3, i32* %size) nounwind
25 %5 = icmp eq i32 %4, 0
26 br i1 %5, label %bb2, label %bb3
29 %6 = call i8* @strdup(i8* %3) nounwind
30 store i8* %6, i8** @__baz, align 4
34 %.0 = phi i8* [ %0, %entry ], [ %6, %bb2 ], [ %3, %bb1 ]
36 ; CHECK-NEXT: mov sp, r4
37 ; CHECK-NEXT: pop {r4, r5, r6, r7, pc}
41 declare noalias i8* @strdup(i8* nocapture) nounwind
42 declare i32 @_called_func(i8*, i32*) nounwind