Imported Upstream version 5.18.0.207

Former-commit-id: 3b152f462918d427ce18620a2cbe4f8b79650449
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-11-17 08:23:10 +00:00
parent 8e12397d70
commit eb85e2fc17
28480 changed files with 72 additions and 3866936 deletions

View File

@@ -1,21 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -mcpu=mips32r6 %s -o %t.o
# RUN: llvm-readobj -s -section-data %t.o | FileCheck %s
# CHECK: Name: .text
# CHECK-NEXT: Type:
# CHECK-NEXT: Flags [
# CHECK-NEXT: SHF_ALLOC
# CHECK-NEXT: SHF_EXECINSTR
# CHECK-NEXT: ]
# CHECK-NEXT: Address:
# CHECK-NEXT: Offset:
# CHECK-NEXT: Size:
# CHECK-NEXT: Link:
# CHECK-NEXT: Info:
# CHECK-NEXT: AddressAlignment:
# CHECK-NEXT: EntrySize:
# CHECK-NEXT: SectionData (
# CHECK-NEXT: 0000: 00000008 |
# CHECK-NEXT: )
.word _foo+8-.

View File

@@ -1,8 +0,0 @@
# RUN: not llvm-mc -triple mips-unknown-linux %s 2>&1 | FileCheck %s
.asciiz 12
# CHECK: :[[@LINE-1]]:11: error: expected string in '.asciiz' directive
.asciiz "a"3
# CHECK: :[[@LINE-1]]:14: error: unexpected token in '.asciiz' directive
.asciiz "a",
# CHECK: :[[@LINE-1]]:15: error: expected string in '.asciiz' directive

View File

@@ -1,28 +0,0 @@
# RUN: llvm-mc -triple mips-unknown-linux %s | FileCheck %s
# .asciiz is exactly the same as .asciz, except it's MIPS-specific.
t1:
.asciiz
# CHECK-LABEL: t1
t2:
.asciiz "a"
# CHECK-LABEL: t2
# CHECK: .byte 97
# CHECK: .byte 0
t3:
.asciiz "a", "b", "c"
# CHECK-LABEL: t3
# CHECK: .byte 97
# CHECK: .byte 0
# CHECK: .byte 98
# CHECK: .byte 0
# CHECK: .byte 99
# CHECK: .byte 0
t4:
.asciiz "abcdefghijklmnop"
# CHECK-LABEL: t4
# CHECK: .ascii "abcdefghijklmnop"
# CHECK: .byte 0

View File

@@ -1,16 +0,0 @@
# RUN: llvm-mc -arch=mips -mcpu=mips32 %s 2>&1 | FileCheck %s
# We don't support the bopt option in the integrated assembler. Given it's
# single pass nature, it would be quite difficult to implement currently.
# Ensure we parse the bopt & nobopt directives and warn in the bopt case.
# CHECK: warning: 'bopt' feature is unsupported
# CHECK: nop
.text
f:
.set bopt
g:
.set nobopt
nop

View File

@@ -1,42 +0,0 @@
# RUN: not llvm-mc %s -arch=mips -mcpu=mips32 2>&1 | FileCheck %s
# Check for errors when using conditional branch pseudos after .set noat.
.set noat
local_label:
blt $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bltu $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
ble $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bleu $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bge $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bgeu $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bgt $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bgtu $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
beql $7, 256, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bnel $7, 256, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bltl $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bltul $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
blel $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bleul $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bgel $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bgeul $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bgtl $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
bgtul $7, $8, local_label
# CHECK: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available

View File

