tests: add tests for ipc syscalls decoding

* tests/ipc_msg.c: New file.
* tests/ipc_sem.c: Likewise.
* tests/ipc_shm.c: Likewise.
* tests/ipc_msg.test: New test.
* tests/ipc_sem.test: Likewise.
* tests/ipc_shm.test: Likewise.
* tests/Makefile.am (check_PROGRAMS): Add ipc_msg, ipc_sem, and ipc_shm.
(TESTS): Add ipc_msg.test, ipc_sem.test, and ipc_shm.test.
* tests/.gitignore: Add ipc_msg, ipc_sem, and ipc_shm.
diff --git a/tests/ipc_msg.c b/tests/ipc_msg.c
new file mode 100644
index 0000000..4888d3a
--- /dev/null
+++ b/tests/ipc_msg.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+#include <sys/msg.h>
+
+int
+main(void)
+{
+	int id = msgget(IPC_PRIVATE, 0600);
+	if (id < 0)
+		return 77;
+	printf("msgget\\(IPC_PRIVATE, 0600\\) += %d\n", id);
+
+	int rc = 1;
+
+	struct msqid_ds ds;
+	int max = msgctl(0, MSG_INFO, &ds);
+	if (max < 0)
+		goto fail;
+	printf("msgctl\\(0, MSG_INFO, %p\\) += %d\n", &ds, max);
+
+	if (msgctl(id, MSG_STAT, &ds) != id)
+		goto fail;
+	printf("msgctl\\(%d, MSG_STAT, %p\\) += %d\n", id, &ds, id);
+
+	rc = 0;
+
+fail:
+	if (msgctl(id, IPC_RMID, 0) < 0)
+		return 1;
+	printf("msgctl\\(%d, IPC_RMID, 0\\) += 0\n", id);
+	return rc;
+}