(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
ubsan/
attrib-3.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-fsanitize=undefined" } */
       3  
       4  /* Test that we don't instrument functions marked with
       5     no_sanitize_undefined attribute.  */
       6  
       7  __attribute__((no_sanitize_undefined, returns_nonnull))
       8  char *
       9  foo (char *x)
      10  {
      11    return x;
      12  }
      13  
      14  __attribute__((nonnull)) void bar (char *, int, char *);
      15  
      16  __attribute__((no_sanitize_undefined))
      17  void
      18  baz (char *x, int y, char *z)
      19  {
      20    bar (x, y, z);
      21  }
      22  
      23  /* { dg-final { scan-assembler-not "__ubsan_handle" } } */