@@ -1,369 +0,0 @@
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 -show-encoding | FileCheck %s
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 2>&1 | \
# RUN: FileCheck %s --check-prefix=WARNING
.text
local_label:
blt $7, $8, local_label
# CHECK: slt $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2a]
# CHECK: bnez $1, local_label # encoding: [0x14,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
blt $7, $8, global_label
# CHECK: slt $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2a]
# CHECK: bnez $1, global_label # encoding: [0x14,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop
blt $7, $0, local_label
# CHECK: bltz $7, local_label # encoding: [0x04,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
blt $0, $8, local_label
# CHECK: bgtz $8, local_label # encoding: [0x1d,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
blt $0, $0, local_label
# CHECK: bltz $zero, local_label # encoding: [0x04,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bltu $7, $8, local_label
# CHECK: sltu $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2b]
# CHECK: bnez $1, local_label # encoding: [0x14,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bltu $7, $8, global_label
# CHECK: sltu $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2b]
# CHECK: bnez $1, global_label # encoding: [0x14,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bltu $7, $0, local_label
# CHECK: nop
bltu $0, $8, local_label
# CHECK: bnez $8, local_label # encoding: [0x15,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bltu $0, $0, local_label
# CHECK: nop
ble $7, $8, local_label
# CHECK: slt $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2a]
# CHECK: beqz $1, local_label # encoding: [0x10,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
ble $7, $8, global_label
# CHECK: slt $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2a]
# CHECK: beqz $1, global_label # encoding: [0x10,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop
ble $7, $0, local_label
# CHECK: blez $7, local_label # encoding: [0x18,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
ble $0, $8, local_label
# CHECK: bgez $8, local_label # encoding: [0x05,0x01,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
ble $0, $0, local_label
# WARNING: :[[@LINE-1]]:3: warning: branch is always taken
# CHECK: blez $zero, local_label # encoding: [0x18,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bleu $7, $8, local_label
# CHECK: sltu $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2b]
# CHECK: beqz $1, local_label # encoding: [0x10,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bleu $7, $8, global_label
# CHECK: sltu $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2b]
# CHECK: beqz $1, global_label # encoding: [0x10,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bleu $7, $0, local_label
# CHECK: beqz $7, local_label # encoding: [0x10,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bleu $0, $8, local_label
# WARNING: :[[@LINE-1]]:3: warning: branch is always taken
# CHECK: b local_label # encoding: [0x10,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bleu $0, $0, local_label
# WARNING: :[[@LINE-1]]:3: warning: branch is always taken
# CHECK: b local_label # encoding: [0x10,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bge $7, $8, local_label
# CHECK: slt $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2a]
# CHECK: beqz $1, local_label # encoding: [0x10,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bge $7, $8, global_label
# CHECK: slt $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2a]
# CHECK: beqz $1, global_label # encoding: [0x10,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bge $7, $0, local_label
# CHECK: bgez $7, local_label # encoding: [0x04,0xe1,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bge $0, $8, local_label
# CHECK: blez $8, local_label # encoding: [0x19,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bge $0, $0, local_label
# WARNING: :[[@LINE-1]]:3: warning: branch is always taken
# CHECK: bgez $zero, local_label # encoding: [0x04,0x01,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgeu $7, $8, local_label
# CHECK: sltu $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2b]
# CHECK: beqz $1, local_label # encoding: [0x10,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgeu $7, $8, global_label
# CHECK: sltu $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2b]
# CHECK: beqz $1, global_label # encoding: [0x10,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgeu $7, $0, local_label
# WARNING: :[[@LINE-1]]:3: warning: branch is always taken
# CHECK: b local_label # encoding: [0x10,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgeu $0, $8, local_label
# CHECK: beqz $8, local_label # encoding: [0x11,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgeu $0, $0, local_label
# WARNING: :[[@LINE-1]]:3: warning: branch is always taken
# CHECK: b local_label # encoding: [0x10,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgt $7, $8, local_label
# CHECK: slt $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2a]
# CHECK: bnez $1, local_label # encoding: [0x14,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgt $7, $8, global_label
# CHECK: slt $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2a]
# CHECK: bnez $1, global_label # encoding: [0x14,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgt $7, $0, local_label
# CHECK: bgtz $7, local_label # encoding: [0x1c,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgt $0, $8, local_label
# CHECK: bltz $8, local_label # encoding: [0x05,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgt $0, $0, local_label
# CHECK: bgtz $zero, local_label # encoding: [0x1c,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgtu $7, $8, local_label
# CHECK: sltu $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2b]
# CHECK: bnez $1, local_label # encoding: [0x14,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgtu $7, $8, global_label
# CHECK: sltu $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2b]
# CHECK: bnez $1, global_label # encoding: [0x14,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgtu $7, $0, local_label
# CHECK: bnez $7, local_label # encoding: [0x14,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bgtu $0, $8, local_label
# CHECK: nop
bgtu $0, $0, local_label
# CHECK: bnez $zero, local_label # encoding: [0x14,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop
bltl $7,$8,local_label
# CHECK: slt $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2a]
# CHECK: bnel $1, $zero, local_label # encoding: [0x54,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bltl $7,$8,global_label
# CHECK: slt $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2a]
# CHECK: bnel $1, $zero, global_label # encoding: [0x54,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bltl $7,$0,local_label
# CHECK: bltz $7, local_label # encoding: [0x04,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bltl $0,$8,local_label
# CHECK: bgtz $8, local_label # encoding: [0x1d,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bltl $0,$0,local_label
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
blel $7,$8,local_label
# CHECK: slt $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2a]
# CHECK: beql $1, $zero, local_label # encoding: [0x50,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
blel $7,$8,global_label
# CHECK: slt $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2a]
# CHECK: beql $1, $zero, global_label # encoding: [0x50,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
blel $7,$0,local_label
# CHECK: blez $7, local_label # encoding: [0x18,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
blel $0,$8,local_label
# CHECK: bgez $8, local_label # encoding: [0x05,0x01,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
blel $0,$0,local_label
# WARNING: :[[@LINE-1]]:3: warning: branch is always taken
# CHECK: b local_label # encoding: [0x10,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgel $7,$8,local_label
# CHECK: slt $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2a]
# CHECK: beql $1, $zero, local_label # encoding: [0x50,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgel $7,$8,global_label
# CHECK: slt $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2a]
# CHECK: beql $1, $zero, global_label # encoding: [0x50,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgel $7,$0,local_label
# CHECK: bgez $7, local_label # encoding: [0x04,0xe1,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgel $0,$8,local_label
# CHECK: blez $8, local_label # encoding: [0x19,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgel $0,$0,local_label
# WARNING: :[[@LINE-1]]:3: warning: branch is always taken
# CHECK: b local_label # encoding: [0x10,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgtl $7,$8,local_label
# CHECK: slt $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2a]
# CHECK: bnel $1, $zero, local_label # encoding: [0x54,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgtl $7,$8,global_label
# CHECK: slt $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2a]
# CHECK: bnel $1, $zero, global_label # encoding: [0x54,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgtl $7,$0,local_label
# CHECK: bgtz $7, local_label # encoding: [0x1c,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgtl $0,$8,local_label
# CHECK: bltz $8, local_label # encoding: [0x05,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgtl $0,$0,local_label
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bltul $7,$8,local_label
# CHECK: sltu $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2b]
# CHECK: bnel $1, $zero, local_label # encoding: [0x54,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bltul $7,$8,global_label
# CHECK: sltu $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2b]
# CHECK: bnel $1, $zero, global_label # encoding: [0x54,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bltul $7,$0,local_label
# CHECK: bnez $7, local_label # encoding: [0x14,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bltul $0,$8,local_label
# CHECK: bnez $8, local_label # encoding: [0x15,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bltul $0,$0,local_label
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bleul $7,$8,local_label
# CHECK: sltu $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2b]
# CHECK: beql $1, $zero, local_label # encoding: [0x50,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bleul $7,$8,global_label
# CHECK: sltu $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2b]
# CHECK: beql $1, $zero, global_label # encoding: [0x50,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bleul $7,$0,local_label
# CHECK: beqz $7, local_label # encoding: [0x10,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bleul $0,$8,local_label
# CHECK: beqz $8, local_label # encoding: [0x11,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bleul $0,$0,local_label
# WARNING: :[[@LINE-1]]:3: warning: branch is always taken
# CHECK: b local_label # encoding: [0x10,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgeul $7,$8,local_label
# CHECK: sltu $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2b]
# CHECK: beql $1, $zero, local_label # encoding: [0x50,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgeul $7,$8,global_label
# CHECK: sltu $1, $7, $8 # encoding: [0x00,0xe8,0x08,0x2b]
# CHECK: beql $1, $zero, global_label # encoding: [0x50,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgeul $7,$0,local_label
# CHECK: beqz $7, local_label # encoding: [0x10,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgeul $0,$8,local_label
# CHECK: beqz $8, local_label # encoding: [0x11,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgeul $0,$0,local_label
# WARNING: :[[@LINE-1]]:3: warning: branch is always taken
# CHECK: b local_label # encoding: [0x10,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgtul $7,$8,local_label
# CHECK: sltu $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2b]
# CHECK: bnel $1, $zero, local_label # encoding: [0x54,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgtul $7,$8,global_label
# CHECK: sltu $1, $8, $7 # encoding: [0x01,0x07,0x08,0x2b]
# CHECK: bnel $1, $zero, global_label # encoding: [0x54,0x20,A,A]
# CHECK: # fixup A - offset: 0, value: global_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgtul $7,$0,local_label
# CHECK: bnez $7, local_label # encoding: [0x14,0xe0,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgtul $0,$8,local_label
# CHECK: bnez $8, local_label # encoding: [0x15,0x00,A,A]
# CHECK: # fixup A - offset: 0, value: local_label-4, kind: fixup_Mips_PC16
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
bgtul $0,$0,local_label
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]

