There is no law prohibiting the use of IQ tests in hiring, but it is considered to be legally indefensible. The colloquial term for legally indefensible is "illegal". The joys of English.
No, it's not. Huge companies that are enormous targets for employment attorneys routinely do IQ testing. The companies that deliver and proctor general cognitive tests for employment have logo crawls, like any other SAAS company. This is just a big Internet myth.
The reason more companies don't IQ test is that it's an ineffective tool for candidate screening. We all intuitively get that as software developers: imagine hiring off an IQ test rather than just having someone write code.
It's not what? Your train of thought seems to have gotten cut off. The huge company story is fun too, but it also seems to have gotten cut off not going anywhere. You're right that the "internet myth" considers it to be legally indefensible, and thus, colloquially, illegal. But we already covered that earlier, so whatever it was you were trying to add on top of that also appears to have gotten cut off as well, unfortunately. The last few days have not been kind to technology!
Regardless, you vastly overestimate how much effort is put into hiring. The large majority of companies would never study the effectiveness of IQ tests to know if they are useful to them or not. Researching what works and what doesn't isn't on their radar and they wouldn't know how to anyway. If they had a gut feeling that an IQ test would be helpful they would try it on that basis, except they wouldn't try it because they've read online that IQ test use is illegal; meaning that it is considered to be legally indefensible.
It's not legally indefensible. It's not illegal in any sense. It's not proscribed. It's presumptively fine in white-collar employment. Large companies screen candidates with general cognitive tests. Well-established companies administer those tests and brag about their large clients. None of this is a secret.
So it's difficult to see how to square what was previously said on this thread, about IQ testing in employment being "illegal" or "legally indefensible". Those are trivially falsifiable claims. Every HR department in the world knows that.
It would appear my message also arrived malformed. What a terrible week for tech!
What I said, quoting from earlier, was "considered to be legally indefensible". Whether or not it is legally defensible is for the courts to decide, but it is clear that it is not considered to be. Unfortunately your full comment didn't arrive, but what we did get was "This is just a big Internet myth" which appears to have you echoing that it is considered to be legally indefensible. You cannot have a "myth" without belief.
Where the law is abundantly clear (YMMV, law is jurisdictional) is that hiring criterion must be related to the job. It asserts that selection tests must be reasonable, bona fide, and tailored to actual job duties. That does not strictly prohibit IQ tests, but there are effectively zero jobs where an IQ test could be seen as reasonable, bona fide, and tailored to the actual job. Whatever exception you can find is just that: an exception.
IQ tests as a hiring practice are most definitely illegal, as the word is colloquially used. That doesn't mean you cannot use them in certain circumstances. Much to the chagrin of programmers, law isn't binary.