• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=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,ADDR32
4; RUN: llc < %s -march=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,ADDR32
7
8; RUN: llc < %s -march=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,N64
11; RUN: llc < %s -march=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,N64
14; RUN: llc < %s -march=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,ADDR32
17
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, that
23; we use the correct addition operation. O32 and N32 have 32-bit address
24; spaces, so they use addiu. N64 has a 64bit address space, but has a submode
25; 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,@object
32; BASIC-NEXT: .section .sdata,"aw",@progbits
33
34; EMDATA: .type  s0,@object
35; EMDATA-NEXT: .section .rodata,"a",@progbits
36
37@s0 = constant [8 x i8] c"AAAAAAA\00", align 4
38
39; BASIC: .type  foo,@object
40; BASIC-NOT:  .section
41
42; EMBDATA: .type  foo,@object
43; EMBDATA-NEXT:  .section .sdata,"aw",@progbits
44@foo = global %struct.anon { i32 2, i32 3 }
45
46; COMMON:  .type bar,@object
47; COMMON-NEXT:  .section  .sbss,"aw",@nobits
48@bar = global %struct.anon zeroinitializer
49
50define i8* @A0() nounwind {
51entry:
52	ret i8* getelementptr ([8 x i8], [8 x i8]* @s0, i32 0, i32 0)
53}
54
55define i32 @A1() nounwind {
56entry:
57  load i32, i32* getelementptr (%struct.anon, %struct.anon* @foo, i32 0, i32 0), align 8
58  load i32, i32* getelementptr (%struct.anon, %struct.anon* @foo, i32 0, i32 1), align 4
59  add i32 %1, %0
60  ret i32 %2
61}
62
63