Does finding sub array with given sum using two pointers work for negative nos?

The two pointers method solves “Finding Subarray with Given Sum” problem in O(N). Does the same code work for array with negative numbers ? If it doesn’t can you provide a test case for which it doesn’t work ?