[llvm] r318389 - [mips][mt] Add missing test cases from r318207

Simon Dardis via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 16 02:50:44 PST 2017


Author: sdardis
Date: Thu Nov 16 02:50:44 2017
New Revision: 318389

URL: http://llvm.org/viewvc/llvm-project?rev=318389&view=rev
Log:
[mips][mt] Add missing test cases from r318207

Added:
    llvm/trunk/test/MC/Mips/mt/invalid-wrong-error.s
    llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s
    llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s
    llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases.s
    llvm/trunk/test/MC/Mips/mt/mftr-mttr-reserved-valid.s

Added: llvm/trunk/test/MC/Mips/mt/invalid-wrong-error.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mt/invalid-wrong-error.s?rev=318389&view=auto
==============================================================================
--- llvm/trunk/test/MC/Mips/mt/invalid-wrong-error.s (added)
+++ llvm/trunk/test/MC/Mips/mt/invalid-wrong-error.s Thu Nov 16 02:50:44 2017
@@ -0,0 +1,4 @@
+# RUN: not llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt < %s 2>%t1
+# RUN: FileCheck %s < %t1
+  mftr 0($4), $5, 0, 0, 0 # CHECK: error: unexpected token in argument list
+  mttr 0($4), $5, 0, 0, 0 # CHECK: error: unexpected token in argument list

Added: llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s?rev=318389&view=auto
==============================================================================
--- llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s (added)
+++ llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases-invalid-wrong-error.s Thu Nov 16 02:50:44 2017
@@ -0,0 +1,18 @@
+# RUN: not llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s 2>%t1
+# RUN: FileCheck %s < %t1
+
+# The integrated assembler produces a wrong or misleading error message.
+
+  mftc0 0($4), $5    # CHECK: error: unexpected token in argument list
+  mftc0 0($4), $5, 1 # CHECK: error: unexpected token in argument list
+  mftgpr 0($4), $5   # CHECK: error: unexpected token in argument list
+  mftlo 0($3)        # CHECK: error: unexpected token in argument list
+  mftlo 0($3), $ac1  # CHECK: error: unexpected token in argument list
+  mfthi 0($3)        # CHECK: error: unexpected token in argument list
+  mfthi 0($3), $ac1  # CHECK: error: unexpected token in argument list
+  mftacx 0($3)       # CHECK: error: unexpected token in argument list
+  mftacx 0($3), $ac1 # CHECK: error: unexpected token in argument list
+  mftdsp 0($4)       # CHECK: error: unexpected token in argument list
+  mftc1 0($4), $f4   # CHECK: error: unexpected token in argument list
+  mfthc1 0($4), $f4  # CHECK: error: unexpected token in argument list
+  cftc1 0($4), $f8   # CHECK: error: unexpected token in argument list

Added: llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s?rev=318389&view=auto
==============================================================================
--- llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s (added)
+++ llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases-invalid.s Thu Nov 16 02:50:44 2017
@@ -0,0 +1,23 @@
+# RUN: not llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s 2>%t1
+# RUN: FileCheck %s < %t1
+
+  mftc0 $4, 0($5)     # CHECK: error: invalid operand for instruction
+  mftc0 $4, 0($5), 1  # CHECK: error: invalid operand for instruction
+  mftc0 $4, $5, -1    # CHECK: error: expected 3-bit unsigned immediate
+  mftc0 $4, $5, 9     # CHECK: error: expected 3-bit unsigned immediate
+  mftc0 $4, $5, $6    # CHECK: error: expected 3-bit unsigned immediate
+  mftgpr $4, 0($5)    # CHECK: error: invalid operand for instruction
+  mftgpr $4, $5, $6   # CHECK: error: invalid operand for instruction
+  mftlo $3, 0($ac1)   # CHECK: error: invalid operand for instruction
+  mftlo $4, $ac1, $4  # CHECK: error: invalid operand for instruction
+  mfthi $3, 0($ac1)   # CHECK: error: invalid operand for instruction
+  mfthi $4, $ac1, $4  # CHECK: error: invalid operand for instruction
+  mftacx $3, 0($ac1)  # CHECK: error: invalid operand for instruction
+  mftacx $4, $ac1, $4 # CHECK: error: invalid operand for instruction
+  mftdsp $4, $5       # CHECK: error: invalid operand for instruction
+  mftdsp $4, $f5      # CHECK: error: invalid operand for instruction
+  mftdsp $4, $ac0     # CHECK: error: invalid operand for instruction
+  mftc1 $4, 0($f4)    # CHECK: error: invalid operand for instruction
+  mfthc1 $4, 0($f4)   # CHECK: error: invalid operand for instruction
+  cftc1 $4, 0($f4)    # CHECK: error: invalid operand for instruction
+  cftc1 $4, $f4, $5   # CHECK: error: invalid operand for instruction

