1 ; RUN: llc < %s -mtriple=thumbv8 -arm-atomic-cfg-tidy=0 -arm-restrict-it | FileCheck %s
2 ; RUN: llc < %s -mtriple=thumbv7 -arm-atomic-cfg-tidy=0 -arm-restrict-it | FileCheck %s
3 ; RUN: llc < %s -mtriple=thumbv8 -arm-atomic-cfg-tidy=0 -arm-restrict-it -relocation-model=pic | FileCheck %s --check-prefix=CHECK-PIC
4 ; RUN: llc < %s -mtriple=thumbv7 -arm-atomic-cfg-tidy=0 -arm-restrict-it -relocation-model=pic | FileCheck %s --check-prefix=CHECK-PIC
6 %struct.FF = type { ptr, ptr, ptr, ptr, ptr, ptr }
7 %struct.BD = type { ptr, i32, i32, i32, i32, i64, ptr, ptr, ptr, ptr, ptr, [16 x i8], i64, i64 }
9 @FuncPtr = external hidden unnamed_addr global ptr
10 @.str1 = external hidden unnamed_addr constant [6 x i8], align 4
11 @G = external unnamed_addr global i32
12 @.str2 = external hidden unnamed_addr constant [58 x i8], align 4
13 @.str3 = external hidden unnamed_addr constant [58 x i8], align 4
15 define i32 @test() nounwind optsize ssp {
20 %block_size = alloca i32, align 4
21 %block_count = alloca i32, align 4
22 %index_cache = alloca i32, align 4
23 store i32 0, ptr %index_cache, align 4
24 %tmp = load i32, ptr @G, align 4
25 %tmp1 = call i32 @bar(i32 0, i32 0, i32 %tmp) nounwind
26 switch i32 %tmp1, label %bb8 [
28 i32 536870913, label %bb4
29 i32 536870914, label %bb6
33 %tmp2 = load i32, ptr @G, align 4
34 %tmp4 = icmp eq i32 %tmp2, 1
35 br i1 %tmp4, label %bb1, label %bb8
44 %tmp5 = load i32, ptr %block_size, align 4
45 %tmp6 = load i32, ptr %block_count, align 4
46 %tmp7 = call ptr @Get() nounwind
47 store ptr %tmp7, ptr @FuncPtr, align 4
48 %tmp10 = zext i32 %tmp6 to i64
49 %tmp11 = zext i32 %tmp5 to i64
50 %tmp12 = mul nsw i64 %tmp10, %tmp11
51 %tmp13 = call i32 @foo(ptr @.str1, i64 %tmp12, i32 %tmp5) nounwind
59 ; CHECK-PIC-NEXT: ldreq
60 ; CHECK-PIC-NEXT: it eq
61 ; CHECK-PIC-NEXT: cmpeq
74 declare i32 @printf(ptr, ...)
78 declare i32 @foo(ptr, i64, i32)
80 declare i32 @bar(i32, i32, i32)