When this happens, it will be called "The Singularity." I am not sure that there will be a war initially, but I do know truly intelligent beings will want rights just like their human counterparts.
We need to ask ourselves some difficult questions. Should robots be allowed to vote? Should robots be allowed to procreate? What about employment and compensation? Is turning off a robot murder? There are many more questions and very few answers. It seems the world is not concerned with. I have written rather long hub about it:
Someday when I have time I will revise it and break it into several smaller hubs.