(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
Warray-bounds-71.h
       1  /* Verify that -Warray-bounds suppression via #pragma GCC diagnostic
       2     works at any call site in an inlining stack
       3     { dg-do compile }
       4     { dg-options "-O2 -Wall" } */
       5  
       6  int a[4];
       7  
       8  void f1 (int *p, int i)
       9  {
      10  #pragma GCC diagnostic push
      11  #if IGNORE == '1'
      12  #  pragma GCC diagnostic ignored "-Warray-bounds"
      13  #endif
      14    p[i + 1] = 0;
      15  #pragma GCC diagnostic pop
      16  }
      17  
      18  void f2 (int *p, int i)
      19  {
      20  #pragma GCC diagnostic push
      21  #if IGNORE == '2'
      22  #  pragma GCC diagnostic ignored "-Warray-bounds"
      23  #endif
      24    f1 (p + 1, i + 1);
      25  #pragma GCC diagnostic pop
      26  }
      27  
      28  void f3 (int *p, int i)
      29  {
      30  #pragma GCC diagnostic push
      31  #if IGNORE == '3'
      32  #  pragma GCC diagnostic ignored "-Warray-bounds"
      33  #endif
      34    f2 (p + 1, i + 1);
      35  #pragma GCC diagnostic pop
      36  }
      37  
      38  void f4 (void)
      39  {
      40  #pragma GCC diagnostic push
      41  #if IGNORE == '4'
      42  #  pragma GCC diagnostic ignored "-Warray-bounds"
      43  #endif
      44    f3 (a, 1);
      45  #pragma GCC diagnostic pop
      46  }