McIlroy survives tests, claims Open crown