1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/* PR sanitizer/109050 */ /* { dg-do run } */ /* { dg-options "-fsanitize=bounds -fno-sanitize-recover=all" } */ /* { dg-shouldfail "ubsan" } */ long a; int b; int main () { int c[4] = {0, 1, 2, 3}; a = 0; c[a - 9806816] |= b; } /* { dg-output "index -9806816 out of bounds for type 'int \\\[4\\\]'" } */