summaryrefslogtreecommitdiffstats
path: root/llvm/test/Verifier
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-01-22 18:53:41 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-01-22 18:53:41 +0000
commita7cd83bc88b0a8cbd07b3dbe078e11a0a4e9e442 (patch)
treeb20ce4c56cdefb23e1667c8ca7e0f161dee3da36 /llvm/test/Verifier
parent4063cfc7451fb02b52b27e6298703743c7661cdd (diff)
downloadbcm5719-llvm-a7cd83bc88b0a8cbd07b3dbe078e11a0a4e9e442.tar.gz
bcm5719-llvm-a7cd83bc88b0a8cbd07b3dbe078e11a0a4e9e442.zip
GlobalISel: Disallow vectors for G_CONSTANT/G_FCONSTANT
llvm-svn: 351853
Diffstat (limited to 'llvm/test/Verifier')
-rw-r--r--llvm/test/Verifier/test_g_constant.mir18
-rw-r--r--llvm/test/Verifier/test_g_fconstant.mir15
2 files changed, 33 insertions, 0 deletions
diff --git a/llvm/test/Verifier/test_g_constant.mir b/llvm/test/Verifier/test_g_constant.mir
new file mode 100644
index 00000000000..2fa8d03505c
--- /dev/null
+++ b/llvm/test/Verifier/test_g_constant.mir
@@ -0,0 +1,18 @@
+#RUN: not llc -o - -global-isel -run-pass=none -verify-machineinstrs %s 2>&1 | FileCheck %s
+# REQUIRES: global-isel, aarch64-registered-target
+
+---
+name: test_constant
+legalized: true
+regBankSelected: false
+selected: false
+tracksRegLiveness: true
+liveins:
+body: |
+ bb.0:
+ ; CHECK: Bad machine code: Instruction cannot use a vector result type
+ %0:_(<2 x s32>) = G_CONSTANT i32 0
+
+ ; CHECK: Bad machine code: Too few operands
+ %1:_(s32) = G_CONSTANT
+...
diff --git a/llvm/test/Verifier/test_g_fconstant.mir b/llvm/test/Verifier/test_g_fconstant.mir
new file mode 100644
index 00000000000..fecc47de5be
--- /dev/null
+++ b/llvm/test/Verifier/test_g_fconstant.mir
@@ -0,0 +1,15 @@
+#RUN: not llc -o - -global-isel -run-pass=none -verify-machineinstrs %s 2>&1 | FileCheck %s
+# REQUIRES: global-isel, aarch64-registered-target
+
+---
+name: test_fconstant_vector
+legalized: true
+regBankSelected: false
+selected: false
+tracksRegLiveness: true
+liveins:
+body: |
+ bb.0:
+ ; CHECK: Bad machine code: Instruction cannot use a vector result type
+ %0:_(<2 x s32>) = G_FCONSTANT float 0.0
+...
OpenPOWER on IntegriCloud