Fixes PR28488.
Reviewers: rnk, majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25834
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285616
91177308-0d34-0410-b5e6-
96231b3b80d8
--- /dev/null
+//RUN: not llvm-mc --disassemble -triple=x86_64 --output-asm-variant=2 %s -o - 2>&1 | FileCheck %s
+
+//CHECK: error: unable to create instruction printer for target triple 'x86_64' with assembly variant 2.
IP = TheTarget->createMCInstPrinter(Triple(TripleName), OutputAsmVariant,
*MAI, *MCII, *MRI);
+ if (!IP) {
+ errs()
+ << "error: unable to create instruction printer for target triple '"
+ << TheTriple.normalize() << "' with assembly variant "
+ << OutputAsmVariant << ".\n";
+ return 1;
+ }
+
// Set the display preference for hex vs. decimal immediates.
IP->setPrintImmHex(PrintImmHex);