1# RUN: llvm-mc -triple mips-unknown-linux < %s -show-encoding -target-abi=o32 \
2# RUN:     | FileCheck -check-prefix=ASM %s
3# RUN: llvm-mc -triple mips64-unknown-linux < %s -show-encoding -target-abi=n32 \
4# RUN:     | FileCheck -check-prefix=ASM %s
5# RUN: llvm-mc -triple mips64-unknown-linux < %s -show-encoding -target-abi=n64 \
6# RUN:     | FileCheck -check-prefix=ASM %s
7# RUN: llvm-mc -triple mips-unknown-linux < %s -show-encoding -target-abi=o32 \
8# RUN:     -filetype=obj | llvm-readobj -sections -section-data -r | \
9# RUN:     FileCheck -check-prefix=OBJ-O32 %s
10# RUN: llvm-mc -triple mips64-unknown-linux < %s -show-encoding -target-abi=n32 \
11# RUN:     -filetype=obj | llvm-readobj -sections -section-data -r | \
12# RUN:     FileCheck -check-prefix=OBJ-N32 %s
13# RUN: llvm-mc -triple mips64-unknown-linux < %s -show-encoding -target-abi=n64 \
14# RUN:     -filetype=obj | llvm-readobj -sections -section-data -r | \
15# RUN:     FileCheck -check-prefix=OBJ-N64 %s
16	.text
17foo:
18	.reloc 4, R_MIPS_NONE, foo   # ASM: .reloc 4, R_MIPS_NONE, foo
19	.reloc 0, R_MIPS_NONE, foo+4 # ASM: .reloc 0, R_MIPS_NONE, foo+4
20	.reloc 8, R_MIPS_32, foo+8   # ASM: .reloc 8, R_MIPS_32, foo+8
21	nop
22	nop
23	nop
24	.reloc 12, R_MIPS_NONE       # ASM: .reloc 12, R_MIPS_NONE{{$}}
25        nop
26
27# OBJ-O32-LABEL: Name: .text
28# OBJ-O32:       0000: 00000000 00000000 00000008
29# OBJ-O32-LABEL: }
30# OBJ-O32-LABEL: Relocations [
31# OBJ-O32:       0x0 R_MIPS_NONE .text 0x0
32# OBJ-O32:       0x4 R_MIPS_NONE .text 0x0
33# OBJ-O32:       0x8 R_MIPS_32 .text 0x0
34# OBJ-O32:       0xC R_MIPS_NONE -   0x0
35
36# FIXME: We can't get N32 correct at the moment. If we use a mips-* triple then
37#        we incorrectly drop the addend. If we use a mips64-* triple then we
38#        incorrectly use the 3-reloc encoding (and ELF64). mips64-* triples
39#        are closest to being correct so we use them for now.
40#        This should be corrected once the triple bugfixes allow us to be ABI
41#        dependent rather than triple dependent.
42# OBJ-N32-LABEL: Name: .text
43# OBJ-N32:       0000: 00000000 00000000 00000000
44# OBJ-N32-LABEL: }
45# OBJ-N32-LABEL: Relocations [
46# OBJ-N32:       0x0 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x4
47# OBJ-N32:       0x4 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x0
48# OBJ-N32:       0x8 R_MIPS_32/R_MIPS_NONE/R_MIPS_NONE .text 0x8
49# OBJ-N32:       0xC R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE -   0x0
50
51# OBJ-N64-LABEL: Name: .text
52# OBJ-N64:       0000: 00000000 00000000 00000000
53# OBJ-N64-LABEL: }
54# OBJ-N64-LABEL: Relocations [
55# OBJ-N64:       0x0 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x4
56# OBJ-N64:       0x4 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x0
57# OBJ-N64:       0x8 R_MIPS_32/R_MIPS_NONE/R_MIPS_NONE .text 0x8
58# OBJ-N64:       0xC R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE -   0x0
59