Sometimes an undescended testicle can twist. If he is acting like he is in pain and can't potty, you need to get him to the vet.
Here's some information about chryptorchid. If you scroll down, there is a section on it.
http://www.marvistavet.com/html/body_canine_neuter.html