tests: add a test for mmap/mprotect/munmap decoding

* tests/mmap.c: New file.
* tests/mmap64.c: New file.
* tests/mmap.test: New test.
* tests/mmap64.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add mmap and mmap64.
(mmap64_CFLAGS): Define.
(TESTS): Add mmap.test and mmap64.test.
* tests/.gitignore: Add mmap and mmap64.
diff --git a/tests/mmap.test b/tests/mmap.test
new file mode 100755
index 0000000..e9c9b3a
--- /dev/null
+++ b/tests/mmap.test
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Check mmap/mprotect/munmap syscalls decoding.
+
+. "${srcdir=.}/init.sh"
+
+syscall=mprotect,munmap
+for n in mmap mmap2 old_mmap; do
+	$STRACE -e$n -h > /dev/null && syscall=$syscall,$n
+done
+
+OUT="$LOG.out"
+
+run_prog > /dev/null
+run_strace -e$syscall $args > "$OUT"
+match_grep "$LOG" "$OUT"
+
+rm -f "$OUT"
+
+exit 0