View File

@@ -1,68 +0,0 @@
// RUN: llvm-mc -filetype=obj -triple mipsel-pc-Linux-gnu %s -o - | llvm-readobj -s -sd | FileCheck %s -check-prefix=CHECK-LE
// RUN: llvm-mc -filetype=obj -triple mips-pc-linux-gnu %s -o - | llvm-readobj -s -sd | FileCheck %s -check-prefix=CHECK-BE
// test that this produces a correctly encoded cfi_advance_loc for both endians.
f:
.cfi_startproc
nop
.zero 252
// DW_CFA_advance_loc2: 256 to 00000100
.cfi_def_cfa_offset 8
nop
.cfi_endproc
g:
.cfi_startproc
nop
.zero 65532
// DW_CFA_advance_loc4: 65536 to 00010104
.cfi_def_cfa_offset 8
nop
.cfi_endproc
// CHECK-LE: Section {
// CHECK-LE: Index: 7
// CHECK-LE: Name: .eh_frame (44)
// CHECK-LE-NEXT: Type: SHT_PROGBITS (0x1)
// CHECK-LE-NEXT: Flags [ (0x2)
// CHECK-LE-NEXT: SHF_ALLOC (0x2)
// CHECK-LE-NEXT: ]
// CHECK-LE-NEXT: Address: 0x0
// CHECK-LE-NEXT: Offset: 0x10180
// CHECK-LE-NEXT: Size: 68
// CHECK-LE-NEXT: Link: 0
// CHECK-LE-NEXT: Info: 0
// CHECK-LE-NEXT: AddressAlignment: 4
// CHECK-LE-NEXT: EntrySize: 0
// CHECK-LE-NEXT: SectionData (
// CHECK-LE-NEXT: 0000: 10000000 00000000 017A5200 017C1F01
// CHECK-LE-NEXT: 0010: 0B0C1D00 14000000 18000000 00000000
// CHECK-LE-NEXT: 0020: 04010000 00030001 0E080000 14000000
// CHECK-LE-NEXT: 0030: 30000000 04010000 04000100 00040000
// CHECK-LE-NEXT: 0040: 01000E08
// CHECK-LE-NEXT: )
// CHECK-LE-NEXT: }
// CHECK-BE: Section {
// CHECK-BE: Index: 7
// CHECK-BE: Name: .eh_frame (44)
// CHECK-BE-NEXT: Type: SHT_PROGBITS (0x1)
// CHECK-BE-NEXT: Flags [ (0x2)
// CHECK-BE-NEXT: SHF_ALLOC (0x2)
// CHECK-BE-NEXT: ]
// CHECK-BE-NEXT: Address: 0x0
// CHECK-BE-NEXT: Offset: 0x10180
// CHECK-BE-NEXT: Size: 68
// CHECK-BE-NEXT: Link: 0
// CHECK-BE-NEXT: Info: 0
// CHECK-BE-NEXT: AddressAlignment: 4
// CHECK-BE-NEXT: EntrySize: 0
// CHECK-BE-NEXT: SectionData (
// CHECK-BE-NEXT: 0000: 00000010 00000000 017A5200 017C1F01
// CHECK-BE-NEXT: 0010: 0B0C1D00 00000014 00000018 00000000
// CHECK-BE-NEXT: 0020: 00000104 00030100 0E080000 00000014
// CHECK-BE-NEXT: 0030: 00000030 00000104 00010004 00040001
// CHECK-BE-NEXT: 0040: 00000E08
// CHECK-BE-NEXT: )
// CHECK-BE-NEXT: }

View File

