aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/MachineVerifier
diff options
context:
space:
mode:
authorJon Roelofs <jonathan_roelofs@apple.com>2021-06-29 17:56:18 -0700
committerJon Roelofs <jonathan_roelofs@apple.com>2021-06-30 12:39:05 -0700
commita64287247633da36b58d65e4c5e248f2b4c6fe61 (patch)
treec7dab054c453be603910b48cd7780e8f0f714b9c /llvm/test/MachineVerifier
parent2eb7bbbe65b6374e6137772f1c2c46e6daa5c33d (diff)
downloadllvm-a64287247633da36b58d65e4c5e248f2b4c6fe61.zip
llvm-a64287247633da36b58d65e4c5e248f2b4c6fe61.tar.gz
llvm-a64287247633da36b58d65e4c5e248f2b4c6fe61.tar.bz2
[GISel] Support llvm.memcpy.inline
Differential revision: https://reviews.llvm.org/D105072
Diffstat (limited to 'llvm/test/MachineVerifier')
-rw-r--r--llvm/test/MachineVerifier/test_g_bzero.mir4
-rw-r--r--llvm/test/MachineVerifier/test_g_memcpy.mir5
-rw-r--r--llvm/test/MachineVerifier/test_g_memcpy_inline.mir49
-rw-r--r--llvm/test/MachineVerifier/test_g_memmove.mir55
4 files changed, 112 insertions, 1 deletions
diff --git a/llvm/test/MachineVerifier/test_g_bzero.mir b/llvm/test/MachineVerifier/test_g_bzero.mir
index 6e02121..c1eb329 100644
--- a/llvm/test/MachineVerifier/test_g_bzero.mir
+++ b/llvm/test/MachineVerifier/test_g_bzero.mir
@@ -27,7 +27,9 @@ body: |
; CHECK: *** Bad machine code: inconsistent bzero address space ***
G_BZERO %ptr, %cst2, 0 :: (store 4, addrspace 1)
- ; CHECK: *** Bad machine code: bzero operand must be a pointer ***
+ ; CHECK: *** Bad machine code: bzero operand must be a pointer ***
G_BZERO %cst1, %cst2, 0 :: (store 4)
+ ; CHECK: *** Bad machine code: 'tail' flag (last operand) must be an immediate 0 or 1 ***
+ G_BZERO %ptr, %cst2, 2 :: (store 4)
...
diff --git a/llvm/test/MachineVerifier/test_g_memcpy.mir b/llvm/test/MachineVerifier/test_g_memcpy.mir
index 6b1584a..54733dd 100644
--- a/llvm/test/MachineVerifier/test_g_memcpy.mir
+++ b/llvm/test/MachineVerifier/test_g_memcpy.mir
@@ -47,4 +47,9 @@ body: |
; CHECK: *** Bad machine code: memory instruction operand must be a pointer ***
G_MEMCPY %0, %2, %2, 0 :: (store 4), (load 4)
+ ; CHECK: *** Bad machine code: 'tail' flag (operand 3) must be an immediate 0 or 1 ***
+ G_MEMCPY %0, %0, %2, %0 :: (store 4), (load 4)
+
+ ; CHECK: *** Bad machine code: 'tail' flag (operand 3) must be an immediate 0 or 1 ***
+ G_MEMCPY %0, %0, %2, 2 :: (store 4), (load 4)
...
diff --git a/llvm/test/MachineVerifier/test_g_memcpy_inline.mir b/llvm/test/MachineVerifier/test_g_memcpy_inline.mir
new file mode 100644
index 0000000..60526fa
--- /dev/null
+++ b/llvm/test/MachineVerifier/test_g_memcpy_inline.mir
@@ -0,0 +1,49 @@
+#RUN: not --crash llc -o - -march=arm64 -run-pass=none -verify-machineinstrs %s 2>&1 | FileCheck %s
+# REQUIRES: aarch64-registered-target
+---
+name: test_memcpy_inline
+legalized: true
+regBankSelected: false
+selected: false
+tracksRegLiveness: true
+liveins:
+body: |
+ bb.0:
+
+ %0:_(p0) = G_CONSTANT i64 0
+ %1:_(p0) = G_CONSTANT i64 4
+ %2:_(s64) = G_CONSTANT i64 4
+
+ ; CHECK: *** Bad machine code: memcpy/memmove must have 2 memory operands ***
+ G_MEMCPY_INLINE %0, %1, %2
+
+ ; CHECK: *** Bad machine code: memcpy/memmove must have 2 memory operands ***
+ G_MEMCPY_INLINE %0, %1, %2 :: (load 4)
+
+ ; CHECK: *** Bad machine code: memcpy/memmove must have 2 memory operands ***
+ G_MEMCPY_INLINE %0, %1, %2 :: (store 4)
+
+ ; CHECK: *** Bad machine code: wrong memory operand types ***
+ G_MEMCPY_INLINE %0, %1, %2 :: (load 4), (store 4)
+
+ ; CHECK: *** Bad machine code: inconsistent memory operand sizes ***
+ G_MEMCPY_INLINE %0, %1, %2 :: (store 8), (load 4)
+
+ ; CHECK: *** Bad machine code: inconsistent memory operand sizes ***
+ G_MEMCPY_INLINE %0, %1, %2 :: (store unknown-size), (load 4)
+
+ ; CHECK: *** Bad machine code: inconsistent memory operand sizes ***
+ G_MEMCPY_INLINE %0, %1, %2 :: (store 8), (load unknown-size)
+
+ ; CHECK: *** Bad machine code: inconsistent store address space ***
+ G_MEMCPY_INLINE %0, %1, %2 :: (store 4, addrspace 1), (load 4)
+
+ ; CHECK: *** Bad machine code: inconsistent load address space ***
+ G_MEMCPY_INLINE %0, %1, %2 :: (store 4), (load 4, addrspace 1)
+
+ ; CHECK: *** Bad machine code: memory instruction operand must be a pointer ***
+ G_MEMCPY_INLINE %2, %0, %2 :: (store 4), (load 4)
+
+ ; CHECK: *** Bad machine code: memory instruction operand must be a pointer ***
+ G_MEMCPY_INLINE %0, %2, %2 :: (store 4), (load 4)
+...
diff --git a/llvm/test/MachineVerifier/test_g_memmove.mir b/llvm/test/MachineVerifier/test_g_memmove.mir
new file mode 100644
index 0000000..209b897
--- /dev/null
+++ b/llvm/test/MachineVerifier/test_g_memmove.mir
@@ -0,0 +1,55 @@
+#RUN: not --crash llc -o - -march=arm64 -run-pass=none -verify-machineinstrs %s 2>&1 | FileCheck %s
+# REQUIRES: aarch64-registered-target
+---
+name: test_memmove
+legalized: true
+regBankSelected: false
+selected: false
+tracksRegLiveness: true
+liveins:
+body: |
+ bb.0:
+
+ %0:_(p0) = G_CONSTANT i64 0
+ %1:_(p0) = G_CONSTANT i64 4
+ %2:_(s64) = G_CONSTANT i64 4
+
+ ; CHECK: *** Bad machine code: memcpy/memmove must have 2 memory operands ***
+ G_MEMMOVE %0, %1, %2, 0
+
+ ; CHECK: *** Bad machine code: memcpy/memmove must have 2 memory operands ***
+ G_MEMMOVE %0, %1, %2, 0 :: (load 4)
+
+ ; CHECK: *** Bad machine code: memcpy/memmove must have 2 memory operands ***
+ G_MEMMOVE %0, %1, %2, 0 :: (store 4)
+
+ ; CHECK: *** Bad machine code: wrong memory operand types ***
+ G_MEMMOVE %0, %1, %2, 0 :: (load 4), (store 4)
+
+ ; CHECK: *** Bad machine code: inconsistent memory operand sizes ***
+ G_MEMMOVE %0, %1, %2, 0 :: (store 8), (load 4)
+
+ ; CHECK: *** Bad machine code: inconsistent memory operand sizes ***
+ G_MEMMOVE %0, %1, %2, 0 :: (store unknown-size), (load 4)
+
+ ; CHECK: *** Bad machine code: inconsistent memory operand sizes ***
+ G_MEMMOVE %0, %1, %2, 0 :: (store 8), (load unknown-size)
+
+ ; CHECK: *** Bad machine code: inconsistent store address space ***
+ G_MEMMOVE %0, %1, %2, 0 :: (store 4, addrspace 1), (load 4)
+
+ ; CHECK: *** Bad machine code: inconsistent load address space ***
+ G_MEMMOVE %0, %1, %2, 0 :: (store 4), (load 4, addrspace 1)
+
+ ; CHECK: *** Bad machine code: memory instruction operand must be a pointer ***
+ G_MEMMOVE %2, %0, %2, 0 :: (store 4), (load 4)
+
+ ; CHECK: *** Bad machine code: memory instruction operand must be a pointer ***
+ G_MEMMOVE %0, %2, %2, 0 :: (store 4), (load 4)
+
+ ; CHECK: *** Bad machine code: 'tail' flag (operand 3) must be an immediate 0 or 1 ***
+ G_MEMMOVE %0, %0, %2, %0 :: (store 4), (load 4)
+
+ ; CHECK: *** Bad machine code: 'tail' flag (operand 3) must be an immediate 0 or 1 ***
+ G_MEMMOVE %0, %0, %2, 2 :: (store 4), (load 4)
+...