63 lines · plain
1; RUN: llc < %s -mtriple=mips -mcpu=mips32 -mips-ssection-threshold=8 -verify-machineinstrs \2; RUN: -relocation-model=static -mattr=+noabicalls -mgpopt \3; RUN: | FileCheck %s --check-prefixes=BASIC,COMMON,ADDR324; RUN: llc < %s -mtriple=mips -mcpu=mips32 -mips-ssection-threshold=8 -verify-machineinstrs \5; RUN: -relocation-model=static -mattr=+noabicalls -mgpopt -membedded-data \6; RUN: | FileCheck %s --check-prefixes=EMBDATA,COMMON,ADDR327 8; RUN: llc < %s -mtriple=mips64 -mcpu=mips4 -mips-ssection-threshold=8 -verify-machineinstrs \9; RUN: -relocation-model=static -mattr=+noabicalls -mgpopt -target-abi n64 \10; RUN: | FileCheck %s --check-prefixes=BASIC,COMMON,N6411; RUN: llc < %s -mtriple=mips64 -mcpu=mips4 -mips-ssection-threshold=8 -verify-machineinstrs \12; RUN: -relocation-model=static -mattr=+noabicalls,+sym32 -mgpopt -target-abi n64 \13; RUN: | FileCheck %s --check-prefixes=BASIC,COMMON,N6414; RUN: llc < %s -mtriple=mips64 -mcpu=mips4 -mips-ssection-threshold=8 -verify-machineinstrs \15; RUN: -relocation-model=static -mattr=+noabicalls -mgpopt -target-abi n32 \16; RUN: | FileCheck %s --check-prefixes=BASIC,COMMON,ADDR3217 18; Test the layout of objects when compiling for static, noabicalls environment.19 20%struct.anon = type { i32, i32 }21 22; Check that when synthesizing a pointer to the second element of foo, that23; we use the correct addition operation. O32 and N32 have 32-bit address24; spaces, so they use addiu. N64 has a 64bit address space, but has a submode25; where symbol sizes are 32 bits. In those cases we use daddiu.26 27; CHECK-LABEL: A1:28; N64: daddiu ${{[0-9]+}}, $gp, %gp_rel(foo)29; ADDR32: addiu ${{[0-9]+}}, $gp, %gp_rel(foo)30 31; BASIC: .type s0,@object32; BASIC-NEXT: .section .sdata,"aw",@progbits33 34; EMDATA: .type s0,@object35; EMDATA-NEXT: .section .rodata,"a",@progbits36 37@s0 = constant [8 x i8] c"AAAAAAA\00", align 438 39; BASIC: .type foo,@object40; BASIC-NOT: .section41 42; EMBDATA: .type foo,@object43; EMBDATA-NEXT: .section .sdata,"aw",@progbits44@foo = global %struct.anon { i32 2, i32 3 }45 46; COMMON: .type bar,@object47; COMMON-NEXT: .section .sbss,"aw",@nobits48@bar = global %struct.anon zeroinitializer49 50define ptr @A0() nounwind {51entry:52 ret ptr @s053}54 55define i32 @A1() nounwind {56entry:57 load i32, ptr @foo, align 8 58 load i32, ptr getelementptr (%struct.anon, ptr @foo, i32 0, i32 1), align 4 59 add i32 %1, %060 ret i32 %261}62 63