1 ; RUN: llc -march=hexagon < %s | FileCheck %s 2 3 target triple = "hexagon" 4 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 11 12 declare void @f0() 13 14 declare i32 @f1() 15 16 declare i32 @f2(i32) 17 18 declare void @f3() 19 20 ; Function Attrs: nounwind 21 declare void ()* @f4(void ()*) #0 22 23 ; Function Attrs: nounwind 24 declare void ()* @f5(void ()*) #0 25 26 ; CHECK: f6: 27 ; CHECK-DAG: call f4 28 ; CHECK-DAG: r0 = ##f3 29 ; CHECK-DAG: call f5 30 ; CHECK-DAG: r0 = ##f0 31 ; CHECK-DAG: call f8 32 ; CHECK-DAG: r0 = ##g2 33 ; CHECK-DAG: call f9 34 ; CHECK-DAG: call f8 35 ; CHECK-DAG: r0 = ##g3 36 ; CHECK-DAG: call f10 37 ; CHECK-DAG: r0 = #4 38 ; CHECK-DAG: r{{[0-9]+}} = ##g1 39 define i32 @f6() personality i8* bitcast (i32 (...)* @f11 to i8*) { 40 b0: 41 tail call void @f7() 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)) 45 tail call void @f9() 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 53 54 b1: ; preds = %b0 55 %v5 = landingpad { i8*, i32 } 56 catch i8* null 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 60 invoke void @f14() #1 61 to label %b7 unwind label %b2 62 63 b2: ; preds = %b1 64 %v8 = landingpad { i8*, i32 } 65 catch i8* null 66 invoke void @f15() 67 to label %b3 unwind label %b6 68 69 b3: ; preds = %b2 70 %v9 = extractvalue { i8*, i32 } %v8, 0 71 %v10 = tail call i8* @f13(i8* %v9) #0 72 tail call void @f15() 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 76 77 b4: ; preds = %b3 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 80 br label %b5 81 82 b5: ; preds = %b4, %b3 83 %v13 = tail call i32 @f1() 84 %v14 = tail call i32 @f2(i32 1) 85 ret i32 %v14 86 87 b6: ; preds = %b2 88 %v15 = landingpad { i8*, i32 } 89 catch i8* null 90 tail call void @f16() #2 91 unreachable 92 93 b7: ; preds = %b1, %b0 94 unreachable 95 } 96 97 declare void @f7() 98 99 declare void @f8(i8*, ...) 100 101 declare void @f9() 102 103 declare i8* @f10(i32) 104 105 declare i32 @f11(...) 106 107 declare void @f12(i8*, i8*, i8*) 108 109 declare i8* @f13(i8*) 110 111 declare void @f14() 112 113 declare void @f15() 114 115 declare void @f16() 116 117 attributes #0 = { nounwind } 118 attributes #1 = { noreturn } 119 attributes #2 = { noreturn nounwind } 120 121 !0 = !{!1, !1, i64 0} 122 !1 = !{!"int", !2} 123 !2 = !{!"omnipotent char", !3} 124 !3 = !{!"Simple C/C++ TBAA"} 125