tests: add readdir.test

* tests/readdir.c: New file.
* tests/readdir.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add readdir.
(TESTS): Add readdir.test.
* tests/.gitignore: Add readdir.
diff --git a/tests/readdir.test b/tests/readdir.test
new file mode 100755
index 0000000..9efa18d
--- /dev/null
+++ b/tests/readdir.test
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Check readdir syscall decoding.
+
+. "${srcdir=.}/init.sh"
+
+rm -rf -- "$LOG".dir
+run_prog > /dev/null
+
+OUT="$LOG.out"
+run_strace -a16 -ereaddir $args > "$OUT"
+
+match_diff "$OUT" "$LOG"
+rm -f "$OUT"
+
+exit 0