Benchtests: Remove memchr_strnlen
[glibc.git] / string / bug-strspn1.c
blob3bf2a48b4ca4a3d460b5becb65b4e0bf7b7a7e09
1 #undef __USE_STRING_INLINES
2 #define __USE_STRING_INLINES
3 #include <string.h>
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include <libc-diag.h>
8 int
9 main (void)
11 const char *a = "abc";
12 const char *b = a;
14 DIAG_PUSH_NEEDS_COMMENT;
15 /* GCC 9 correctly warns that this call to strspn is useless. That
16 is deliberate; this test is verifying that a side effect in an
17 argument still occurs when the call itself is useless and could
18 be optimized to return a constant. */
19 DIAG_IGNORE_NEEDS_COMMENT (9, "-Wunused-value");
20 strspn (b++, "");
21 DIAG_POP_NEEDS_COMMENT;
22 if (b != a + 1)
23 return 1;
25 return 0;