1; RUN: llc -mtriple=mips-unknown-linux-gnu -relocation-model=static < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=O32-BE %s
2; RUN: llc -mtriple=mipsel-unknown-linux-gnu -relocation-model=static < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=O32-LE %s
3
4; RUN-TODO: llc -mtriple=mips64-unknown-linux-gnu -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=O32-BE %s
5; RUN-TODO: llc -mtriple=mips64el-unknown-linux-gnu -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=O32-LE %s
6
7; RUN: llc -mtriple=mips64-unknown-linux-gnu -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=NEW-BE %s
8; RUN: llc -mtriple=mips64el-unknown-linux-gnu -relocation-model=static -target-abi n32 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM32 --check-prefix=NEW-LE %s
9
10; RUN: llc -mtriple=mips64-unknown-linux-gnu -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM64 --check-prefix=NEW-BE %s
11; RUN: llc -mtriple=mips64el-unknown-linux-gnu -relocation-model=static -target-abi n64 < %s | FileCheck --check-prefix=ALL --check-prefix=SYM64 --check-prefix=NEW-LE %s
12
13; Test small structures for all ABI's and byte orders.
14;
15; N32/N64 are identical in this area so their checks have been combined into
16; the 'NEW' prefix (the N stands for New).
17
18@bytes = global [2 x i8] zeroinitializer
19
20define void @s_i8(i8 inreg %a) nounwind {
21entry:
22	store i8 %a, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @bytes, i32 0, i32 1)
23        ret void
24}
25
26; ALL-LABEL: s_i8:
27
28; SYM32-DAG:   lui   [[PTR_HI:\$[0-9]+]], %hi(bytes)
29; SYM32-DAG:   addiu [[PTR:\$[0-9]+]], [[PTR_HI]], %lo(bytes)
30
31; SYM64-DAG:   ld    [[PTR:\$[0-9]+]], %got_disp(bytes)(
32
33; O32-BE-DAG:  srl [[ARG:\$[0-9]+]], $4, 24
34; O32-BE-DAG:  sb  [[ARG]], 1([[PTR]])
35
36; O32-LE-DAG:  sb  $4, 1([[PTR]])
37
38; NEW-BE-DAG:  dsrl [[ARG:\$[0-9]+]], $4, 56
39; NEW-BE-DAG:  sb   [[ARG]], 1([[PTR]])
40
41; NEW-LE-DAG:  sb   $4, 1([[PTR]])
42