summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/t-fpending.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/t-fpending.c b/lib/t-fpending.c
new file mode 100644
index 000000000..10335cdd0
--- /dev/null
+++ b/lib/t-fpending.c
@@ -0,0 +1,24 @@
+/* Ensure that __fpending works. */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "__fpending.h"
+
+int
+main ()
+{
+ if (__fpending (stdout) != 0)
+ abort ();
+
+ fputs ("foo", stdout);
+ if (__fpending (stdout) != 3)
+ abort ();
+
+ fflush (stdout);
+ if (__fpending (stdout) != 0)
+ abort ();
+
+ exit (0);
+}