The U.S. economy has offered varied evidence of its underlying strength during a week of wild swings in global stock prices and wide anxiety over signs of a slowdown in China.

The Commerce Department said Thursday the nation’s gross domestic product—the government’s broadest measure of economic output—expanded at a 3.7% seasonally adjusted annual rate in the spring, faster than the initial estimate of a 2.3% growth rate. Other recent reports have shown gains in consumer confidence, retail sales and home building.

...