riscv: Fix alignment-ignorant memcpy implementation
[glibc.git] / stdio-common / tst-fgets.c
blob912b7068ebf10cd8a83a6536666131f0b9305297
1 /* Derived from the test case in
2 https://sourceware.org/bugzilla/show_bug.cgi?id=713. */
3 #include <stdio.h>
5 static int
6 do_test (void)
8 FILE *fp = fmemopen ((char *) "hello", 5, "r");
9 char buf[2];
10 char *bp = fgets (buf, sizeof (buf), fp);
11 printf ("fgets: %s\n", bp == buf ? "OK" : "ERROR");
12 int res = bp != buf;
13 bp = fgets_unlocked (buf, sizeof (buf), fp);
14 printf ("fgets_unlocked: %s\n", bp == buf ? "OK" : "ERROR");
15 res |= bp != buf;
16 return res;
19 #define TEST_FUNCTION do_test ()
20 #include "../test-skeleton.c"