1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
llvm-mirror/test/MC/Mips/set-at-directive.s
Daniel Sanders 3b63d409c9 [mips] Fix assembler temporary expansion and add associated warnings about the use of $at.
Summary:
The assembler temporary is normally $at ($1) but can be reassigned using
'.set at=$reg'. Regardless of which register is nominated as the assembler
temporary, $at remains $1 when written by the user.

Adds warnings under the following conditions:
* The register nominated as the assembler temporary is used by the user.
* '.set noat' is in effect and $at is used by the user.
Both of these only work for named registers. I have a follow up commit that makes it work for numeric registers as well.

XFAIL set-at-directive.s since it incorrectly tests that $at is redefined by
'.set at=$reg'. Testcases will follow in a separate commit.

Patch by David Chisnall
His work was sponsored by: DARPA, AFRL

Differential Revision: http://llvm-reviews.chandlerc.com/D3167

llvm-svn: 204710
2014-03-25 10:57:07 +00:00

132 lines
3.7 KiB
ArmAsm

# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 | \
# RUN: FileCheck %s
# Check that the assembler can handle the documented syntax
# for ".set at" and set the correct value.
# XFAIL:
.text
foo:
# CHECK: jr $1 # encoding: [0x08,0x00,0x20,0x00]
.set at=$1
jr $at
nop
# CHECK: jr $2 # encoding: [0x08,0x00,0x40,0x00]
.set at=$2
jr $at
nop
# CHECK: jr $3 # encoding: [0x08,0x00,0x60,0x00]
.set at=$3
jr $at
nop
# CHECK: jr $4 # encoding: [0x08,0x00,0x80,0x00]
.set at=$a0
jr $at
nop
# CHECK: jr $5 # encoding: [0x08,0x00,0xa0,0x00]
.set at=$a1
jr $at
nop
# CHECK: jr $6 # encoding: [0x08,0x00,0xc0,0x00]
.set at=$a2
jr $at
nop
# CHECK: jr $7 # encoding: [0x08,0x00,0xe0,0x00]
.set at=$a3
jr $at
nop
# CHECK: jr $8 # encoding: [0x08,0x00,0x00,0x01]
.set at=$8
jr $at
nop
# CHECK: jr $9 # encoding: [0x08,0x00,0x20,0x01]
.set at=$9
jr $at
nop
# CHECK: jr $10 # encoding: [0x08,0x00,0x40,0x01]
.set at=$10
jr $at
nop
# CHECK: jr $11 # encoding: [0x08,0x00,0x60,0x01]
.set at=$11
jr $at
nop
# CHECK: jr $12 # encoding: [0x08,0x00,0x80,0x01]
.set at=$12
jr $at
nop
# CHECK: jr $13 # encoding: [0x08,0x00,0xa0,0x01]
.set at=$13
jr $at
nop
# CHECK: jr $14 # encoding: [0x08,0x00,0xc0,0x01]
.set at=$14
jr $at
nop
# CHECK: jr $15 # encoding: [0x08,0x00,0xe0,0x01]
.set at=$15
jr $at
nop
# CHECK: jr $16 # encoding: [0x08,0x00,0x00,0x02]
.set at=$s0
jr $at
nop
# CHECK: jr $17 # encoding: [0x08,0x00,0x20,0x02]
.set at=$s1
jr $at
nop
# CHECK: jr $18 # encoding: [0x08,0x00,0x40,0x02]
.set at=$s2
jr $at
nop
# CHECK: jr $19 # encoding: [0x08,0x00,0x60,0x02]
.set at=$s3
jr $at
nop
# CHECK: jr $20 # encoding: [0x08,0x00,0x80,0x02]
.set at=$s4
jr $at
nop
# CHECK: jr $21 # encoding: [0x08,0x00,0xa0,0x02]
.set at=$s5
jr $at
nop
# CHECK: jr $22 # encoding: [0x08,0x00,0xc0,0x02]
.set at=$s6
jr $at
nop
# CHECK: jr $23 # encoding: [0x08,0x00,0xe0,0x02]
.set at=$s7
jr $at
nop
# CHECK: jr $24 # encoding: [0x08,0x00,0x00,0x03]
.set at=$24
jr $at
nop
# CHECK: jr $25 # encoding: [0x08,0x00,0x20,0x03]
.set at=$25
jr $at
nop
# CHECK: jr $26 # encoding: [0x08,0x00,0x40,0x03]
.set at=$26
jr $at
nop
# CHECK: jr $27 # encoding: [0x08,0x00,0x60,0x03]
.set at=$27
jr $at
nop
# CHECK: jr $gp # encoding: [0x08,0x00,0x80,0x03]
.set at=$gp
jr $at
nop
# CHECK: jr $fp # encoding: [0x08,0x00,0xc0,0x03]
.set at=$fp
jr $at
nop
# CHECK: jr $sp # encoding: [0x08,0x00,0xa0,0x03]
.set at=$sp
jr $at
nop
# CHECK: jr $ra # encoding: [0x08,0x00,0xe0,0x03]
.set at=$ra
jr $at
nop