diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index d71b1f738bb..c86224b36f8 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -902,9 +902,9 @@ void MCAsmStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line, } if (Isa) - OS << "isa " << Isa; + OS << " isa " << Isa; if (Discriminator) - OS << "discriminator " << Discriminator; + OS << " discriminator " << Discriminator; if (IsVerboseAsm) { OS.PadToColumn(MAI->getCommentColumn()); diff --git a/test/MC/AsmParser/directive_loc.s b/test/MC/AsmParser/directive_loc.s index 700a32ca389..5a24ae97463 100644 --- a/test/MC/AsmParser/directive_loc.s +++ b/test/MC/AsmParser/directive_loc.s @@ -1,9 +1,18 @@ -# RUN: llvm-mc -triple i386-unknown-unknown %s -# FIXME: Actually test the output. +# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s -check-prefix=FILE +# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s -check-prefix=BASIC-LOC-1 +# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s -check-prefix=BASIC-LOC-2 +# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s -check-prefix=DISCRIMINATOR +# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s -check-prefix=ISA .file 1 "hello" +# FILE: .file 1 "hello" .loc 1 .loc 1 2 +# BASIC-LOC-1: .loc 1 2 0 .loc 1 2 3 +# BASIC-LOC-2: .loc 1 2 3 .loc 1 2 discriminator 1 +# DISCRIMINATOR: 1 2 0 discriminator 1 + .loc 1 2 0 isa 3 +# ISA: 1 2 0 isa 3 .loc 1 0