[obj2yaml] - Fix a comment. NFC.
[llvm-complete.git] / test / MC / Mips / reloc-directive-label-offset.s
blob05ee4dee0f36aa1d0919b3919d9783dfab5e42b4
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
14 .text
15 foo: # ASM-LABEL: foo:
16 nop
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
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
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
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
37 bar:
38 nop
40 nop
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
48 nop
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
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
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