2 /* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
3 /* { dg-options "-fsanitize=object-size" } */
5 /* Test that we instrument flexible array members. */
7 struct T
{ int l
; int a
[]; };
8 struct U
{ int l
; int a
[0]; };
14 struct T
*t
= (struct T
*) __builtin_calloc (sizeof (struct T
)
18 struct U
*u
= (struct U
*) __builtin_calloc (sizeof (struct U
)
24 /* { dg-output "load of address \[^\n\r]* with insufficient space for an object of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
25 /* { dg-output "\[^\n\r]*note: pointer points here\[^\n\r]*(\n|\r\n|\r)" } */
26 /* { dg-output "\[^\n\r]*\[^\n\r]*(\n|\r\n|\r)" } */
27 /* { dg-output "\[^\n\r]*\\^\[^\n\r]*(\n|\r\n|\r)" } */
28 /* { dg-output "\[^\n\r]*load of address \[^\n\r]* with insufficient space for an object of type 'int'\[^\n\r]*(\n|\r\n|\r)" } */
29 /* { dg-output "\[^\n\r]*note: pointer points here\[^\n\r]*(\n|\r\n|\r)" } */
30 /* { dg-output "\[^\n\r]*\[^\n\r]*(\n|\r\n|\r)" } */
31 /* { dg-output "\[^\n\r]*\\^\[^\n\r]*(\n|\r\n|\r)" } */