1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 target triple = "hexagon"
5 @g0 = external global i32
6 @g1 = external global i32, align 4
7 @g2 = external hidden unnamed_addr constant [49 x i8], align 8
8 @g3 = external hidden unnamed_addr constant [76 x i8], align 8
9 @g4 = external unnamed_addr constant { i8*, i8* }
10 @g5 = external hidden unnamed_addr constant [36 x i8], align 8
20 ; Function Attrs: nounwind
21 declare void ()* @f4(void ()*) #0
23 ; Function Attrs: nounwind
24 declare void ()* @f5(void ()*) #0
28 ; CHECK-DAG: r0 = ##f3
30 ; CHECK-DAG: r0 = ##f0
32 ; CHECK-DAG: r0 = ##g2
35 ; CHECK-DAG: r0 = ##g3
38 ; CHECK-DAG: r{{[0-9]+}} = ##g1
39 define i32 @f6() personality i8* bitcast (i32 (...)* @f11 to i8*) {
42 %v0 = tail call void ()* @f4(void ()* @f3) #0
43 %v1 = tail call void ()* @f5(void ()* @f0) #0
44 tail call void (i8*, ...) @f8(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @g2, i32 0, i32 0))
46 tail call void (i8*, ...) @f8(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @g3, i32 0, i32 0))
47 %v2 = tail call i8* @f10(i32 4) #0
48 %v3 = load i32, i32* @g1, align 4, !tbaa !0
49 %v4 = add nsw i32 %v3, 1
50 store i32 %v4, i32* @g1, align 4, !tbaa !0
51 invoke void @f12(i8* %v2, i8* bitcast ({ i8*, i8* }* @g4 to i8*), i8* null) #1
52 to label %b7 unwind label %b1
55 %v5 = landingpad { i8*, i32 }
57 %v6 = extractvalue { i8*, i32 } %v5, 0
58 %v7 = tail call i8* @f13(i8* %v6) #0
59 store i32 0, i32* @g1, align 4, !tbaa !0
61 to label %b7 unwind label %b2
64 %v8 = landingpad { i8*, i32 }
67 to label %b3 unwind label %b6
70 %v9 = extractvalue { i8*, i32 } %v8, 0
71 %v10 = tail call i8* @f13(i8* %v9) #0
73 %v11 = load i32, i32* @g1, align 4, !tbaa !0
74 %v12 = icmp eq i32 %v11, 0
75 br i1 %v12, label %b5, label %b4
78 tail call void (i8*, ...) @f8(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @g5, i32 0, i32 0))
79 store i32 1, i32* @g0, align 4, !tbaa !0
82 b5: ; preds = %b4, %b3
83 %v13 = tail call i32 @f1()
84 %v14 = tail call i32 @f2(i32 1)
88 %v15 = landingpad { i8*, i32 }
90 tail call void @f16() #2
93 b7: ; preds = %b1, %b0
99 declare void @f8(i8*, ...)
103 declare i8* @f10(i32)
105 declare i32 @f11(...)
107 declare void @f12(i8*, i8*, i8*)
109 declare i8* @f13(i8*)
117 attributes #0 = { nounwind }
118 attributes #1 = { noreturn }
119 attributes #2 = { noreturn nounwind }
121 !0 = !{!1, !1, i64 0}
123 !2 = !{!"omnipotent char", !3}
124 !3 = !{!"Simple C/C++ TBAA"}