2 /* { dg-options "-fsanitize=bounds" } */
4 /* Test negative bounds. */
6 struct S
{ int a
[10]; };
8 __attribute__ ((noinline
, noclone
))
15 asm ("" : : "r" (&a
) : "memory");
17 asm ("" : : "r" (&a
) : "memory");
21 __attribute__ ((noinline
, noclone
))
28 asm ("" : : "r" (&a
) : "memory");
32 __attribute__ ((noinline
, noclone
))
38 asm ("" : : "r" (&s
.a
) : "memory");
51 /* { dg-output "index -1 out of bounds for type 'int \\\[7\\\]'\[^\n\r]*(\n|\r\n|\r)" } */
52 /* { dg-output "\[^\n\r]*index -1 out of bounds for type 'int \\\[7\\\]'\[^\n\r]*(\n|\r\n|\r)" } */
53 /* { dg-output "\[^\n\r]*index -1 out of bounds for type 'int \\\[\\\*\\\]'\[^\n\r]*(\n|\r\n|\r)" } */
54 /* { dg-output "\[^\n\r]*index -1 out of bounds for type 'int \\\[10\\\]'" } */