Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/c-c++-common/ubsan/object-size-7.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* { dg-do run } */ /* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */ /* { dg-options "-fsanitize=object-size" } */ #define N 20 struct S { int a; }; __attribute__((noinline, noclone)) struct S f1 (int i) { struct S a[N]; struct S *p = a; struct S s; s = p[i]; return s; } int main () { f1 (N); return 0; } /* { dg-output "load of address \[^\n\r]* with insufficient space for an object of type\[^\n\r]*(\n|\r\n|\r)" } */ /* { dg-output "\[^\n\r]*note: pointer points here\[^\n\r]*(\n|\r\n|\r)" } */ /* { dg-output "\[^\n\r]*\[^\n\r]*(\n|\r\n|\r)" } */ /* { dg-output "\[^\n\r]*\\^" } */