Index: lib/MC/MCParser/AsmParser.cpp =================================================================== --- lib/MC/MCParser/AsmParser.cpp +++ lib/MC/MCParser/AsmParser.cpp @@ -5035,9 +5035,9 @@ MCSymbol *Sym = getContext().lookupSymbol(Name); if (expect_defined) - TheCondState.CondMet = (Sym && !Sym->isUndefined()); + TheCondState.CondMet = (Sym && !Sym->isUndefined(false)); else - TheCondState.CondMet = (!Sym || Sym->isUndefined()); + TheCondState.CondMet = (!Sym || Sym->isUndefined(false)); TheCondState.Ignore = !TheCondState.CondMet; } Index: test/MC/AsmParser/ifdef.s =================================================================== --- test/MC/AsmParser/ifdef.s +++ test/MC/AsmParser/ifdef.s @@ -27,3 +27,13 @@ .else .byte 1 .endif + +# .ifdef directive does not count as a use, so ensure redefinition is permitted +.set var, 1 +.ifdef var + .set var, 2 +.else + .set var, 3 +.endif +# CHECK: .byte 2 +.byte var Index: test/MC/AsmParser/ifndef.s =================================================================== --- test/MC/AsmParser/ifndef.s +++ test/MC/AsmParser/ifndef.s @@ -27,3 +27,13 @@ .else .byte 0 .endif + +# .ifndef directive does not count as a use, so ensure redefinition is permitted +.set var, 1 +.ifndef var + .set var, 2 +.else + .set var, 3 +.endif +# CHECK: .byte 3 +.byte var