That's the problem with Cain's proposal. It's not the constitutionality of singling out a particular religion for a loyalty test. In the worst case, if ruled unconstitutional, that could be overcome by going through the expense of testing all employees regardless of religion.
But how good are the results of a loyalty test given the Muslim practice of Taquiya?