IQ testing isn't legally dubious. The idea that it is is an Internet myth. There are a couple household-name corporations that administer general cognitive tests for candidates for some roles.
More companies don't do it because it doesn't work well.