1 /* PR tree-optimization/86114 - ICE in gimple_fold_builtin_strlen with
2 an invalid call to strnlen
4 { dg-options "-O2" } */
6 typedef __SIZE_TYPE__
size_t;
8 extern char* strcmp (const char*, const char*);
9 extern char* strncmp (const char*, const char*, size_t);
10 extern char* strlen (const char*);
11 extern char* strnlen (const char*, size_t);
12 extern char* strcspn (const char*, const char*);
13 extern char* strspn (const char*, const char*);
14 extern char* strxfrm (const char*, const char*, size_t);
18 void test_array (const char *s
)
23 q
[1] = strncmp (a
, s
, 7);
25 q
[3] = strnlen (a
, 7);
26 q
[4] = strcspn (a
, s
);
28 q
[6] = strxfrm (a
, s
, 7);
31 void test_pointer (const char *s
, const char *t
)
34 q
[1] = strncmp (s
, t
, 7);
36 q
[3] = strnlen (s
, 7);
37 q
[4] = strcspn (s
, t
);
39 q
[6] = strxfrm (s
, s
, 7);
42 /* { dg-prune-output "-Wbuiltin-declaration-mismatch" } */