(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
pr54486.c
       1  /* PR middle-end/54486 */
       2  /* { dg-do compile } */
       3  /* { dg-options "-Wformat" } */
       4  /* { dg-skip-if "no POSIX printf" { *-*-mingw* } } */
       5  
       6  #ifdef __cplusplus
       7  extern "C" {
       8  #endif
       9  typedef __SIZE_TYPE__ size_t;
      10  extern int printf (const char *, ...);
      11  extern size_t strspn (const char *, const char *);
      12  extern size_t strcspn (const char *, const char *);
      13  extern size_t strlen (const char *);
      14  #ifdef __cplusplus
      15  }
      16  #endif
      17  
      18  void
      19  foo (void)
      20  {
      21    printf ("%zu\n", strspn ("abc", "abcdefg"));
      22    printf ("%zu\n", (size_t) strspn ("abc", "abcdefg"));
      23    printf ("%zu\n", __builtin_strspn ("abc", "abcdefg"));
      24    printf ("%zu\n", (size_t) __builtin_strspn ("abc", "abcdefg"));
      25    printf ("%zu\n", strcspn ("abc", "abcdefg"));
      26    printf ("%zu\n", (size_t) strcspn ("abc", "abcdefg"));
      27    printf ("%zu\n", __builtin_strcspn ("abc", "abcdefg"));
      28    printf ("%zu\n", (size_t) __builtin_strcspn ("abc", "abcdefg"));
      29    printf ("%zu\n", strlen ("abc"));
      30    printf ("%zu\n", (size_t) strlen ("abc"));
      31    printf ("%zu\n", __builtin_strlen ("abc"));
      32    printf ("%zu\n", (size_t) __builtin_strlen ("abc"));
      33  }