Index: lib/Target/Mips/AsmParser/MipsAsmParser.cpp =================================================================== --- lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -3585,11 +3585,7 @@ if (Parser.parseExpression(Value)) return reportParseError("expected valid expression after comma"); - // Check if the Name already exists as a symbol. - MCSymbol *Sym = getContext().LookupSymbol(Name); - if (Sym) - return reportParseError("symbol already defined"); - Sym = getContext().GetOrCreateSymbol(Name); + MCSymbol *Sym = getContext().GetOrCreateSymbol(Name); Sym->setVariableValue(Value); return false; Index: test/MC/Mips/set-defined-symbol.s =================================================================== --- /dev/null +++ test/MC/Mips/set-defined-symbol.s @@ -0,0 +1,16 @@ +# RUN: llvm-mc %s -arch=mips -mcpu=mips32 -filetype=obj -o - | \ +# RUN: llvm-objdump -d -r -arch=mips - | FileCheck %s + + .global foo + .weak bar + .set foo, a + .set bar, b +a: + nop +# CHECK-NOT: a: +# CHECK: foo: + +b: + nop +# CHECK-NOT: b: +# CHECK: bar: