about summary refs log tree commit diff
path: root/stdio-common/scanf7.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/scanf7.c')
-rw-r--r--stdio-common/scanf7.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/stdio-common/scanf7.c b/stdio-common/scanf7.c
new file mode 100644
index 0000000000..386dac4d06
--- /dev/null
+++ b/stdio-common/scanf7.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+main ()
+{
+  long long int n;
+  int ret;
+
+  n = -1;
+  ret = sscanf ("1000", "%lld", &n);
+  printf ("%%lld: ret: %d, n: %Ld, c: %c\n", ret, n);
+  if (ret != 1 || n != 1000L)
+    abort ();
+
+  n = -2;
+  ret = sscanf ("1000", "%llld", &n);
+  printf ("%%llld: ret: %d, n: %Ld\n", ret, n);
+  if (ret != 0 || n >= 0L)
+    abort ();
+
+  return 0;
+}