(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
pr103961.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2" } */
       3  
       4  extern void abort ();
       5  
       6  extern inline __attribute__ ((__gnu_inline__)) int
       7  sprintf (char *restrict s, const char *restrict fmt, ...)
       8  {
       9    return __builtin___sprintf_chk (s, 1, __builtin_object_size (s, 1),
      10  				  fmt, __builtin_va_arg_pack ());
      11  }
      12  
      13  void
      14  cap_to_text (int c)
      15  {
      16    char buf[1572];
      17    char *p;
      18    int n, t;
      19    p = 20 + buf;
      20    for (t = 8; t--; )
      21      {
      22        for (n = 0; n < c; n++)
      23  	p += sprintf (p, "a,");
      24        p--;
      25        if (__builtin_object_size (p, 1) == 0)
      26  	abort ();
      27      }
      28  }
      29  
      30  /* { dg-final { scan-assembler-not "abort" } } */