summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AMDGPU/unknown-processor.ll
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-06-02 18:37:16 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-06-02 18:37:16 +0000
commit8e00194be8cd1c20ee625b0adcb4fe5981301118 (patch)
tree6784ab16543e60cb32f9fcc328d0da240d3c8ebb /llvm/test/CodeGen/AMDGPU/unknown-processor.ll
parent048155c399a97c31b1b1bf1f99ed12f30dd9c441 (diff)
downloadbcm5719-llvm-8e00194be8cd1c20ee625b0adcb4fe5981301118.tar.gz
bcm5719-llvm-8e00194be8cd1c20ee625b0adcb4fe5981301118.zip
AMDGPU: Fix crashes on unknown processor name
If the processor name failed to parse for amdgcn, the resulting output would have R600 ISA in it. If the processor name was missing or invalid for R600, the wavefront size would not be set and there would be crashes from missing itinerary data. Fixes crashes in future commit caused by dividing by the unset/0 wavefront size. llvm-svn: 271561
Diffstat (limited to 'llvm/test/CodeGen/AMDGPU/unknown-processor.ll')
-rw-r--r--llvm/test/CodeGen/AMDGPU/unknown-processor.ll20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/unknown-processor.ll b/llvm/test/CodeGen/AMDGPU/unknown-processor.ll
new file mode 100644
index 00000000000..941f4c601e3
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/unknown-processor.ll
@@ -0,0 +1,20 @@
+; RUN: llc -march=amdgcn -mcpu=unknown < %s 2>&1 | FileCheck -check-prefix=ERROR -check-prefix=GCN %s
+; RUN: llc -march=r600 -mcpu=unknown < %s 2>&1 | FileCheck -check-prefix=ERROR -check-prefix=R600 %s
+
+; Should not crash when the processor is not recognized and the
+; wavefront size feature not set.
+
+; Should also not have fragments of r600 and gcn isa mixed.
+
+; ERROR: 'unknown' is not a recognized processor for this target (ignoring processor)
+
+; GCN-NOT: MOV
+; GCN: buffer_store_dword
+; GCN: ScratchSize: 8{{$}}
+
+; R600: MOV
+define void @foo() {
+ %alloca = alloca i32, align 4
+ store volatile i32 0, i32* %alloca
+ ret void
+}
OpenPOWER on IntegriCloud