[PR target/115123] Fix testsuite fallout from sinking heuristic change
[official-gcc.git] / gcc / testsuite / gcc.dg / Wstringop-overflow-13.c
blob2c882909e7f81d2e0c5021833fb8a61ab3c2b4b4
1 /* PR middle-end/89957 - ICE calling strnlen with an int128_t bound
2 in a known range
3 PR middle-end/89911 - ICE on a call with no arguments to strnlen
4 declared with no prototype
5 { dg-do compile }
6 { dg-options "-std=gnu17 -O2 -fpermissive -Wall" } */
8 typedef __SIZE_TYPE__ size_t;
10 extern size_t strnlen ();
12 size_t f0 (void)
14 return strnlen (); /* { dg-warning "too few arguments to built-in function 'strnlen'" } */
17 size_t f1 (const char *s)
19 return strnlen (s); /* { dg-warning "too few arguments to built-in function 'strnlen'" } */
22 size_t f2 (const char *s)
24 return strnlen (s, s); /* { dg-warning "\\\[-Wint-conversion]" } */
27 #if __SIZEOF_INT128__ == 16
29 size_t fi128 (const char *s, __int128_t n)
31 if (n < 0)
32 n = 0;
34 /* PR middle-end/89957 */
35 return strnlen (s, n); /* { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" "int128" { target int128 } } */
38 #endif
40 /* { dg-prune-output "\\\[-Wint-conversion]" } */