54 lines · plain
1; RUN: llc < %s -mtriple=mips -mcpu=mips32 -mips-ssection-threshold=8 \2; RUN: -relocation-model=static -mattr=+noabicalls -mgpopt \3; RUN: | FileCheck %s4 5; Test that object with an explicit section that is not .sdata or .sbss are not6; considered in the small data section if they would otherwise qualify to be in7; small data section. Also test that explicitly placing something in the small8; data section uses %gp_rel addressing mode.9 10@a = constant [2 x i32] zeroinitializer, section ".rodata", align 411@b = global [4 x i32] zeroinitializer, section ".sdata", align 412@c = global [4 x i32] zeroinitializer, section ".sbss", align 413 14; CHECK-LABEL: g15; CHECK: lui $[[R:[0-9]+]], %hi(a)16; CHECK: lw ${{[0-9]+}}, %lo(a)($[[R]])17 18define i32 @g() {19entry:20 %0 = load i32, ptr @a, align 421 ret i32 %022}23 24; CHECK-LABEL: f:25; CHECK-LABEL: lw ${{[0-9]+}}, %gp_rel(b)($gp)26 27define i32 @f() {28entry:29 %0 = load i32, ptr @b, align 430 ret i32 %031}32 33; CHECK-LABEL: h:34; CHECK-LABEL: lw ${{[0-9]+}}, %gp_rel(c)($gp)35 36define i32 @h() {37entry:38 %0 = load i32, ptr @c, align 439 ret i32 %040}41 42 43; CHECK: .type a,@object44; CHECK: .section .rodata,"a",@progbits45; CHECK: .globl a46 47; CHECK: .type b,@object48; CHECK: .section .sdata,"aw",@progbits49; CHECK: .globl b50 51; CHECK: .type c,@object52; CHECK: .section .sbss,"aw",@nobits53; CHECK: .globl c54