So, I got to the bottom of it, and the problem is that Clang is looking for
a Target-Specific parser, while the target does not exist (since it wasn't
build for it).
599 // Get the target specific parser.
600 std::string Error;
601 const std::string &TT =
602 const llvm::Target *TheTarget(llvm::TargetRegistry::lookupTarget(TT,
604 OwningPtr<llvm::MCAsmInfo> MAI(TheTarget->createMCAsmInfo(TT));
605 OwningPtr<llvm::MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TT));
606 OwningPtr<llvm::MCObjectFileInfo> MOFI(new llvm::MCObjectFileInfo());
608 STI(TheTarget->createMCSubtargetInfo(TT, "", ""));
on line 604 "TheTarget" is NULL.
So, there are two things here, and I'm including cfe-dev for discussion:
1. Any target-specific behaviour should be reported as an error early on
the compilation phase. Still, would be good to put an "user error" in here,
warning that the target was not compiled blah blah.
2. This test should be in a target-specific place, since even if the NULL
pointer is fixed, the test on non-i386 targets will still fail with a
"target not available" error message.
PS: You can reproduce by compiling on any machine but only building the ARM
backend (or possibly any non-i386 backends). This error is not specific to
MS ASM syntax, but was exposed by it.