(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
asan/
no-redundant-instrumentation-11.c
       1  /* { dg-options "-fdump-tree-sanopt" } */
       2  /* { dg-do compile } */
       3  /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
       4  
       5  extern __UINT32_TYPE__ a;
       6  
       7  void
       8  foo ()
       9  {
      10    /* Instrument a with access size 5.  */
      11    int d = __builtin_memcmp (&a, "12345", 4);
      12    /* This should not generate a __builtin___asan_report_store4 because
      13       the reference to a has been already instrumented above with access
      14       size 5.  */
      15    a = 1;
      16  }
      17  
      18  /* { dg-final { scan-tree-dump-not "& 7" "sanopt" } } */
      19  /* { dg-final { scan-tree-dump-not "__builtin___asan_report_store" "sanopt" } } */