Wal-Mart Stores posted earnings that topped Wall Street expectations and said same-store sales in the U.S. were up.