1 # RUN: llvm-mc %s -arch=mips -mcpu=mips32 -relocation-model=pic -show-encoding | \
4 # RUN: llvm-mc %s -arch=mips -mcpu=mips32 -relocation-model=pic -filetype=obj -o -| \
5 # RUN: llvm-objdump -d -r -arch=mips - | \
6 # RUN: FileCheck %s -check-prefix=CHECK-FOR-STORE
8 # RUN: llvm-mc %s -arch=mips -mcpu=mips32 -mattr=+micromips -relocation-model=pic -show-encoding | \
9 # RUN: FileCheck %s -check-prefix=MICROMIPS
11 # RUN: llvm-mc %s -arch=mips -mcpu=mips32 -relocation-model=static -show-encoding | \
12 # RUN: FileCheck %s -check-prefix=NO-PIC
14 # RUN: llvm-mc %s -arch=mips -mcpu=mips64 -target-abi n32 -relocation-model=pic -show-encoding | \
15 # RUN: FileCheck %s -check-prefix=BAD-ABI -check-prefix=BAD-ABI-N32
17 # RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n64 -relocation-model=pic -show-encoding | \
18 # RUN: FileCheck %s -check-prefix=BAD-ABI -check-prefix=BAD-ABI-N64
36 # CHECK-FOR-STORE: sw $gp, 8($sp)
39 # CHECK: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
40 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
41 # CHECK: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
43 # CHECK: jalr $4, $25 # encoding: [0x03,0x20,0x20,0x09]
44 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
45 # CHECK: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
47 # CHECK: lw $25, %got(foo)($gp) # encoding: [0x8f,0x99,A,A]
48 # CHECK: # fixup A - offset: 0, value: foo@GOT, kind: fixup_Mips_GOT_Local
49 # CHECK: addiu $25, $25, %lo(foo) # encoding: [0x27,0x39,A,A]
50 # CHECK: # fixup A - offset: 0, value: foo@ABS_LO, kind: fixup_Mips_LO16
51 # CHECK: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
52 # CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
53 # CHECK: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
56 # MICROMIPS: .cprestore 8
57 # MICROMIPS: jalrs16 $25 # encoding: [0x45,0xf9]
58 # MICROMIPS: nop # encoding: [0x0c,0x00]
59 # MICROMIPS: lw $gp, 8($sp) # encoding: [0xff,0x9d,0x00,0x08]
61 # MICROMIPS: jalrs $4, $25 # encoding: [0x00,0x99,0x4f,0x3c]
62 # MICROMIPS: nop # encoding: [0x0c,0x00]
63 # MICROMIPS: lw $gp, 8($sp) # encoding: [0xff,0x9d,0x00,0x08]
65 # MICROMIPS: lw $25, %got(foo)($gp) # encoding: [0xff,0x3c,A,A]
66 # MICROMIPS: # fixup A - offset: 0, value: foo@GOT, kind: fixup_MICROMIPS_GOT16
67 # MICROMIPS: addiu $25, $25, %lo(foo) # encoding: [0x33,0x39,A,A]
68 # MICROMIPS: # fixup A - offset: 0, value: foo@ABS_LO, kind: fixup_MICROMIPS_LO16
69 # MICROMIPS: jalrs $ra, $25 # encoding: [0x03,0xf9,0x4f,0x3c]
70 # MICROMIPS: nop # encoding: [0x0c,0x00]
71 # MICROMIPS: lw $gp, 8($sp) # encoding: [0xff,0x9d,0x00,0x08]
74 # NO-PIC: .cprestore 8
75 # NO-PIC: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
76 # NO-PIC-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
78 # NO-PIC: jalr $4, $25 # encoding: [0x03,0x20,0x20,0x09]
79 # NO-PIC-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
81 # NO-PIC: jal foo # encoding: [0b000011AA,A,A,A]
82 # NO-PIC: # fixup A - offset: 0, value: foo, kind: fixup_Mips_26
83 # NO-PIC-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
86 # BAD-ABI: .cprestore 8
87 # BAD-ABI: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
88 # BAD-ABI-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
90 # BAD-ABI: jalr $4, $25 # encoding: [0x03,0x20,0x20,0x09]
91 # BAD-ABI-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
93 # BAD-ABI-N32: lw $25, %got_disp(foo)($gp) # encoding: [0x8f,0x99,A,A]
94 # BAD-ABI-N64: ld $25, %got_disp(foo)($gp) # encoding: [0xdf,0x99,A,A]
95 # BAD-ABI: # fixup A - offset: 0, value: foo@GOT_DISP, kind: fixup_Mips_GOT_DISP
96 # BAD-ABI: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
97 # BAD-ABI-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]