U.S. stocks rose on Tuesday, with the S&P 500 extending its longest winning run of the year, as investors considered earnings from companies including McDonald's and Netflix along with a roughly $45 billion offer for Allergan.

"We've had some high-profile deals in the health care sector that have folks excited, and we've had some good earnings numbers, which is motivating people to buy stocks," said Alan Skrainka, chief investment officer at Cornerstone Wealth Management.