PR sanitizer/65280
[official-gcc.git] / gcc / testsuite / gcc.dg / ubsan / bounds-2.c
blob3e88035b2069cd4827c9a09f13c5ec0a131f37b3
1 /* PR sanitizer/65280 */
2 /* { dg-do run } */
3 /* { dg-options "-fsanitize=bounds" } */
5 void
6 foo (int n, int (*b)[n])
8 (*b)[n] = 1;
11 int
12 main ()
14 int a[20];
15 foo (3, (int (*)[3]) &a);
18 /* { dg-output "index 3 out of bounds for type 'int \\\[\\\*\\\]'\[^\n\r]*(\n|\r\n|\r)" } */