* asan.c (pass_sanopt::execute): Handle IFN_UBSAN_OBJECT_SIZE.
[official-gcc.git] / gcc / testsuite / gcc.dg / ubsan / object-size-9.c
blobbb9aa1bb1606baf0205438d71101afb272205feb
1 /* { dg-do run } */
2 /* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
3 /* { dg-options "-fsanitize=undefined" } */
5 struct T { int c; char d[]; };
6 struct T t = { 1, "a" };
8 int
9 baz (int i)
11 return t.d[i];
14 int
15 main (void)
17 baz (2);
18 return 0;
21 /* { dg-output "load of address \[^\n\r]* with insufficient space for an object of type 'char'\[^\n\r]*(\n|\r\n|\r)" } */
22 /* { dg-output "\[^\n\r]*note: pointer points here\[^\n\r]*(\n|\r\n|\r)" } */
23 /* { dg-output "\[^\n\r]*\[^\n\r]*(\n|\r\n|\r)" } */
24 /* { dg-output "\[^\n\r]*\\^\[^\n\r]*(\n|\r\n|\r)" } */