* asan.c (pass_sanopt::execute): Handle IFN_UBSAN_OBJECT_SIZE.
[official-gcc.git] / gcc / testsuite / c-c++-common / ubsan / object-size-7.c
blobf5b26e50c8a074d79f9581040353789ad0c18f21
1 /* { dg-do run } */
2 /* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
3 /* { dg-options "-fsanitize=object-size" } */
5 #define N 20
7 struct S { int a; };
9 __attribute__((noinline, noclone)) struct S
10 f1 (int i)
12 struct S a[N];
13 struct S *p = a;
14 struct S s;
15 s = p[i];
16 return s;
19 int
20 main ()
22 f1 (N);
23 return 0;
26 /* { dg-output "load of address \[^\n\r]* with insufficient space for an object of type\[^\n\r]*(\n|\r\n|\r)" } */
27 /* { dg-output "\[^\n\r]*note: pointer points here\[^\n\r]*(\n|\r\n|\r)" } */
28 /* { dg-output "\[^\n\r]*\[^\n\r]*(\n|\r\n|\r)" } */
29 /* { dg-output "\[^\n\r]*\\^\[^\n\r]*(\n|\r\n|\r)" } */