(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
ubsan/
object-size-9.c
       1  /* { dg-do run } */
       2  /* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
       3  /* { dg-options "-fsanitize=undefined" } */
       4  
       5  struct T { int c; char d[]; };
       6  struct T t __attribute__ ((aligned(4096))) = { 1, "a" };
       7  
       8  int
       9  baz (int i)
      10  {
      11    return t.d[i];
      12  }
      13  
      14  int
      15  main (void)
      16  {
      17    baz (2);
      18    return 0;
      19  }
      20  
      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]*\\^" } */