@@ -1,13 +0,0 @@
# RUN: llvm-mc %s -triple=mips-unknown-unknown -show-encoding -mcpu=mips32 | \
# RUN: FileCheck %s
# RUN: llvm-mc %s -triple=mips64-unknown-unknown -show-encoding -mcpu=mips64 | \
# RUN: FileCheck %s
# Check that we can accept register names in CFI directives and that they are
# canonicalised to their DWARF register numbers.
.cfi_startproc # CHECK: .cfi_startproc
.cfi_register $6, $5 # CHECK: .cfi_register 6, 5
.cfi_def_cfa $fp, 8 # CHECK: .cfi_def_cfa 30, 8
.cfi_def_cfa $2, 16 # CHECK: .cfi_def_cfa 2, 16
.cfi_endproc # CHECK: .cfi_endproc

View File

@@ -1,23 +0,0 @@
# Instructions that are invalid
#
# RUN: not llvm-mc %s -triple=mips64-unknown-linux -show-encoding -mcpu=octeon 2>%t1
# RUN: FileCheck %s < %t1
.set noat
foo:
bbit0 $19, -1, foo # CHECK: :[[@LINE]]:16: error: expected 6-bit unsigned immediate
bbit0 $19, 64, foo # CHECK: :[[@LINE]]:16: error: expected 6-bit unsigned immediate
bbit032 $19, -1, foo # CHECK: :[[@LINE]]:18: error: expected 5-bit unsigned immediate
bbit032 $19, 32, foo # CHECK: :[[@LINE]]:18: error: expected 5-bit unsigned immediate
bbit1 $19, -1, foo # CHECK: :[[@LINE]]:16: error: expected 6-bit unsigned immediate
bbit1 $19, 64, foo # CHECK: :[[@LINE]]:16: error: expected 6-bit unsigned immediate
bbit132 $19, -1, foo # CHECK: :[[@LINE]]:18: error: expected 5-bit unsigned immediate
bbit132 $19, 32, foo # CHECK: :[[@LINE]]:18: error: expected 5-bit unsigned immediate
ins $2, $3, -1, 1 # CHECK: :[[@LINE]]:17: error: expected 5-bit unsigned immediate
ins $2, $3, 32, 1 # CHECK: :[[@LINE]]:17: error: expected 5-bit unsigned immediate
ins $2, $3, 0, -1 # CHECK: :[[@LINE]]:20: error: expected immediate in range 1 .. 32
ins $2, $3, 0, 33 # CHECK: :[[@LINE]]:20: error: expected immediate in range 1 .. 32
seqi $2, $3, -1025 # CHECK: :[[@LINE]]:18: error: expected 10-bit signed immediate
seqi $2, $3, 1024 # CHECK: :[[@LINE]]:18: error: expected 10-bit signed immediate
snei $2, $3, -1025 # CHECK: :[[@LINE]]:18: error: expected 10-bit signed immediate
snei $2, $3, 1024 # CHECK: :[[@LINE]]:18: error: expected 10-bit signed immediate

View File

@@ -1,27 +0,0 @@
# RUN: not llvm-mc %s -arch=mips -mcpu=mips32r2 2>%t1
# RUN: FileCheck %s < %t1 -check-prefix=ASM
.text
.option pic2
.set noreorder
.set mips16
.cpload $25
# ASM: :[[@LINE-1]]:17: error: .cpload is not supported in Mips16 mode
.set nomips16
.set reorder
.cpload $25
# ASM: :[[@LINE-1]]:9: warning: .cpload should be inside a noreorder section
.set noreorder
.cpload $32
# ASM: :[[@LINE-1]]:17: error: invalid register
.cpload $foo
# ASM: :[[@LINE-1]]:17: error: expected register containing function address
.cpload bar
# ASM: :[[@LINE-1]]:17: error: expected register containing function address
.cpload $25 foobar
# ASM: :[[@LINE-1]]:21: error: unexpected token, expected end of statement

View File

@@ -1,39 +0,0 @@
# RUN: llvm-mc %s -arch=mips -mcpu=mips32r2 | FileCheck %s -check-prefix=ASM
#
# RUN: llvm-mc %s -arch=mips -mcpu=mips32r2 -filetype=obj -o -| \
# RUN: llvm-objdump -d -r - | FileCheck %s -check-prefix=OBJ-O32
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64r2 -target-abi n32 -filetype=obj -o -| \
# RUN: llvm-objdump -d -r - | FileCheck %s -check-prefix=OBJ-N32
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64r2 -filetype=obj -o -| \
# RUN: llvm-objdump -d -r - | FileCheck %s -check-prefix=OBJ-N64
# ASM: .text
# ASM: .option pic2
# ASM: .set noreorder
# ASM: .cpload $25
# ASM: .set reorder
# OBJ-O32: .text
# OBJ-O32: lui $gp, 0
# OBJ-O32: R_MIPS_HI16 _gp_disp
# OBJ-O32: addiu $gp, $gp, 0
# OBJ-O32: R_MIPS_LO16 _gp_disp
# OBJ-O32: addu $gp, $gp, $25
# OBJ-N32-NOT: .text
# OBJ-N32-NOT: lui $gp, 0
# OBJ-N32-NOT: addiu $gp, $gp, 0
# OBJ-N32-NOT: addu $gp, $gp, $25
# OBJ-N64-NOT: .text
# OBJ-N64-NOT: lui $gp, 0
# OBJ-N64-NOT: addiu $gp, $gp, 0
# OBJ-N64-NOT: addu $gp, $gp, $25
.text
.option pic2
.set noreorder
.cpload $25
.set reorder

View File

@@ -1,23 +0,0 @@
# RUN: not llvm-mc %s -arch=mips -mcpu=mips32 2>%t1
# RUN: FileCheck %s < %t1
.text
.set noreorder
.cpload $25
.set mips16
.cprestore 8
# CHECK: :[[@LINE-1]]:14: error: .cprestore is not supported in Mips16 mode
.set nomips16
.cprestore
# CHECK: :[[@LINE-1]]:13: error: expected stack offset value
.cprestore foo
# CHECK: :[[@LINE-1]]:17: error: stack offset is not an absolute expression
.cprestore -8
# CHECK: :[[@LINE-1]]:3: warning: .cprestore with negative stack offset has no effect
.cprestore 8, 35, bar
# CHECK: :[[@LINE-1]]:15: error: unexpected token, expected end of statement

