Under the Drug-free Workplace Act of 1988, workers at any company that receives a federal contract of $100,000 or more are prohibited from using or distributing drugs in the workplace, and the firm must have a drug-free workplace policy. Elon himself is subject to drug tests by the federal goverment
I'm curious how well this is actually enforced. I would imagine a lot of big tech companies have $100k government contracts: Google, Microsoft, etc. Pretty sure employees of either company are not drug tested (and a large number of them would fail a test if it were required). I'm not sure what "drug-free workplace policy" means, while I was at Google I don't recall ever hearing "don't do drugs".
On the other hand, I met a person recently who works for Lockheed and I'm pretty sure he was regularly (or randomly) tested at his workplace.