Added: llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases.s?rev=318389&view=auto
==============================================================================
--- llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases.s (added)
+++ llvm/trunk/test/MC/Mips/mt/mftr-mttr-aliases.s Thu Nov 16 02:50:44 2017
@@ -0,0 +1,47 @@
+# RUN: llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s | FileCheck %s
+
+# Check the various aliases of the m[ft]tr instruction.
+
+  mftc0 $4, $5           # CHECK: mftr  $4, $5, 0, 0, 0         # encoding: [0x41,0x05,0x20,0x00]
+  mftc0 $6, $7, 1        # CHECK: mftr  $6, $7, 0, 1, 0         # encoding: [0x41,0x07,0x30,0x01]
+  mftgpr $5, $9          # CHECK: mftr  $5, $9, 1, 0, 0         # encoding: [0x41,0x09,0x28,0x20]
+  mftlo $3               # CHECK: mftr  $3, $zero, 1, 1, 0      # encoding: [0x41,0x00,0x18,0x21]
+  mftlo $3, $ac0         # CHECK: mftr  $3, $zero, 1, 1, 0      # encoding: [0x41,0x00,0x18,0x21]
+  mftlo $3, $ac1         # CHECK: mftr  $3, $4, 1, 1, 0         # encoding: [0x41,0x04,0x18,0x21]
+  mftlo $3, $ac2         # CHECK: mftr  $3, $8, 1, 1, 0         # encoding: [0x41,0x08,0x18,0x21]
+  mftlo $3, $ac3         # CHECK: mftr  $3, $12, 1, 1, 0        # encoding: [0x41,0x0c,0x18,0x21]
+  mfthi $3, $ac0         # CHECK: mftr  $3, $1, 1, 1, 0         # encoding: [0x41,0x01,0x18,0x21]
+  mfthi $3, $ac1         # CHECK: mftr  $3, $5, 1, 1, 0         # encoding: [0x41,0x05,0x18,0x21]
+  mfthi $3, $ac2         # CHECK: mftr  $3, $9, 1, 1, 0         # encoding: [0x41,0x09,0x18,0x21]
+  mfthi $3, $ac3         # CHECK: mftr  $3, $13, 1, 1, 0        # encoding: [0x41,0x0d,0x18,0x21]
+  mftacx $3, $ac0        # CHECK: mftr  $3, $2, 1, 1, 0         # encoding: [0x41,0x02,0x18,0x21]
+  mftacx $3, $ac1        # CHECK: mftr  $3, $6, 1, 1, 0         # encoding: [0x41,0x06,0x18,0x21]
+  mftacx $3, $ac2        # CHECK: mftr  $3, $10, 1, 1, 0        # encoding: [0x41,0x0a,0x18,0x21]
+  mftacx $3, $ac3        # CHECK: mftr  $3, $14, 1, 1, 0        # encoding: [0x41,0x0e,0x18,0x21]
+  mftdsp $4              # CHECK: mftr  $4, $16, 1, 1, 0        # encoding: [0x41,0x10,0x20,0x21]
+  mftc1 $4, $f5          # CHECK: mftr  $4, $5, 1, 2, 0         # encoding: [0x41,0x05,0x20,0x22]
+  mfthc1 $4, $f5         # CHECK: mftr  $4, $5, 1, 2, 1         # encoding: [0x41,0x05,0x20,0x32]
+  cftc1  $4, $f9         # CHECK: mftr  $4, $9, 1, 3, 0         # encoding: [0x41,0x09,0x20,0x23]
+
+  mttc0 $4, $5           # CHECK: mttr  $4, $5, 0, 0, 0         # encoding: [0x41,0x84,0x28,0x00]
+  mttc0 $6, $7, 1        # CHECK: mttr  $6, $7, 0, 1, 0         # encoding: [0x41,0x86,0x38,0x01]
+  mttgpr $5, $9          # CHECK: mttr  $5, $9, 1, 0, 0         # encoding: [0x41,0x85,0x48,0x20]
+  mttlo $3               # CHECK: mttr  $3, $zero, 1, 1, 0      # encoding: [0x41,0x83,0x00,0x21]
+  mttlo $3, $ac0         # CHECK: mttr  $3, $zero, 1, 1, 0      # encoding: [0x41,0x83,0x00,0x21]
+  mttlo $3, $ac1         # CHECK: mttr  $3, $4, 1, 1, 0         # encoding: [0x41,0x83,0x20,0x21]
+  mttlo $3, $ac2         # CHECK: mttr  $3, $8, 1, 1, 0         # encoding: [0x41,0x83,0x40,0x21]
+  mttlo $3, $ac3         # CHECK: mttr  $3, $12, 1, 1, 0        # encoding: [0x41,0x83,0x60,0x21]
+  mtthi $3               # CHECK: mttr  $3, $1, 1, 1, 0         # encoding: [0x41,0x83,0x08,0x21]
+  mtthi $3, $ac0         # CHECK: mttr  $3, $1, 1, 1, 0         # encoding: [0x41,0x83,0x08,0x21]
+  mtthi $3, $ac1         # CHECK: mttr  $3, $5, 1, 1, 0         # encoding: [0x41,0x83,0x28,0x21]
+  mtthi $3, $ac2         # CHECK: mttr  $3, $9, 1, 1, 0         # encoding: [0x41,0x83,0x48,0x21]
+  mtthi $3, $ac3         # CHECK: mttr  $3, $13, 1, 1, 0        # encoding: [0x41,0x83,0x68,0x21]
+  mttacx $3              # CHECK: mttr  $3, $2, 1, 1, 0         # encoding: [0x41,0x83,0x10,0x21]
+  mttacx $3, $ac0        # CHECK: mttr  $3, $2, 1, 1, 0         # encoding: [0x41,0x83,0x10,0x21]
+  mttacx $3, $ac1        # CHECK: mttr  $3, $6, 1, 1, 0         # encoding: [0x41,0x83,0x30,0x21]
+  mttacx $3, $ac2        # CHECK: mttr  $3, $10, 1, 1, 0        # encoding: [0x41,0x83,0x50,0x21]
+  mttacx $3, $ac3        # CHECK: mttr  $3, $14, 1, 1, 0        # encoding: [0x41,0x83,0x70,0x21]
+  mttdsp $4              # CHECK: mttr  $4, $16, 1, 1, 0        # encoding: [0x41,0x84,0x80,0x21]
+  mttc1 $4, $f5          # CHECK: mttr  $4, $5, 1, 2, 0         # encoding: [0x41,0x84,0x28,0x22]
+  mtthc1 $4, $f5         # CHECK: mttr  $4, $5, 1, 2, 1         # encoding: [0x41,0x84,0x28,0x32]
+  cttc1  $4, $f9         # CHECK: mttr  $4, $9, 1, 3, 0         # encoding: [0x41,0x84,0x48,0x23]