View File

@@ -1,54 +0,0 @@
# RUN: not llvm-mc %s -arch=mips -mcpu=mips32 --position-independent -filetype=obj \
# RUN: -o /dev/null 2>&1 | FileCheck %s -check-prefix=O32
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 \
# RUN: -filetype=obj -o /dev/null 2>&1 | FileCheck %s -allow-empty -check-prefix=N32
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi=n32 \
# RUN: -filetype=obj -o /dev/null 2>&1 | FileCheck %s -allow-empty -check-prefix=N64
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi=n32 \
# RUN: -filetype=obj -o - | llvm-objdump -d -r - | \
# RUN: FileCheck %s -check-prefix=NO-STORE
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -filetype=obj -o - | \
# RUN: llvm-objdump -d -r - | FileCheck %s -check-prefix=NO-STORE
.text
.ent foo
foo:
.frame $sp, 0, $ra
.set noreorder
.set noat
.cpload $25
.cprestore 8
# O32-NOT: error: pseudo-instruction requires $at, which is not available
# N32-NOT: error: pseudo-instruction requires $at, which is not available
# N64-NOT: error: pseudo-instruction requires $at, which is not available
# NO-STORE-NOT: sw $gp, 8($sp)
jal $25
jal $4, $25
jal foo
.end foo
.ent bar
bar:
.frame $sp, 0, $ra
.set noreorder
.set noat
.cpload $25
.cprestore 65536
# O32: :[[@LINE-1]]:3: error: pseudo-instruction requires $at, which is not available
# N32-NOT: error: pseudo-instruction requires $at, which is not available
# N64-NOT: error: pseudo-instruction requires $at, which is not available
# NO-STORE-NOT: sw $gp,
jal $25
jal $4, $25
jal bar
.end bar

View File

@@ -1,96 +0,0 @@
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 --position-independent -show-encoding | \
# RUN: FileCheck %s
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 --position-independent -filetype=obj -o -| \
# RUN: llvm-objdump -d -r - | FileCheck %s -check-prefix=CHECK-FOR-STORE
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 -mattr=+micromips --position-independent -show-encoding | \
# RUN: FileCheck %s -check-prefix=MICROMIPS
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 -show-encoding | \
# RUN: FileCheck %s -check-prefix=NO-PIC
# RUN: llvm-mc %s -arch=mips -mcpu=mips64 -target-abi n32 --position-independent -show-encoding | \
# RUN: FileCheck %s -check-prefixes=BAD-ABI,BAD-ABI-N32
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n64 --position-independent -show-encoding | \
# RUN: FileCheck %s -check-prefixes=BAD-ABI,BAD-ABI-N64
.text
.ent foo
foo:
.frame $sp, 0, $ra
.set noreorder
.cpload $25
.cprestore 8
jal $25
jal $4, $25
jal foo
.end foo
# CHECK-FOR-STORE: sw $gp, 8($sp)
# CHECK: .cprestore 8
# CHECK: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
# CHECK: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# CHECK: jalr $4, $25 # encoding: [0x03,0x20,0x20,0x09]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
# CHECK: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# CHECK: lw $25, %got(foo)($gp) # encoding: [0x8f,0x99,A,A]
# CHECK: # fixup A - offset: 0, value: %got(foo), kind: fixup_Mips_GOT
# CHECK: addiu $25, $25, %lo(foo) # encoding: [0x27,0x39,A,A]
# CHECK: # fixup A - offset: 0, value: %lo(foo), kind: fixup_Mips_LO16
# CHECK: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
# CHECK: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# CHECK: .end foo
# MICROMIPS: .cprestore 8
# MICROMIPS: jalrs16 $25 # encoding: [0x45,0xf9]
# MICROMIPS: nop # encoding: [0x00,0x00,0x00,0x00]
# MICROMIPS: lw $gp, 8($sp) # encoding: [0xff,0x9d,0x00,0x08]
# MICROMIPS: jalrs $4, $25 # encoding: [0x00,0x99,0x4f,0x3c]
# MICROMIPS: nop # encoding: [0x00,0x00,0x00,0x00]
# MICROMIPS: lw $gp, 8($sp) # encoding: [0xff,0x9d,0x00,0x08]
# MICROMIPS: lw $25, %got(foo)($gp) # encoding: [0xff,0x3c,A,A]
# MICROMIPS: # fixup A - offset: 0, value: %got(foo), kind: fixup_MICROMIPS_GOT16
# MICROMIPS: addiu $25, $25, %lo(foo) # encoding: [0x33,0x39,A,A]
# MICROMIPS: # fixup A - offset: 0, value: %lo(foo), kind: fixup_MICROMIPS_LO16
# MICROMIPS: jalrs $ra, $25 # encoding: [0x03,0xf9,0x4f,0x3c]
# MICROMIPS: nop # encoding: [0x0c,0x00]
# MICROMIPS: lw $gp, 8($sp) # encoding: [0xff,0x9d,0x00,0x08]
# MICROMIPS: .end foo
# NO-PIC: .cprestore 8
# NO-PIC: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
# NO-PIC-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# NO-PIC: jalr $4, $25 # encoding: [0x03,0x20,0x20,0x09]
# NO-PIC-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# NO-PIC: jal foo # encoding: [0b000011AA,A,A,A]
# NO-PIC: # fixup A - offset: 0, value: foo, kind: fixup_Mips_26
# NO-PIC-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# NO-PIC: .end foo
# BAD-ABI: .cprestore 8
# BAD-ABI: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
# BAD-ABI-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# BAD-ABI: jalr $4, $25 # encoding: [0x03,0x20,0x20,0x09]
# BAD-ABI-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# BAD-ABI-N32: lw $25, %got_disp(foo)($gp) # encoding: [0x8f,0x99,A,A]
# BAD-ABI-N64: ld $25, %got_disp(foo)($gp) # encoding: [0xdf,0x99,A,A]
# BAD-ABI: # fixup A - offset: 0, value: %got_disp(foo), kind: fixup_Mips_GOT_DISP
# BAD-ABI: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
# BAD-ABI-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# BAD-ABI: .end foo

