Somehow search_n never got tested, so of course it had a bug in it.  This fixes http://llvm.org/bugs/show_bug.cgi?id=15667.