1 ; RUN: llc -mtriple=i386-apple-macosx < %s | FileCheck %s
4 @JT = global [4 x i32] [i32 sub (i32 ptrtoint (ptr blockaddress(@h, %bb16) to i32), i32 ptrtoint (ptr blockaddress(@h, %bb9) to i32)), i32 sub (i32 ptrtoint (ptr blockaddress(@h, %bb15) to i32), i32 ptrtoint (ptr blockaddress(@h, %bb9) to i32)), i32 sub (i32 ptrtoint (ptr blockaddress(@h, %bb20) to i32), i32 ptrtoint (ptr blockaddress(@h, %bb16) to i32)), i32 sub (i32 ptrtoint (ptr blockaddress(@h, %bb20) to i32), i32 ptrtoint (ptr blockaddress(@h, %bb15) to i32))]
5 @gGlobalLock = external global ptr
6 @.str40 = external global [35 x i8]
9 ; CHECK-NOT: .long Ltmp{{[0-9]+}}-1
10 ; CHECK-NOT: .long 1-Ltmp{{[0-9]+}}
11 ; CHECK: .long Ltmp{{[0-9]+}}-Ltmp{{[0-9]+}}
12 ; CHECK: .long Ltmp{{[0-9]+}}-Ltmp{{[0-9]+}}
13 ; CHECK: .long Ltmp{{[0-9]+}}-Ltmp{{[0-9]+}}
14 ; CHECK: .long Ltmp{{[0-9]+}}-Ltmp{{[0-9]+}}
16 define void @h(ptr %arg) nounwind ssp {
18 %i = alloca ptr, align 8
19 store ptr %arg, ptr %i, align 8
20 %i1 = load ptr, ptr %i, align 8
21 %i3 = getelementptr { i32, i32 }, ptr %i1, i32 0, i32 0
22 %i4 = load i32, ptr %i3, align 4
24 %i6 = icmp slt i32 %i4, 2
25 %i7 = select i1 %i6, i32 %i4, i32 %i5
26 %i8 = icmp eq i32 %i7, 0
30 %i10 = zext i1 %i8 to i32
31 %i11 = getelementptr [4 x i32], ptr @JT, i32 0, i32 %i10
32 %i12 = load i32, ptr %i11, align 4
33 %i13 = add i32 %i12, ptrtoint (ptr blockaddress(@h, %bb9) to i32)
34 %i14 = inttoptr i32 %i13 to ptr
35 indirectbr ptr %i14, [label %bb15, label %bb16]
38 tail call void (ptr, ...) @g(ptr @.str40)
42 %i17 = call i32 @f(i32 -1037694186) #1
43 %i18 = inttoptr i32 %i17 to ptr
44 %i19 = tail call i32 %i18(ptr @gGlobalLock)
47 bb20: ; preds = %bb16, %bb15
53 declare void @g(ptr, ...)