View File

@@ -1,97 +0,0 @@
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 --position-independent -show-encoding | \
# RUN: FileCheck %s
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 --position-independent -filetype=obj -o -| \
# RUN: llvm-objdump -d -r - | FileCheck %s -check-prefix=CHECK-FOR-STORE
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 -mattr=+micromips --position-independent -show-encoding | \
# RUN: FileCheck %s -check-prefix=MICROMIPS
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 -show-encoding | \
# RUN: FileCheck %s -check-prefix=NO-PIC
# RUN: llvm-mc %s -arch=mips -mcpu=mips64 -target-abi n32 --position-independent -show-encoding | \
# RUN: FileCheck %s -check-prefixes=BAD-ABI,BAD-ABI-N32
# RUN: llvm-mc %s -arch=mips64 -mcpu=mips64 -target-abi n64 --position-independent -show-encoding | \
# RUN: FileCheck %s -check-prefixes=BAD-ABI,BAD-ABI-N64
.text
.ent foo
foo:
.frame $sp, 0, $ra
.set noreorder
.cpload $25
.set reorder
.cprestore 8
jal $25
jal $4, $25
jal foo
.end foo
# CHECK-FOR-STORE: sw $gp, 8($sp)
# CHECK: .cprestore 8
# CHECK: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
# CHECK: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# CHECK: jalr $4, $25 # encoding: [0x03,0x20,0x20,0x09]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
# CHECK: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# CHECK: lw $25, %got(foo)($gp) # encoding: [0x8f,0x99,A,A]
# CHECK: # fixup A - offset: 0, value: %got(foo), kind: fixup_Mips_GOT
# CHECK: addiu $25, $25, %lo(foo) # encoding: [0x27,0x39,A,A]
# CHECK: # fixup A - offset: 0, value: %lo(foo), kind: fixup_Mips_LO16
# CHECK: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
# CHECK: nop # encoding: [0x00,0x00,0x00,0x00]
# CHECK: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# CHECK: .end foo
# MICROMIPS: .cprestore 8
# MICROMIPS: jalrs16 $25 # encoding: [0x45,0xf9]
# MICROMIPS: nop # encoding: [0x0c,0x00]
# MICROMIPS: lw $gp, 8($sp) # encoding: [0xff,0x9d,0x00,0x08]
# MICROMIPS: jalrs $4, $25 # encoding: [0x00,0x99,0x4f,0x3c]
# MICROMIPS: nop # encoding: [0x0c,0x00]
# MICROMIPS: lw $gp, 8($sp) # encoding: [0xff,0x9d,0x00,0x08]
# MICROMIPS: lw $25, %got(foo)($gp) # encoding: [0xff,0x3c,A,A]
# MICROMIPS: # fixup A - offset: 0, value: %got(foo), kind: fixup_MICROMIPS_GOT16
# MICROMIPS: addiu $25, $25, %lo(foo) # encoding: [0x33,0x39,A,A]
# MICROMIPS: # fixup A - offset: 0, value: %lo(foo), kind: fixup_MICROMIPS_LO16
# MICROMIPS: jalrs $ra, $25 # encoding: [0x03,0xf9,0x4f,0x3c]
# MICROMIPS: nop # encoding: [0x0c,0x00]
# MICROMIPS: lw $gp, 8($sp) # encoding: [0xff,0x9d,0x00,0x08]
# MICROMIPS: .end foo
# NO-PIC: .cprestore 8
# NO-PIC: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
# NO-PIC-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# NO-PIC: jalr $4, $25 # encoding: [0x03,0x20,0x20,0x09]
# NO-PIC-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# NO-PIC: jal foo # encoding: [0b000011AA,A,A,A]
# NO-PIC: # fixup A - offset: 0, value: foo, kind: fixup_Mips_26
# NO-PIC-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# NO-PIC: .end foo
# BAD-ABI: .cprestore 8
# BAD-ABI: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
# BAD-ABI-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# BAD-ABI: jalr $4, $25 # encoding: [0x03,0x20,0x20,0x09]
# BAD-ABI-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# BAD-ABI-N32: lw $25, %got_disp(foo)($gp) # encoding: [0x8f,0x99,A,A]
# BAD-ABI-N64: ld $25, %got_disp(foo)($gp) # encoding: [0xdf,0x99,A,A]
# BAD-ABI: # fixup A - offset: 0, value: %got_disp(foo), kind: fixup_Mips_GOT_DISP
# BAD-ABI: jalr $25 # encoding: [0x03,0x20,0xf8,0x09]
# BAD-ABI-NOT: lw $gp, 8($sp) # encoding: [0x8f,0xbc,0x00,0x08]
# BAD-ABI: .end foo

View File

@@ -1,10 +0,0 @@
# RUN: llvm-mc %s -arch=mips -mcpu=mips32 --position-independent 2>%t1
# RUN: FileCheck %s < %t1
.text
.set noreorder
.cpload $25
.set reorder
jal $25
# CHECK: :[[@LINE-1]]:3: warning: no .cprestore used in PIC mode

View File

