[Feature][T106]ZXW P56U09 code
Only Configure: Yes
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: No
Doc Update: No
Change-Id: I3cbd8b420271eb20c2b40ebe5c78f83059cd42f3
diff --git a/ap/libc/glibc/glibc-2.23/stdio-common/bug1.c b/ap/libc/glibc/glibc-2.23/stdio-common/bug1.c
new file mode 100644
index 0000000..18e7d4c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/stdio-common/bug1.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main (void)
+{
+ char *bp;
+ size_t size;
+ FILE *stream;
+ int lose = 0;
+
+ stream = open_memstream (&bp, &size);
+ fprintf (stream, "hello");
+ fflush (stream);
+ printf ("buf = %s, size = %Zu\n", bp, size);
+ lose |= size != 5;
+ lose |= strncmp (bp, "hello", size);
+ fprintf (stream, ", world");
+ fclose (stream);
+ printf ("buf = %s, size = %Zu\n", bp, size);
+ lose |= size != 12;
+ lose |= strncmp (bp, "hello, world", 12);
+
+ puts (lose ? "Test FAILED!" : "Test succeeded.");
+
+ free (bp);
+
+ return lose;
+}