Carlos Alcaraz will have tests on his ankle after he retires two games into his Rio Open first-round match because of an ankle injury.