[ASan][Test-Only] Allow read of size 2 in strcmp.c test (#166179)
Occasionally this test fails on Darwin due to `CHECK: READ of size 1`
not matching the actual output `CHECK: READ of size 2`. This can happen
when the memory before the string `s1` happens to match the first
character of `s2`.
This patch allows for `READ of size 2` to pass in order to account for
the above circumstances.
rdar://151317947
GitOrigin-RevId: 85c78274358717e4d5d019a801decba5c1add484
diff --git a/test/asan/TestCases/strcmp.c b/test/asan/TestCases/strcmp.c
index 417bd49..2b31e64 100644
--- a/test/asan/TestCases/strcmp.c
+++ b/test/asan/TestCases/strcmp.c
@@ -14,6 +14,8 @@
assert(strcmp(s1 - 1, s2));
// CHECK: {{.*ERROR: AddressSanitizer: stack-buffer-underflow on address}}
- // CHECK: READ of size 1
+ // Very rarely `s1[-1]` happens to be '1', resulting in `strcmp` needing to
+ // check 2 bytes before failing, rather than 1 - this should still pass
+ // CHECK: READ of size {{[12]}}
return 0;
}