The S&P 500 exited its longest run in bear-market territory since 1948.