This test is flaky. Specifically, on some Mac configurations we see the __sanitizer_ptr_cmp as the 0th frame. Let's relax it to not require that f is in frame #0.
61396==ERROR: AddressSanitizer: invalid-pointer-pair: 0x01e00510 0x01e004d0
#0 0x18f5a3 in __sanitizer_ptr_cmp ... libclang_rt.asan_osx_dynamic.dylib+0xaf5a3) #1 0xdd924 in f(char, char*, char*) ... invalid-pointer-pairs.cc:14:14