1 ; RUN: llc -march=hexagon < %s | FileCheck %s
2 ; CHECK: .cfi_offset r31, -4
3 ; CHECK: .cfi_offset r30, -8
4 ; CHECK: .cfi_offset r17, -12
5 ; CHECK: .cfi_offset r16, -16
7 @g0 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
8 @g1 = external constant ptr
9 @g2 = private unnamed_addr constant [15 x i8] c"blah blah blah\00", align 1
10 @g3 = external constant ptr
11 @g4 = private unnamed_addr constant [2 x i8] c"{\00"
12 @g5 = private unnamed_addr constant [2 x i8] c"}\00"
13 @g6 = private unnamed_addr constant [27 x i8] c"FAIL:Unexpected exception.\00"
15 ; Function Attrs: nounwind
16 declare i32 @f0(ptr nocapture readonly, ...) #0
18 ; Function Attrs: nounwind
19 define void @f1(i32 %a0) #0 {
21 %v0 = tail call i32 (ptr, ...) @f0(ptr @g0, i32 %a0)
25 define i32 @f2(i32 %a0, ptr nocapture readnone %a1) personality ptr @f5 {
27 %v0 = tail call i32 (ptr, ...) @f0(ptr @g0, i32 %a0) #0
28 %v1 = tail call i32 @f8(ptr @g4) #0
29 %v2 = tail call ptr @f3(i32 4) #0
30 store ptr @g2, ptr %v2, align 4, !tbaa !0
31 invoke void @f4(ptr %v2, ptr @g1, ptr null) #2
32 to label %b9 unwind label %b1
35 %v4 = landingpad { ptr, i32 }
38 %v5 = extractvalue { ptr, i32 } %v4, 0
39 %v6 = extractvalue { ptr, i32 } %v4, 1
40 %v7 = tail call i32 @llvm.eh.typeid.for(ptr @g1) #0
41 %v8 = icmp eq i32 %v6, %v7
42 %v9 = tail call ptr @f6(ptr %v5) #0
43 br i1 %v8, label %b2, label %b3
46 tail call void @f7() #0
50 %v10 = tail call i32 @f8(ptr @g6)
54 b4: ; preds = %b3, %b2
55 %v11 = tail call i32 @f8(ptr @g5) #0
56 %v12 = tail call i32 @f8(ptr @g4) #0
57 %v13 = tail call ptr @f3(i32 4) #0
58 store i32 777, ptr %v13, align 4, !tbaa !4
59 invoke void @f4(ptr %v13, ptr @g3, ptr null) #2
60 to label %b9 unwind label %b5
63 %v15 = landingpad { ptr, i32 }
66 %v16 = extractvalue { ptr, i32 } %v15, 0
67 %v17 = extractvalue { ptr, i32 } %v15, 1
68 %v18 = tail call i32 @llvm.eh.typeid.for(ptr @g3) #0
69 %v19 = icmp eq i32 %v17, %v18
70 %v20 = tail call ptr @f6(ptr %v16) #0
71 br i1 %v19, label %b6, label %b7
74 tail call void @f7() #0
78 %v21 = tail call i32 @f8(ptr @g6)
82 b8: ; preds = %b7, %b6
83 %v22 = tail call i32 @f8(ptr @g5) #0
86 b9: ; preds = %b4, %b0
92 declare void @f4(ptr, ptr, ptr)
96 ; Function Attrs: nounwind readnone
97 declare i32 @llvm.eh.typeid.for(ptr) #1
103 ; Function Attrs: nounwind
104 declare i32 @f8(ptr nocapture readonly) #0
106 attributes #0 = { nounwind }
107 attributes #1 = { nounwind readnone }
108 attributes #2 = { noreturn }
110 !0 = !{!1, !1, i64 0}
111 !1 = !{!"any pointer", !2, i64 0}
112 !2 = !{!"omnipotent char", !3, i64 0}
113 !3 = !{!"Simple C/C++ TBAA"}
114 !4 = !{!5, !5, i64 0}
115 !5 = !{!"int", !2, i64 0}