]> git.ipfire.org Git - thirdparty/glibc.git/blame - stdio-common/bug1.c
[powerpc] No need to enter "Ignore Exceptions Mode"
[thirdparty/glibc.git] / stdio-common / bug1.c
CommitLineData
28f540f4 1#include <stdio.h>
d957279c 2#include <stdlib.h>
28f540f4
RM
3#include <string.h>
4
5int
ebbad4cc 6main (void)
28f540f4
RM
7{
8 char *bp;
9 size_t size;
10 FILE *stream;
11 int lose = 0;
12
13 stream = open_memstream (&bp, &size);
14 fprintf (stream, "hello");
15 fflush (stream);
ba9234d9 16 printf ("buf = %s, size = %Zu\n", bp, size);
28f540f4
RM
17 lose |= size != 5;
18 lose |= strncmp (bp, "hello", size);
19 fprintf (stream, ", world");
20 fclose (stream);
ba9234d9 21 printf ("buf = %s, size = %Zu\n", bp, size);
28f540f4
RM
22 lose |= size != 12;
23 lose |= strncmp (bp, "hello, world", 12);
24
25 puts (lose ? "Test FAILED!" : "Test succeeded.");
26
9c6f68cd
UD
27 free (bp);
28
28f540f4
RM
29 return lose;
30}