aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/MachineVerifier
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2021-12-16 09:52:48 +0000
committerJay Foad <jay.foad@amd.com>2021-12-21 11:59:33 +0000
commit17006033f9c763b80b1f59cb015cdbe934268b70 (patch)
tree6aa44700249fcdfd023ca422a43347415008edfc /llvm/test/MachineVerifier
parent0caf8a3daf16bec0014535ddf8b402931a6a6917 (diff)
downloadllvm-17006033f9c763b80b1f59cb015cdbe934268b70.zip
llvm-17006033f9c763b80b1f59cb015cdbe934268b70.tar.gz
llvm-17006033f9c763b80b1f59cb015cdbe934268b70.tar.bz2
[GlobalISel] Verify operand types for G_SHL, G_LSHR, G_ASHR
Differential Revision: https://reviews.llvm.org/D115868
Diffstat (limited to 'llvm/test/MachineVerifier')
-rw-r--r--llvm/test/MachineVerifier/test_g_rotr_rotl.mir2
-rw-r--r--llvm/test/MachineVerifier/test_g_shift.mir21
2 files changed, 22 insertions, 1 deletions
diff --git a/llvm/test/MachineVerifier/test_g_rotr_rotl.mir b/llvm/test/MachineVerifier/test_g_rotr_rotl.mir
index 0d54566..e1e66f8 100644
--- a/llvm/test/MachineVerifier/test_g_rotr_rotl.mir
+++ b/llvm/test/MachineVerifier/test_g_rotr_rotl.mir
@@ -7,7 +7,7 @@ body: |
%src:_(<2 x s64>) = G_IMPLICIT_DEF
%amt:_(s64) = G_IMPLICIT_DEF
- ; CHECK: Rotate requires operands to be either all scalars or all vectors
+ ; CHECK: Shifts and rotates require operands to be either all scalars or all vectors
%rotr:_(<2 x s64>) = G_ROTR %src, %amt
...
diff --git a/llvm/test/MachineVerifier/test_g_shift.mir b/llvm/test/MachineVerifier/test_g_shift.mir
new file mode 100644
index 0000000..9ab904b
--- /dev/null
+++ b/llvm/test/MachineVerifier/test_g_shift.mir
@@ -0,0 +1,21 @@
+# RUN: not --crash llc -march=arm64 -verify-machineinstrs -run-pass none -o /dev/null %s 2>&1 | FileCheck %s
+# REQUIRES: aarch64-registered-target
+
+---
+name: test_shift
+body: |
+ bb.0:
+ %s32:_(s32) = G_IMPLICIT_DEF
+ %v2s32:_(<2 x s32>) = G_IMPLICIT_DEF
+ %s64:_(s64) = G_IMPLICIT_DEF
+ %v2s64:_(<2 x s64>) = G_IMPLICIT_DEF
+
+ ; CHECK: Shifts and rotates require operands to be either all scalars or all vectors
+ %shl:_(<2 x s64>) = G_SHL %v2s64, %s64
+
+ ; CHECK: Shifts and rotates require operands to be either all scalars or all vectors
+ %lshr:_(s32) = G_LSHR %s32, %v2s32
+
+ ; CHECK: Shifts and rotates require operands to be either all scalars or all vectors
+ %ashr:_(<2 x s32>) = G_ASHR %v2s32, %s64
+...