crashers at the moment (and coincidentally this case was causing a crash).
llvm-svn: 161520
SourceLocation AsmLoc,
ArrayRef<Token> AsmToks,
const TargetInfo &TI) {
+ if (!AsmToks.size())
+ return "";
+
std::string Res;
IdentifierInfo *II = AsmToks[0].getIdentifierInfo();
Res = II->getName().str();
static std::string buildMSAsmString(Sema &SemaRef,
ArrayRef<Token> AsmToks,
ArrayRef<unsigned> LineEnds) {
+ if (!AsmToks.size())
+ return "";
+
// Collect the tokens into a string
SmallString<512> Asm;
SmallString<512> TokenBuf;
--- /dev/null
+// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -O0 -fms-extensions -w -emit-llvm -o - | FileCheck %s
+
+void t1() {
+// CHECK: @t1
+// CHECK: ret void
+ __asm {}
+}