1 ; RUN: llc -march=mipsel -relocation-model=pic -O0 -fast-isel-abort=3 -mcpu=mips32r2 \
2 ; RUN: < %s | FileCheck %s
4 @i = global i32 75, align 4
5 @s = global i16 -345, align 2
6 @c = global i8 118, align 1
7 @f = global float 0x40BE623360000000, align 4
8 @d = global double 1.298330e+03, align 8
10 ; Function Attrs: nounwind
14 %0 = load i32, i32* @i, align 4
16 ; CHECK: lui $[[REG_GPa:[0-9]+]], %hi(_gp_disp)
17 ; CHECK: addiu $[[REG_GPb:[0-9]+]], $[[REG_GPa]], %lo(_gp_disp)
18 ; CHECK: addu $[[REG_GP:[0-9]+]], $[[REG_GPb]], $25
19 ; CHECK: lw $[[REG_I_ADDR:[0-9]+]], %got(i)($[[REG_GP]])
20 ; CHECK: lw $2, 0($[[REG_I_ADDR]])
24 ; Function Attrs: nounwind
28 %0 = load i16, i16* @s, align 2
30 ; CHECK: lui $[[REG_GPa:[0-9]+]], %hi(_gp_disp)
31 ; CHECK: addiu $[[REG_GPb:[0-9]+]], $[[REG_GPa]], %lo(_gp_disp)
32 ; CHECK: addu $[[REG_GP:[0-9]+]], $[[REG_GPb]], $25
33 ; CHECK: lw $[[REG_S_ADDR:[0-9]+]], %got(s)($[[REG_GP]])
34 ; CHECK: lhu $2, 0($[[REG_S_ADDR]])
38 ; Function Attrs: nounwind
39 define signext i16 @rets() {
42 %0 = load i16, i16* @s, align 2
44 ; CHECK: lui $[[REG_GPa:[0-9]+]], %hi(_gp_disp)
45 ; CHECK: addiu $[[REG_GPb:[0-9]+]], $[[REG_GPa]], %lo(_gp_disp)
46 ; CHECK: addu $[[REG_GP:[0-9]+]], $[[REG_GPb]], $25
47 ; CHECK: lw $[[REG_S_ADDR:[0-9]+]], %got(s)($[[REG_GP]])
48 ; CHECK: lhu $[[REG_S:[0-9]+]], 0($[[REG_S_ADDR]])
49 ; CHECK: seh $2, $[[REG_S]]
53 ; Function Attrs: nounwind
57 %0 = load i8, i8* @c, align 1
59 ; CHECK: lui $[[REG_GPa:[0-9]+]], %hi(_gp_disp)
60 ; CHECK: addiu $[[REG_GPb:[0-9]+]], $[[REG_GPa]], %lo(_gp_disp)
61 ; CHECK: addu $[[REG_GP:[0-9]+]], $[[REG_GPb]], $25
62 ; CHECK: lw $[[REG_C_ADDR:[0-9]+]], %got(c)($[[REG_GP]])
63 ; CHECK: lbu $2, 0($[[REG_C_ADDR]])
67 ; Function Attrs: nounwind
68 define signext i8 @retc() {
71 %0 = load i8, i8* @c, align 1
73 ; CHECK: lui $[[REG_GPa:[0-9]+]], %hi(_gp_disp)
74 ; CHECK: addiu $[[REG_GPb:[0-9]+]], $[[REG_GPa]], %lo(_gp_disp)
75 ; CHECK: addu $[[REG_GP:[0-9]+]], $[[REG_GPb]], $25
76 ; CHECK: lw $[[REG_C_ADDR:[0-9]+]], %got(c)($[[REG_GP]])
77 ; CHECK: lbu $[[REG_C:[0-9]+]], 0($[[REG_C_ADDR]])
78 ; CHECK: seb $2, $[[REG_C]]
82 ; Function Attrs: nounwind
83 define float @retf() {
86 %0 = load float, float* @f, align 4
88 ; CHECK: lui $[[REG_GPa:[0-9]+]], %hi(_gp_disp)
89 ; CHECK: addiu $[[REG_GPb:[0-9]+]], $[[REG_GPa]], %lo(_gp_disp)
90 ; CHECK: addu $[[REG_GP:[0-9]+]], $[[REG_GPb]], $25
91 ; CHECK: lw $[[REG_F_ADDR:[0-9]+]], %got(f)($[[REG_GP]])
92 ; CHECK: lwc1 $f0, 0($[[REG_F_ADDR]])
96 ; Function Attrs: nounwind
97 define double @retd() {
100 %0 = load double, double* @d, align 8
102 ; CHECK: lui $[[REG_GPa:[0-9]+]], %hi(_gp_disp)
103 ; CHECK: addiu $[[REG_GPb:[0-9]+]], $[[REG_GPa]], %lo(_gp_disp)
104 ; CHECK: addu $[[REG_GP:[0-9]+]], $[[REG_GPb]], $25
105 ; CHECK: lw $[[REG_D_ADDR:[0-9]+]], %got(d)($[[REG_GP]])
106 ; CHECK: ldc1 $f0, 0($[[REG_D_ADDR]])