IR: Fix an inverted assertion when replacing resolved operands

Add a unit test, since this bug was only exposed by clang tests.  Thanks
to Rafael for tracking this down!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225738 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-01-13 00:10:38 +00:00
parent 7472c76052
commit 4fef722974
2 changed files with 24 additions and 1 deletions

View File

@@ -444,7 +444,7 @@ void UniquableMDNode::resolveAfterOperandChange(Metadata *Old, Metadata *New) {
// Check if an operand was resolved.
if (!isOperandUnresolved(Old))
assert(isOperandUnresolved(New) && "Operand just became unresolved");
assert(!isOperandUnresolved(New) && "Operand just became unresolved");
else if (!isOperandUnresolved(New))
decrementUnresolvedOperandCount();
}