summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2014-03-25 11:16:03 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2014-03-25 11:16:03 +0000
commitc7e1663c24a5fb8b764ac82325d413d91f718366 (patch)
treea8880b27ebde5218f3ea9ec16e44bc46ec5a8c3a /test
parentc141b331b90696f85ebddf8d3d04e1143738b271 (diff)
downloadllvm-c7e1663c24a5fb8b764ac82325d413d91f718366.tar.gz
llvm-c7e1663c24a5fb8b764ac82325d413d91f718366.tar.bz2
llvm-c7e1663c24a5fb8b764ac82325d413d91f718366.tar.xz
[mips] Correct testcase for .set at=$reg and emit the new warnings for numeric registers too.
Summary: Remove the XFAIL added in my previous commit and correct the test such that it correctly tests the expansion of the assembler temporary. Also added a test to check that $at is always $1 when written by the user. Corrected the new assembler temporary warnings so that they are emitted for numeric registers too. Differential Revision: http://llvm-reviews.chandlerc.com/D3169 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/MC/Mips/set-at-directive-explicit-at.s39
-rw-r--r--test/MC/Mips/set-at-directive.s218
2 files changed, 163 insertions, 94 deletions
diff --git a/test/MC/Mips/set-at-directive-explicit-at.s b/test/MC/Mips/set-at-directive-explicit-at.s
new file mode 100644
index 0000000000..b8c8adc881
--- /dev/null
+++ b/test/MC/Mips/set-at-directive-explicit-at.s
@@ -0,0 +1,39 @@
+# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding -mcpu=mips32r2 \
+# RUN: 2>%t1 | FileCheck %s
+# RUN: FileCheck -check-prefix=WARNINGS %s < %t1
+# Check that the assembler can handle the documented syntax
+# for ".set at" and set the correct value. The correct value for $at is always
+# $1 when written by the user.
+ .text
+foo:
+# CHECK: jr $1 # encoding: [0x08,0x00,0x20,0x00]
+# WARNINGS: :[[@LINE+2]]:12: warning: Used $at without ".set noat"
+ .set at=$1
+ jr $at
+
+# CHECK: jr $1 # encoding: [0x08,0x00,0x20,0x00]
+# WARNINGS: :[[@LINE+2]]:12: warning: Used $at without ".set noat"
+ .set at=$1
+ jr $1
+# WARNINGS-NOT: warning: Used $at without ".set noat"
+
+# CHECK: jr $1 # encoding: [0x08,0x00,0x20,0x00]
+ .set at=$2
+ jr $at
+# CHECK: jr $1 # encoding: [0x08,0x00,0x20,0x00]
+ .set at=$3
+ jr $at
+# CHECK: jr $1 # encoding: [0x08,0x00,0x20,0x00]
+ .set noat
+ jr $at
+
+# CHECK: jr $16 # encoding: [0x08,0x00,0x00,0x02]
+# WARNINGS: :[[@LINE+2]]:12: warning: Used $16 with ".set at=$16"
+ .set at=$16
+ jr $s0
+
+# CHECK: jr $16 # encoding: [0x08,0x00,0x00,0x02]
+# WARNINGS: :[[@LINE+2]]:12: warning: Used $16 with ".set at=$16"
+ .set at=$16
+ jr $16
+# WARNINGS-NOT: warning
diff --git a/test/MC/Mips/set-at-directive.s b/test/MC/Mips/set-at-directive.s
index be528c977e..7e93f765ac 100644
--- a/test/MC/Mips/set-at-directive.s
+++ b/test/MC/Mips/set-at-directive.s
@@ -2,130 +2,160 @@
# 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]
+# CHECK: lui $1, 1
+# CHECK: addu $1, $1, $2
+# CHECK: lw $2, 0($1)
.set at=$1
- jr $at
- nop
-# CHECK: jr $2 # encoding: [0x08,0x00,0x40,0x00]
+ lw $2, 65536($2)
+# CHECK: lui $2, 1
+# CHECK: addu $2, $2, $1
+# CHECK: lw $1, 0($2)
.set at=$2
- jr $at
- nop
-# CHECK: jr $3 # encoding: [0x08,0x00,0x60,0x00]
+ lw $1, 65536($1)
+# CHECK: lui $3, 1
+# CHECK: addu $3, $3, $1
+# CHECK: lw $1, 0($3)
.set at=$3
- jr $at
- nop
-# CHECK: jr $4 # encoding: [0x08,0x00,0x80,0x00]
+ lw $1, 65536($1)
+# CHECK: lui $4, 1
+# CHECK: addu $4, $4, $1
+# CHECK: lw $1, 0($4)
.set at=$a0
- jr $at
- nop
-# CHECK: jr $5 # encoding: [0x08,0x00,0xa0,0x00]
+ lw $1, 65536($1)
+# CHECK: lui $5, 1
+# CHECK: addu $5, $5, $1
+# CHECK: lw $1, 0($5)
.set at=$a1
- jr $at
- nop
-# CHECK: jr $6 # encoding: [0x08,0x00,0xc0,0x00]
+ lw $1, 65536($1)
+# CHECK: lui $6, 1
+# CHECK: addu $6, $6, $1
+# CHECK: lw $1, 0($6)
.set at=$a2
- jr $at
- nop
-# CHECK: jr $7 # encoding: [0x08,0x00,0xe0,0x00]
+ lw $1, 65536($1)
+# CHECK: lui $7, 1
+# CHECK: addu $7, $7, $1
+# CHECK: lw $1, 0($7)
.set at=$a3
- jr $at
- nop
-# CHECK: jr $8 # encoding: [0x08,0x00,0x00,0x01]
+ lw $1, 65536($1)
+# CHECK: lui $8, 1
+# CHECK: addu $8, $8, $1
+# CHECK: lw $1, 0($8)
.set at=$8
- jr $at
- nop
-# CHECK: jr $9 # encoding: [0x08,0x00,0x20,0x01]
+ lw $1, 65536($1)
+# CHECK: lui $9, 1
+# CHECK: addu $9, $9, $1
+# CHECK: lw $1, 0($9)
.set at=$9
- jr $at
- nop
-# CHECK: jr $10 # encoding: [0x08,0x00,0x40,0x01]
+ lw $1, 65536($1)
+# CHECK: lui $10, 1
+# CHECK: addu $10, $10, $1
+# CHECK: lw $1, 0($10)
.set at=$10
- jr $at
- nop
-# CHECK: jr $11 # encoding: [0x08,0x00,0x60,0x01]
+ lw $1, 65536($1)
+# CHECK: lui $11, 1
+# CHECK: addu $11, $11, $1
+# CHECK: lw $1, 0($11)
.set at=$11
- jr $at
- nop
-# CHECK: jr $12 # encoding: [0x08,0x00,0x80,0x01]
+ lw $1, 65536($1)
+# CHECK: lui $12, 1
+# CHECK: addu $12, $12, $1
+# CHECK: lw $1, 0($12)
.set at=$12
- jr $at
- nop
-# CHECK: jr $13 # encoding: [0x08,0x00,0xa0,0x01]
+ lw $1, 65536($1)
+# CHECK: lui $13, 1
+# CHECK: addu $13, $13, $1
+# CHECK: lw $1, 0($13)
.set at=$13
- jr $at
- nop
-# CHECK: jr $14 # encoding: [0x08,0x00,0xc0,0x01]
+ lw $1, 65536($1)
+# CHECK: lui $14, 1
+# CHECK: addu $14, $14, $1
+# CHECK: lw $1, 0($14)
.set at=$14
- jr $at
- nop
-# CHECK: jr $15 # encoding: [0x08,0x00,0xe0,0x01]
+ lw $1, 65536($1)
+# CHECK: lui $15, 1
+# CHECK: addu $15, $15, $1
+# CHECK: lw $1, 0($15)
.set at=$15
- jr $at
- nop
-# CHECK: jr $16 # encoding: [0x08,0x00,0x00,0x02]
+ lw $1, 65536($1)
+# CHECK: lui $16, 1
+# CHECK: addu $16, $16, $1
+# CHECK: lw $1, 0($16)
.set at=$s0
- jr $at
- nop
-# CHECK: jr $17 # encoding: [0x08,0x00,0x20,0x02]
+ lw $1, 65536($1)
+# CHECK: lui $17, 1
+# CHECK: addu $17, $17, $1
+# CHECK: lw $1, 0($17)
.set at=$s1
- jr $at
- nop
-# CHECK: jr $18 # encoding: [0x08,0x00,0x40,0x02]
+ lw $1, 65536($1)
+# CHECK: lui $18, 1
+# CHECK: addu $18, $18, $1
+# CHECK: lw $1, 0($18)
.set at=$s2
- jr $at
- nop
-# CHECK: jr $19 # encoding: [0x08,0x00,0x60,0x02]
+ lw $1, 65536($1)
+# CHECK: lui $19, 1
+# CHECK: addu $19, $19, $1
+# CHECK: lw $1, 0($19)
.set at=$s3
- jr $at
- nop
-# CHECK: jr $20 # encoding: [0x08,0x00,0x80,0x02]
+ lw $1, 65536($1)
+# CHECK: lui $20, 1
+# CHECK: addu $20, $20, $1
+# CHECK: lw $1, 0($20)
.set at=$s4
- jr $at
- nop
-# CHECK: jr $21 # encoding: [0x08,0x00,0xa0,0x02]
+ lw $1, 65536($1)
+# CHECK: lui $21, 1
+# CHECK: addu $21, $21, $1
+# CHECK: lw $1, 0($21)
.set at=$s5
- jr $at
- nop
-# CHECK: jr $22 # encoding: [0x08,0x00,0xc0,0x02]
+ lw $1, 65536($1)
+# CHECK: lui $22, 1
+# CHECK: addu $22, $22, $1
+# CHECK: lw $1, 0($22)
.set at=$s6
- jr $at
- nop
-# CHECK: jr $23 # encoding: [0x08,0x00,0xe0,0x02]
+ lw $1, 65536($1)
+# CHECK: lui $23, 1
+# CHECK: addu $23, $23, $1
+# CHECK: lw $1, 0($23)
.set at=$s7
- jr $at
- nop
-# CHECK: jr $24 # encoding: [0x08,0x00,0x00,0x03]
+ lw $1, 65536($1)
+# CHECK: lui $24, 1
+# CHECK: addu $24, $24, $1
+# CHECK: lw $1, 0($24)
.set at=$24
- jr $at
- nop
-# CHECK: jr $25 # encoding: [0x08,0x00,0x20,0x03]
+ lw $1, 65536($1)
+# CHECK: lui $25, 1
+# CHECK: addu $25, $25, $1
+# CHECK: lw $1, 0($25)
.set at=$25
- jr $at
- nop
-# CHECK: jr $26 # encoding: [0x08,0x00,0x40,0x03]
+ lw $1, 65536($1)
+# CHECK: lui $26, 1
+# CHECK: addu $26, $26, $1
+# CHECK: lw $1, 0($26)
.set at=$26
- jr $at
- nop
-# CHECK: jr $27 # encoding: [0x08,0x00,0x60,0x03]
+ lw $1, 65536($1)
+# CHECK: lui $27, 1
+# CHECK: addu $27, $27, $1
+# CHECK: lw $1, 0($27)
.set at=$27
- jr $at
- nop
-# CHECK: jr $gp # encoding: [0x08,0x00,0x80,0x03]
+ lw $1, 65536($1)
+# CHECK: lui $gp, 1
+# CHECK: addu $gp, $gp, $1
+# CHECK: lw $1, 0($gp)
.set at=$gp
- jr $at
- nop
-# CHECK: jr $fp # encoding: [0x08,0x00,0xc0,0x03]
+ lw $1, 65536($1)
+# CHECK: lui $fp, 1
+# CHECK: addu $fp, $fp, $1
+# CHECK: lw $1, 0($fp)
.set at=$fp
- jr $at
- nop
-# CHECK: jr $sp # encoding: [0x08,0x00,0xa0,0x03]
+ lw $1, 65536($1)
+# CHECK: lui $sp, 1
+# CHECK: addu $sp, $sp, $1
+# CHECK: lw $1, 0($sp)
.set at=$sp
- jr $at
- nop
-# CHECK: jr $ra # encoding: [0x08,0x00,0xe0,0x03]
+ lw $1, 65536($1)
+# CHECK: lui $ra, 1
+# CHECK: addu $ra, $ra, $1
+# CHECK: lw $1, 0($ra)
.set at=$ra
- jr $at
- nop
+ lw $1, 65536($1)