1# RUN: llvm-mc -triple mips-unknown-linux %s -show-encoding -target-abi=o32 \ 2# RUN: | FileCheck --check-prefixes=ASM,ASM-32 %s 3# RUN: llvm-mc -triple mips64-unknown-linux %s -show-encoding -target-abi=n32 \ 4# RUN: | FileCheck --check-prefixes=ASM,ASM-64 %s 5# RUN: llvm-mc -triple mips64-unknown-linux %s -show-encoding -target-abi=n64 \ 6# RUN: | FileCheck --check-prefixes=ASM,ASM-64 %s 7# RUN: llvm-mc -triple mips-unknown-linux %s -show-encoding -target-abi=o32 \ 8# RUN: -filetype=obj | llvm-readobj -r - | FileCheck -check-prefix=OBJ-O32 %s 9# RUN: llvm-mc -triple mips64-unknown-linux %s -show-encoding -target-abi=n32 \ 10# RUN: -filetype=obj | llvm-readobj -r - | FileCheck -check-prefix=OBJ-N32 %s 11# RUN: llvm-mc -triple mips64-unknown-linux %s -show-encoding -target-abi=n64 \ 12# RUN: -filetype=obj | llvm-readobj -r - | FileCheck -check-prefix=OBJ-N64 %s 13 14 .text 15foo: # ASM-LABEL: foo: 16 nop 171: 18 nop 19 .reloc 1b, R_MIPS_NONE, foo # ASM-32: .reloc ($tmp0), R_MIPS_NONE, foo 20 # ASM-64: .reloc .Ltmp0, R_MIPS_NONE, foo 21 nop 22 .reloc 1f, R_MIPS_32, foo # ASM-32: .reloc ($tmp1), R_MIPS_32, foo 23 # ASM-64: .reloc .Ltmp1, R_MIPS_32, foo 241: 25 nop 26 .reloc 1f, R_MIPS_CALL16, foo # ASM-32: .reloc ($tmp2), R_MIPS_CALL16, foo 27 # ASM-64: .reloc .Ltmp2, R_MIPS_CALL16, foo 281: 29 nop 30 .reloc 2f, R_MIPS_GOT_DISP, foo # ASM-32: .reloc ($tmp3), R_MIPS_GOT_DISP, foo 31 # ASM-64: .reloc .Ltmp3, R_MIPS_GOT_DISP, foo 32 nop 33 34 .reloc 3f, R_MIPS_GOT_PAGE, foo # ASM-32: .reloc ($tmp4), R_MIPS_GOT_PAGE, foo 35 # ASM-64: .reloc .Ltmp4, R_MIPS_GOT_PAGE, foo 36 nop 37bar: 38 nop 392: 40 nop 413: 42 nop 43 .reloc bar, R_MIPS_GOT_OFST, foo # ASM: .reloc bar, R_MIPS_GOT_OFST, foo 44 nop 45 .reloc foo, R_MIPS_32, foo # ASM: .reloc foo, R_MIPS_32, foo 46 nop 471: 48 nop 49 50# OBJ-O32-LABEL: Relocations [ 51# OBJ-O32: 0x0 R_MIPS_32 .text 0x0 52# OBJ-O32-NEXT: 0x4 R_MIPS_NONE .text 0x0 53# OBJ-O32-NEXT: 0xC R_MIPS_32 .text 0x0 54# OBJ-O32-NEXT: 0x10 R_MIPS_CALL16 foo 0x0 55# OBJ-O32-NEXT: 0x1C R_MIPS_GOT_OFST .text 0x0 56# OBJ-O32-NEXT: 0x20 R_MIPS_GOT_DISP foo 0x0 57# OBJ-O32-NEXT: 0x24 R_MIPS_GOT_PAGE .text 0x0 58 59# OBJ-N32-LABEL: Relocations [ 60# OBJ-N32: 0x4 R_MIPS_NONE .text 0x0 61# OBJ-N32-NEXT: 0x1C R_MIPS_GOT_OFST .text 0x0 62# OBJ-N32-NEXT: 0x0 R_MIPS_32 .text 0x0 63# OBJ-N32-NEXT: 0xC R_MIPS_32 .text 0x0 64# OBJ-N32-NEXT: 0x10 R_MIPS_CALL16 foo 0x0 65# OBJ-N32-NEXT: 0x20 R_MIPS_GOT_DISP foo 0x0 66# OBJ-N32-NEXT: 0x24 R_MIPS_GOT_PAGE .text 0x0 67 68# OBJ-N64-LABEL: Relocations [ 69# OBJ-N64: 0x4 R_MIPS_NONE/R_MIPS_NONE/R_MIPS_NONE .text 0x0 70# OBJ-N64-NEXT: 0x1C R_MIPS_GOT_OFST/R_MIPS_NONE/R_MIPS_NONE .text 0x0 71# OBJ-N64-NEXT: 0x0 R_MIPS_32/R_MIPS_NONE/R_MIPS_NONE .text 0x0 72# OBJ-N64-NEXT: 0xC R_MIPS_32/R_MIPS_NONE/R_MIPS_NONE .text 0x0 73# OBJ-N64-NEXT: 0x10 R_MIPS_CALL16/R_MIPS_NONE/R_MIPS_NONE foo 0x0 74# OBJ-N64-NEXT: 0x20 R_MIPS_GOT_DISP/R_MIPS_NONE/R_MIPS_NONE foo 0x0 75# OBJ-N64-NEXT: 0x24 R_MIPS_GOT_PAGE/R_MIPS_NONE/R_MIPS_NONE .text 0x0 76