Index: clang/test/CodeGen/inline-asm-coff.c =================================================================== --- /dev/null +++ clang/test/CodeGen/inline-asm-coff.c @@ -0,0 +1,16 @@ +// RUN: %clang_cl -Z7 -c %s -o %t.obj +// RUN: llvm-readobj -t %t.obj | FileCheck %s +// RUN: %clang_cl -flto=thin -c %s -o %t.thinlto.ll +// RUN: %clang_cl -c %t.thinlto.ll -o %t.thinlto.obj +// RUN: llvm-readobj -t %t.thinlto.obj | FileCheck %s +asm (".text\n" + ".def foo; .scl 3; .type 32; .endef\n" + ".global foo\n" + "foo:\n" + "ret\n" + ); + +// CHECK: Symbol { +// CHECK: Name: foo +// CHECK: StorageClass: +// CHECK-SAME: Static (0x3) Index: llvm/lib/Object/RecordStreamer.h =================================================================== --- llvm/lib/Object/RecordStreamer.h +++ llvm/lib/Object/RecordStreamer.h @@ -55,6 +55,15 @@ unsigned ByteAlignment, SMLoc Loc = SMLoc()) override; void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override; + + // Ignore COFF-specific directives; we do not need any information from them, + // but the default implementation of these methods crashes, so we override + // them with versions that do nothing. + void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {} + void EmitCOFFSymbolStorageClass(int StorageClass) override {} + void EmitCOFFSymbolType(int Type) override {} + void EndCOFFSymbolDef() override {} + /// Record .symver aliases for later processing. void emitELFSymverDirective(StringRef AliasName, const MCSymbol *Aliasee) override;