Index: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp =================================================================== --- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -824,9 +824,6 @@ if (CurrentFnSym->isVariable()) report_fatal_error("'" + Twine(CurrentFnSym->getName()) + "' is a protected alias"); - if (CurrentFnSym->isDefined()) - report_fatal_error("'" + Twine(CurrentFnSym->getName()) + - "' label emitted multiple times to assembly file"); OutStreamer->emitLabel(CurrentFnSym); Index: llvm/lib/MC/MCStreamer.cpp =================================================================== --- llvm/lib/MC/MCStreamer.cpp +++ llvm/lib/MC/MCStreamer.cpp @@ -415,7 +415,8 @@ Symbol->redefineIfPossible(); if (!Symbol->isUndefined() || Symbol->isVariable()) - return getContext().reportError(Loc, "invalid symbol redefinition"); + return getContext().reportError(Loc, "symbol '" + Twine(Symbol->getName()) + + "' is already defined"); assert(!Symbol->isVariable() && "Cannot emit a variable symbol!"); assert(getCurrentSectionOnly() && "Cannot emit before setting section!"); Index: llvm/test/CodeGen/X86/equiv_with_vardef.ll =================================================================== --- llvm/test/CodeGen/X86/equiv_with_vardef.ll +++ llvm/test/CodeGen/X86/equiv_with_vardef.ll @@ -6,4 +6,4 @@ @var = global i32 0 ; CHECK: :0: error: symbol 'var' is already defined -; CHECK: :0: error: invalid symbol redefinition +; CHECK: :0: error: symbol 'var' is already defined Index: llvm/test/CodeGen/X86/label-redefinition.ll =================================================================== --- llvm/test/CodeGen/X86/label-redefinition.ll +++ llvm/test/CodeGen/X86/label-redefinition.ll @@ -1,5 +1,5 @@ ; PR7054 -; RUN: not --crash llc %s -o - 2>&1 | grep "'_foo' label emitted multiple times to assembly" +; RUN: not llc %s -o - 2>&1 | FileCheck %s target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" target triple = "i386-apple-darwin10.0.0" @@ -7,6 +7,7 @@ unreachable } +; CHECK: :0: error: symbol '_foo' is already defined define i32 @foo() { entry: unreachable Index: llvm/test/CodeGen/X86/symbol-redefinition.ll =================================================================== --- /dev/null +++ llvm/test/CodeGen/X86/symbol-redefinition.ll @@ -0,0 +1,9 @@ +; RUN: not llc -mtriple=x86_64-unknown-unknown %s -o - 2>&1 | FileCheck %s + +; CHECK: :0: error: symbol 'fn' is already defined +define void @fn() section "fn" { + ret void +} + +; CHECK: :0: error: symbol 'var' is already defined +@var = global i32 0, section "var", align 4 Index: llvm/test/CodeGen/XCore/section-name.ll =================================================================== --- llvm/test/CodeGen/XCore/section-name.ll +++ llvm/test/CodeGen/XCore/section-name.ll @@ -6,4 +6,4 @@ ret void } -; CHECK: :0: error: invalid symbol redefinition +; CHECK: :0: error: symbol '.dp.bss' is already defined Index: llvm/test/MC/ELF/section-sym-err.s =================================================================== --- llvm/test/MC/ELF/section-sym-err.s +++ llvm/test/MC/ELF/section-sym-err.s @@ -3,4 +3,4 @@ .section foo foo: -// CHECK: error: invalid symbol redefinition +// CHECK: error: symbol 'foo' is already defined