@@ -1,22 +0,0 @@
# RUN: not llvm-mc %s -triple mips64-unknown-unknown 2>%t1
# RUN: FileCheck %s < %t1 -check-prefix=ASM
.text
.option pic2
t1:
.cpsetup $bar, 8, __cerror
# ASM: :[[@LINE-1]]:18: error: expected register containing function address
.cpsetup $33, 8, __cerror
# ASM: :[[@LINE-1]]:18: error: invalid register
.cpsetup $31, foo, __cerror
# ASM: :[[@LINE-1]]:23: error: expected save register or stack offset
.cpsetup $31, $32, __cerror
# ASM: :[[@LINE-1]]:23: error: invalid register
.cpsetup $25, $2, $3
# ASM: :[[@LINE-1]]:27: error: expected expression
.cpsetup $25, $2, 4
# ASM: :[[@LINE-1]]:28: error: expected symbol
.cpsetup $25, $2, 4+65
# ASM: :[[@LINE-1]]:31: error: expected symbol
.cpsetup $25, $2, foo+4
# ASM: :[[@LINE-1]]:32: error: expected symbol

View File

@@ -1,196 +0,0 @@
# RUN: llvm-mc -triple mips-unknown-linux -target-abi o32 -filetype=obj -o - %s | \
# RUN: llvm-objdump -d -r - | FileCheck -check-prefixes=ALL,O32 %s
# RUN: llvm-mc -triple mips-unknown-linux -target-abi o32 %s | \
# RUN: FileCheck -check-prefixes=ALL,ASM,ASM-O32 %s
# FIXME: Now we check .cpsetup expansion for `-mno-shared` case only.
# We also need to implement/check the `-mshared` case.
# RUN: llvm-mc -triple mips64-unknown-linux -target-abi n32 -filetype=obj -o - %s | \
# RUN: llvm-objdump -d -r - | \
# RUN: FileCheck -check-prefixes=ALL,NXX,N32 %s
# RUN: llvm-mc -triple mips64-unknown-linux -target-abi n32 %s | \
# RUN: FileCheck -check-prefixes=ALL,ASM,ASM-N32 %s
# RUN: llvm-mc -triple mips64-unknown-linux %s -filetype=obj -o - | \
# RUN: llvm-objdump -d -r - | \
# RUN: FileCheck -check-prefixes=ALL,NXX,N64 %s
# RUN: llvm-mc -triple mips64-unknown-linux %s | \
# RUN: FileCheck -check-prefixes=ALL,ASM,ASM-N64 %s
.text
.option pic2
t1:
.cpsetup $25, 8, __cerror
nop
.cpreturn
nop
# ALL-LABEL: t1:
# O32-NOT: __cerror
# NXX-NEXT: sd $gp, 8($sp)
# NXX-NEXT: lui $gp, 0
# N32-NEXT: R_MIPS_HI16 __gnu_local_gp
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
# NXX-NEXT: addiu $gp, $gp, 0
# N32-NEXT: R_MIPS_LO16 __gnu_local_gp
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
# N64-NEXT: daddu $gp, $gp, $25
# ASM-NEXT: .cpsetup $25, 8, __cerror
# ALL-NEXT: nop
# ASM-NEXT: .cpreturn
# NXX-NEXT: ld $gp, 8($sp)
# ALL-NEXT: nop
t2:
.cpsetup $25, $2, __cerror
nop
.cpreturn
nop
# ALL-LABEL: t2:
# O32-NOT: __cerror
# NXX-NEXT: move $2, $gp
# NXX-NEXT: lui $gp, 0
# N32-NEXT: R_MIPS_HI16 __gnu_local_gp
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
# NXX-NEXT: addiu $gp, $gp, 0
# N32-NEXT: R_MIPS_LO16 __gnu_local_gp
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
# N64-NEXT: daddu $gp, $gp, $25
# ASM-NEXT: .cpsetup $25, $2, __cerror
# ALL-NEXT: nop
# ASM-NEXT: .cpreturn
# NXX-NEXT: move $gp, $2
# ALL-NEXT: nop
# .cpsetup with local labels (PR22518):
# The '1:' label isn't emitted in all cases but we still want a label to match
# so we force one here.
t3:
nop
1:
.cpsetup $25, $2, 1b
nop
sub $3, $3, $2
# ALL-LABEL: t3:
# ALL-NEXT: nop
# O32-NEXT: nop
# O32-NEXT: sub $3, $3, $2
# NXX-NEXT: move $2, $gp
# NXX-NEXT: lui $gp, 0
# N32-NEXT: {{^ *0+}}38: R_MIPS_HI16 __gnu_local_gp
# N64-NEXT: {{^ *0+}}40: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 .text
# NXX-NEXT: addiu $gp, $gp, 0
# N32-NEXT: {{^ *0+}}3c: R_MIPS_LO16 __gnu_local_gp
# N64-NEXT: {{^ *0+}}44: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 .text
# N64-NEXT: daddu $gp, $gp, $25
# NXX-NEXT: nop
# NXX-NEXT: sub $3, $3, $2
# ASM-O32: [[LABEL:\$tmp0]]:
# ASM-N32: [[LABEL:\.Ltmp0]]:
# ASM-N64: [[LABEL:\.Ltmp0]]:
# ASM-NEXT: .cpsetup $25, $2, [[LABEL]]
# Ensure we have at least one instruction between labels so that the labels
# we're matching aren't removed.
nop
# ALL-NEXT: nop
.option pic0
t4:
nop
.cpsetup $25, 8, __cerror
nop
.cpreturn
nop
# Testing that .cpsetup expands to nothing in this case
# by checking that the next instruction after the first
# nop is also a 'nop'.
# ALL-LABEL: t4:
# NXX-NEXT: nop
# NXX-NEXT: nop
# NXX-NEXT: nop
# ASM-NEXT: nop
# ASM-NEXT: .cpsetup $25, 8, __cerror
# ASM-NEXT: nop
# ASM-NEXT: .cpreturn
# ASM-NEXT: nop
# Test that we accept constant expressions.
.option pic2
t5:
.cpsetup $25, ((8*4) - (3*8)), __cerror
nop
# ALL-LABEL: t5:
# O32-NOT: __cerror
# NXX-NEXT: sd $gp, 8($sp)
# NXX-NEXT: lui $gp, 0
# N32-NEXT: R_MIPS_HI16 __gnu_local_gp
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
# NXX-NEXT: addiu $gp, $gp, 0
# N32-NEXT: R_MIPS_LO16 __gnu_local_gp
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
# N64-NEXT: daddu $gp, $gp, $25
# ASM-NEXT: .cpsetup $25, 8, __cerror
# ALL-NEXT: nop
t1b:
IMM_8 = 8
.cpsetup $25, IMM_8, __cerror
nop
.cpreturn
nop
# ALL-LABEL: t1b:
# ASM-NEXT: IMM_8 = 8
# O32-NOT: __cerror
# NXX-NEXT: sd $gp, 8($sp)
# NXX-NEXT: lui $gp, 0
# N32-NEXT: R_MIPS_HI16 __gnu_local_gp
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_HI16 __cerror
# NXX-NEXT: addiu $gp, $gp, 0
# N32-NEXT: R_MIPS_LO16 __gnu_local_gp
# N64-NEXT: R_MIPS_GPREL16/R_MIPS_SUB/R_MIPS_LO16 __cerror
# N64-NEXT: daddu $gp, $gp, $25
# ASM-NEXT: .cpsetup $25, 8, __cerror
# ALL-NEXT: nop
# ASM-NEXT: .cpreturn
# NXX-NEXT: ld $gp, 8($sp)
# ALL-NEXT: nop