Added: llvm/trunk/test/MC/Mips/mt/mftr-mttr-reserved-valid.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Mips/mt/mftr-mttr-reserved-valid.s?rev=318389&view=auto
==============================================================================
--- llvm/trunk/test/MC/Mips/mt/mftr-mttr-reserved-valid.s (added)
+++ llvm/trunk/test/MC/Mips/mt/mftr-mttr-reserved-valid.s Thu Nov 16 02:50:44 2017
@@ -0,0 +1,8 @@
+# RUN: llvm-mc -arch=mips -mcpu=mips32r2 -mattr=+mt -show-encoding < %s | FileCheck %s
+
+# The selector value and register values here are marked as reserved in the
+# documentation, but GAS accepts them without warning.
+  mftr  $31, $31, 1, 1, 0       # CHECK: mftr  $ra, $ra, 1, 1, 0   # encoding: [0x41,0x1f,0xf8,0x21]
+  mttr  $31, $31, 1, 1, 0       # CHECK: mttr  $ra, $ra, 1, 1, 0   # encoding: [0x41,0x9f,0xf8,0x21]
+  mftr  $31, $13, 1, 6, 0       # CHECK: mftr  $ra, $13, 1, 6, 0   # encoding: [0x41,0x0d,0xf8,0x26]
+  mttr  $31, $13, 1, 6, 0       # CHECK: mttr  $ra, $13, 1, 6, 0   # encoding: [0x41,0x9f,0x68,0x26]




More information about the llvm-commits mailing list