Fixes a crash with basically any OpenGL application using the radeonsi
driver.
Patch by: Michel Dänzer
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90176
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 236004
SmallVector<char, 16> CodeBytes;
raw_svector_ostream CodeStream(CodeBytes);
- MCObjectStreamer &ObjStreamer = (MCObjectStreamer &)OutStreamer;
- MCCodeEmitter &InstEmitter = ObjStreamer.getAssembler().getEmitter();
+ MCObjectStreamer *ObjStreamer =
+ static_cast<MCObjectStreamer *>(OutStreamer.get());
+ MCCodeEmitter &InstEmitter = ObjStreamer->getAssembler().getEmitter();
InstEmitter.EncodeInstruction(TmpInst, CodeStream, Fixups,
MF->getSubtarget<MCSubtargetInfo>());
CodeStream.flush();
--- /dev/null
+; RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs -mattr=dumpcode -filetype=obj | FileCheck --check-prefix=SI --check-prefix=FUNC %s
+; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs -mattr=dumpcode -filetype=obj | FileCheck --check-prefix=SI --check-prefix=FUNC %s
+
+; Test for a crash in the custom assembly dump code.
+
+; SI: s_endpgm
+define void @test(i32 addrspace(1)* %out) {
+ store i32 0, i32 addrspace(1)* %out
+ ret void
+}