View File

@@ -1,50 +0,0 @@
# The effects of .ent on the .pdr section are tested in mips-pdr*.s. Test
# everything else here.
#
# RUN: llvm-mc -mcpu=mips32 -triple mips-unknown-unknown %s | \
# RUN: FileCheck -check-prefix=ASM %s
# RUN: llvm-mc -filetype=obj -mcpu=mips32 -triple mips-unknown-unknown %s | \
# RUN: llvm-readobj -symbols | \
# RUN: FileCheck -check-prefixes=OBJ,OBJ-32 %s
#
# RUN: llvm-mc -mcpu=mips32 -mattr=micromips -triple mips-unknown-unknown %s | \
# RUN: FileCheck -check-prefix=ASM %s
# RUN: llvm-mc -filetype=obj -mcpu=mips32 -mattr=micromips \
# RUN: -triple mips-unknown-unknown %s | \
# RUN: llvm-readobj -symbols | \
# RUN: FileCheck -check-prefixes=OBJ,OBJ-MM %s
#
.ent a
a:
# ASM: .ent a
# ASM: a:
# OBJ: Name: a
# OBJ: Value: 0x0
# OBJ: Size: 0
# OBJ: Binding: Local
# OBJ: Type: Function
# OBJ: Other: 0
# OBJ: Section: .text
# OBJ: }
.ent b
b:
nop
nop
.end b
# ASM: .ent b
# ASM: b:
# OBJ: Name: b
# OBJ: Value: 0x0
# OBJ-32: Size: 8
# FIXME: microMIPS uses the 4-byte nop instead of the 2-byte nop.
# OBJ-MM: Size: 8
# OBJ: Binding: Local
# OBJ: Type: Function
# OBJ: Other: 0
# OBJ: Section: .text
# OBJ: }

View File

@@ -1,75 +0,0 @@
// This test case will cause an internal EK_GPRel64BlockAddress to be
// produced. This was not handled for direct object and an assertion
// to occur. This is a variation on test case test/CodeGen/Mips/do_switch.ll
// RUN: llvm-mc < %s -filetype=obj -triple=mips-pc-linux
.text
.abicalls
.option pic0
.section .mdebug.abi32,"",@progbits
.file "/home/espindola/llvm/llvm/test/MC/Mips/do_switch.ll"
.text
.globl main
.align 2
.type main,@function
.set nomips16
.ent main
main: # @main
.frame $sp,8,$ra
.mask 0x00000000,0
.fmask 0x00000000,0
.set noreorder
.set nomacro
.set noat
# %bb.0: # %entry
addiu $sp, $sp, -8
addiu $1, $zero, 2
sw $1, 4($sp)
lw $2, 4($sp)
sltiu $1, $2, 4
bnez $1, $BB0_2
nop
$BB0_1: # %bb4
addiu $2, $zero, 4
jr $ra
addiu $sp, $sp, 8
$BB0_2: # %entry
sll $1, $2, 2
lui $2, %hi($JTI0_0)
addu $1, $1, $2
lw $1, %lo($JTI0_0)($1)
jr $1
nop
$BB0_3: # %bb5
addiu $2, $zero, 1
jr $ra
addiu $sp, $sp, 8
$BB0_4: # %bb1
addiu $2, $zero, 2
jr $ra
addiu $sp, $sp, 8
$BB0_5: # %bb2
addiu $2, $zero, 0
jr $ra
addiu $sp, $sp, 8
$BB0_6: # %bb3
addiu $2, $zero, 3
jr $ra
addiu $sp, $sp, 8
.set at
.set macro
.set reorder
.end main
$tmp0:
.size main, ($tmp0)-main
.section .rodata,"a",@progbits
.align 2
$JTI0_0:
.4byte ($BB0_3)
.4byte ($BB0_4)
.4byte ($BB0_5)
.4byte ($BB0_6)
.text

Some files were not shown because too many files have changed in this diff Show More