The IOC introduced sex testing in 1968, and dropped it after Atlanta 1996. The only competitor exempted from the tests was Princess Anne when she competed in 1976. This is a great article exploring how the idea of a sex test - and indeed the ‘male’ / ‘female’ categories Olympians compete in - can’t always be applied.