1 ; RUN: llc -mtriple=hexagon-unknown-elf -relocation-model=pic < %s | FileCheck %s
3 ; CHECK: r{{[0-9]+}} = add({{pc|PC}},##.LJTI{{[0-9_]+}}@PCREL)
4 ; CHECK: r{{[0-9]+}} = memw(r{{[0-9]}}+##g0@GOT
5 ; CHECK: r{{[0-9]+}} = add({{pc|PC}},##_GLOBAL_OFFSET_TABLE_@PCREL)
6 ; CHECK: r{{[0-9]+}} = memw(r{{[0-9]*}}+##g1@GOT)
8 @g0 = external global i32
9 @g1 = external global i32
11 ; Function Attrs: nounwind
12 define i32 @f0(i32 %a0) #0 {
14 switch i32 %a0, label %b8 [
25 tail call void @f1() #0
29 %v0 = load i32, ptr @g0, align 4, !tbaa !0
30 %v1 = add nsw i32 %v0, 99
34 %v2 = load i32, ptr @g1, align 4, !tbaa !0
35 %v3 = load i32, ptr @g0, align 4, !tbaa !0
36 %v4 = add nsw i32 %v3, %v2
37 tail call void @f2(i32 %v4) #0
41 %v5 = load i32, ptr @g1, align 4, !tbaa !0
42 %v6 = load i32, ptr @g0, align 4, !tbaa !0
43 %v7 = mul nsw i32 %v6, 2
45 %v9 = add i32 %v8, %v7
46 tail call void @f2(i32 %v9) #0
55 b7: ; preds = %b6, %b0
56 %v10 = phi i32 [ 2, %b0 ], [ 4, %b6 ]
59 b8: ; preds = %b7, %b5, %b4, %b3, %b1, %b0
60 %v11 = phi i32 [ %a0, %b0 ], [ %v10, %b7 ], [ 7, %b5 ], [ 5, %b4 ], [ 4, %b3 ], [ 2, %b1 ]
61 %v12 = add nsw i32 %v11, 522
64 b9: ; preds = %b8, %b2
65 %v13 = phi i32 [ %v12, %b8 ], [ %v1, %b2 ]
73 attributes #0 = { nounwind }
77 !2 = !{!"omnipotent char", !3}
78 !3 = !{!"Simple C/C++ TBAA"}