1 # RUN: llvm-mc %s -triple mips-unknown-linux-gnu -show-encoding |\
2 # RUN: FileCheck %s -check-prefix=NORMAL
4 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnuabin32 -show-encoding |\
5 # RUN: FileCheck %s -check-prefix=NORMAL
7 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnu -show-encoding |\
8 # RUN: FileCheck %s -check-prefix=NORMAL
10 # RUN: llvm-mc %s -triple mips-unknown-linux-gnu -mattr=micromips -show-encoding |\
11 # RUN: FileCheck %s -check-prefix=MICRO
13 # Repeat the tests using ELF output.
15 # RUN: llvm-mc %s -triple mips-unknown-linux-gnu -filetype=obj | \
16 # RUN: llvm-objdump -d -r - | FileCheck %s -check-prefixes=ELF-O32
17 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnuabin32 -filetype=obj | \
18 # RUN: llvm-objdump -d -r - | FileCheck %s -check-prefixes=ELF-NXX,ELF-N32
19 # RUN: llvm-mc %s -triple mips64-unknown-linux-gnu -filetype=obj | \
20 # RUN: llvm-objdump -d -r - | FileCheck %s -check-prefixes=ELF-NXX,ELF-N64
35 # NORMAL: b local_label # encoding: [0x10,0x00,A,A]
36 # NORMAL: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
38 # MICRO: b local_label # encoding: [0x94,0x00,A,A]
39 # MICRO: # fixup A - offset: 0, value: local_label, kind: fixup_MICROMIPS_PC16_S1
41 # ELF-O32: 10 00 ff ff b 0
43 # ELF-NXX: 10 00 ff ff b 0
48 # NORMAL: b weak_label # encoding: [0x10,0x00,A,A]
49 # NORMAL: # fixup A - offset: 0, value: weak_label-4, kind: fixup_Mips_PC16
51 # MICRO: b weak_label # encoding: [0x94,0x00,A,A]
52 # MICRO: # fixup A - offset: 0, value: weak_label, kind: fixup_MICROMIPS_PC16_S1
54 # ELF-O32: 10 00 ff ff b 0
55 # ELF-O32-NEXT: R_MIPS_PC16 weak_label
57 # ELF-NXX: 10 00 00 00 b 4
58 # ELF-N32-NEXT: R_MIPS_PC16 weak_label
59 # ELF-N64-NEXT: R_MIPS_PC16/R_MIPS_NONE/R_MIPS_NONE weak_label
64 # NORMAL: b global_label # encoding: [0x10,0x00,A,A]
65 # NORMAL: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
67 # MICRO: b global_label # encoding: [0x94,0x00,A,A]
68 # MICRO: # fixup A - offset: 0, value: global_label, kind: fixup_MICROMIPS_PC16_S1
70 # ELF-O32: 10 00 ff ff b 0
71 # ELF-O32-NEXT: 00000010: R_MIPS_PC16 global_label
73 # ELF-NXX: 10 00 00 00 b 4
74 # ELF-N32-NEXT: R_MIPS_PC16 global_label
75 # ELF-N64-NEXT: R_MIPS_PC16/R_MIPS_NONE/R_MIPS_NONE global_label
80 # NORMAL: b .text # encoding: [0x10,0x00,A,A]
81 # NORMAL: # fixup A - offset: 0, value: .text-4, kind: fixup_Mips_PC16
83 # MICRO: b .text # encoding: [0x94,0x00,A,A]
84 # MICRO: # fixup A - offset: 0, value: .text, kind: fixup_MICROMIPS_PC16_S1
86 # ELF-O32: 10 00 ff f9 b -24 <local_label>
87 # ELF-O32-NEXT: 00 00 00 00 nop
89 # ELF-NXX: 10 00 ff f9 b -24 <local_label>
90 # ELF-NXX-NEXT: 00 00 00 00 nop
95 # NORMAL: b {{.*}}tmp0{{.*}} # encoding: [0x10,0x00,A,A]
96 # NORMAL: # fixup A - offset: 0, value: {{.*}}tmp0{{.*}}-4, kind: fixup_Mips_PC16
98 # MICRO: b {{.*}}tmp0{{.*}} # encoding: [0x94,0x00,A,A]
99 # MICRO: # fixup A - offset: 0, value: {{.*}}tmp0{{.*}}, kind: fixup_MICROMIPS_PC16_S1
101 # ELF-O32: 10 00 00 04 b 20 <local_label+0x34>
103 # ELF-NXX: 10 00 00 04 b 20 <local_label+0x34>
109 # NORMAL: b forward_local # encoding: [0x10,0x00,A,A]
110 # NORMAL: # fixup A - offset: 0, value: forward_local-4, kind: fixup_Mips_PC16
112 # MICRO: b forward_local # encoding: [0x94,0x00,A,A]
113 # MICRO: # fixup A - offset: 0, value: forward_local, kind: fixup_MICROMIPS_PC16_S1
115 # ELF-O32: 10 00 00 04 b 20 <forward_local>
117 # ELF-NXX: 10 00 00 04 b 20 <forward_local>
121 # NORMAL: b 4 # encoding: [0x10,0x00,0x00,0x01]
123 # MICRO: b 4 # encoding: [0x94,0x00,0x00,0x02]
125 # ELF-O32: 10 00 00 01 b 8
127 # ELF-NXX: 10 00 00 01 b 8