A Warped Product Splitting Theorem