That's completely untrue. In fact, it's the opposite -- the IRS objects if you pay yourself more than a reasonable salary.
At least prior to the recent corporate tax rate cut, the tax you'd pay on the salary would typically be less than the sum of corporate income tax and tax on the dividend, so people would pay themselves unreasonably large salaries to save on taxes, and the IRS would object to this.
Here's an article that goes into more detail:
https://www.forbes.com/sites/anthonynitti/2016/05/13/reasona...