1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch64 < %s | FileCheck %s
4 @a= external dso_local global i32, code_model "small", align 4
6 define dso_local signext i32 @local_small() #0 {
7 ; CHECK-LABEL: local_small:
9 ; CHECK-NEXT: pcalau12i $a0, %pc_hi20(a)
10 ; CHECK-NEXT: addi.d $a0, $a0, %pc_lo12(a)
11 ; CHECK-NEXT: ld.w $a0, $a0, 0
13 %1 = load i32, ptr @a, align 4
17 @b= external dso_local global i32, code_model "large", align 4
19 define dso_local signext i32 @local_large() #0 {
20 ; CHECK-LABEL: local_large:
22 ; CHECK-NEXT: pcalau12i $a0, %pc_hi20(b)
23 ; CHECK-NEXT: addi.d $t8, $zero, %pc_lo12(b)
24 ; CHECK-NEXT: lu32i.d $t8, %pc64_lo20(b)
25 ; CHECK-NEXT: lu52i.d $t8, $t8, %pc64_hi12(b)
26 ; CHECK-NEXT: add.d $a0, $t8, $a0
27 ; CHECK-NEXT: ld.w $a0, $a0, 0
29 %1 = load i32, ptr @b, align 4
33 @c= external global i32, code_model "large", align 4
35 define dso_local signext i32 @non_local_large() #0 {
36 ; CHECK-LABEL: non_local_large:
38 ; CHECK-NEXT: pcalau12i $a0, %got_pc_hi20(c)
39 ; CHECK-NEXT: ld.d $a0, $a0, %got_pc_lo12(c)
40 ; CHECK-NEXT: ld.w $a0, $a0, 0
42 %1 = load i32, ptr @c, align 4