1 # RUN: llvm-mc -triple mips64-unknown-unknown -target-abi o32 -filetype=obj -o - %s | \
2 # RUN: llvm-objdump -d -r -arch=mips64 - | \
3 # RUN: FileCheck -check-prefix=ALL -check-prefix=O32 %s
5 # RUN: llvm-mc -triple mips64-unknown-unknown -target-abi o32 %s | \
6 # RUN: FileCheck -check-prefix=ALL -check-prefix=ASM %s
8 # RUN: llvm-mc -triple mips64-unknown-unknown -target-abi n32 -filetype=obj -o - %s | \
9 # RUN: llvm-objdump -d -r -t -arch=mips64 - | \
10 # RUN: FileCheck -check-prefix=ALL -check-prefix=NXX -check-prefix=N32 %s
12 # RUN: llvm-mc -triple mips64-unknown-unknown -target-abi n32 %s | \
13 # RUN: FileCheck -check-prefix=ALL -check-prefix=ASM %s
15 # RUN: llvm-mc -triple mips64-unknown-unknown %s -filetype=obj -o - | \
16 # RUN: llvm-objdump -d -r -t -arch=mips64 - | \
17 # RUN: FileCheck -check-prefix=ALL -check-prefix=NXX -check-prefix=N64 %s
19 # RUN: llvm-mc -triple mips64-unknown-unknown %s | \
20 # RUN: FileCheck -check-prefix=ALL -check-prefix=ASM %s
25 .cpsetup $25, 8, __cerror
34 # FIXME: Direct object emission for N32 is still under development.
35 # N32 doesn't allow 3 operations to be specified in the same relocation
36 # record like N64 does.
38 # NXX-NEXT: sd $gp, 8($sp)
39 # NXX-NEXT: lui $gp, 0
40 # NXX-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
41 # NXX-NEXT: addiu $gp, $gp, 0
42 # NXX-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
43 # N32-NEXT: addu $gp, $gp, $25
44 # N64-NEXT: daddu $gp, $gp, $25
46 # ASM-NEXT: .cpsetup $25, 8, __cerror
51 # NXX-NEXT: ld $gp, 8($sp)
56 .cpsetup $25, $2, __cerror
65 # FIXME: Direct object emission for N32 is still under development.
66 # N32 doesn't allow 3 operations to be specified in the same relocation
67 # record like N64 does.
69 # NXX-NEXT: move $2, $gp
70 # NXX-NEXT: lui $gp, 0
71 # NXX-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
72 # NXX-NEXT: addiu $gp, $gp, 0
73 # NXX-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
74 # N32-NEXT: addu $gp, $gp, $25
75 # N64-NEXT: daddu $gp, $gp, $25
77 # ASM-NEXT: .cpsetup $25, $2, __cerror
82 # NXX-NEXT: move $gp, $2
86 # .cpsetup with local labels (PR22518):
88 # The '1:' label isn't emitted in all cases but we still want a label to match
89 # so we force one here.
102 # O32-NEXT: sub $3, $3, $2
104 # FIXME: Direct object emission for N32 is still under development.
105 # N32 doesn't allow 3 operations to be specified in the same relocation
106 # record like N64 does.
109 # NXX-NEXT: move $2, $gp
110 # NXX-NEXT: lui $gp, 0
111 # NXX-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 $tmp0
112 # NXX-NEXT: addiu $gp, $gp, 0
113 # NXX-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 $tmp0
114 # N32-NEXT: addu $gp, $gp, $25
115 # N64-NEXT: daddu $gp, $gp, $25
117 # NXX-NEXT: sub $3, $3, $2
120 # ASM-NEXT: .cpsetup $25, $2, $tmp0
122 # Ensure we have at least one instruction between labels so that the labels
123 # we're matching aren't removed.
130 .cpsetup $25, 8, __cerror
135 # Testing that .cpsetup expands to nothing in this case
136 # by checking that the next instruction after the first
137 # nop is also a 'nop'.
146 # ASM-NEXT: .cpsetup $25, 8, __cerror
148 # ASM-NEXT: .cpreturn
151 # Test that we accept constant expressions.
154 .cpsetup $25, ((8*4) - (3*8)), __cerror
161 # FIXME: Direct object emission for N32 is still under development.
162 # N32 doesn't allow 3 operations to be specified in the same relocation
163 # record like N64 does.
165 # NXX-NEXT: sd $gp, 8($sp)
166 # NXX-NEXT: lui $gp, 0
167 # NXX-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
168 # NXX-NEXT: addiu $gp, $gp, 0
169 # NXX-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
170 # N32-NEXT: addu $gp, $gp, $25
171 # N64-NEXT: daddu $gp, $gp, $25
173 # ASM-NEXT: .cpsetup $25, 8, __cerror
177 # NXX-LABEL: SYMBOL TABLE:
179 # For .cpsetup with local labels, we need to check if $tmp0 is in the symbol
181 # NXX: .text 00000000 $tmp0