1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
llvm-mirror/test/CodeGen/AMDGPU/unknown-processor.ll
Matt Arsenault 28ae99d5d5 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
2016-06-02 18:37:16 +00:00

21 lines
635 B
LLVM

; 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
}