tests: add symlink.test
* tests/symlink.c: New file.
* tests/symlink.test: New test.
* tests/.gitignore: Add symlink.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add symlink.test.
diff --git a/tests/.gitignore b/tests/.gitignore
index b05c68a..ef39fe2 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -199,6 +199,7 @@
stat64
statfs
swap
+symlink
symlinkat
sync_file_range
sync_file_range2
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 92d4310..d23d0d8 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -250,6 +250,7 @@
stat64 \
statfs \
swap \
+ symlink \
symlinkat \
sync_file_range \
sync_file_range2 \
@@ -498,6 +499,7 @@
statfs.test \
sun_path.test \
swap.test \
+ symlink.test \
symlinkat.test \
sync_file_range.test \
sync_file_range2.test \
diff --git a/tests/symlink.c b/tests/symlink.c
new file mode 100644
index 0000000..44c5655
--- /dev/null
+++ b/tests/symlink.c
@@ -0,0 +1,27 @@
+#include "tests.h"
+#include <sys/syscall.h>
+
+#ifdef __NR_symlink
+
+# include <stdio.h>
+# include <unistd.h>
+
+int
+main(void)
+{
+ static const char sample_1[] = "symlink_new";
+ static const char sample_2[] = "symlink";
+
+ long rc = syscall(__NR_symlink, sample_1, sample_2);
+ printf("symlink(\"%s\", \"%s\") = %ld %s (%m)\n",
+ sample_1, sample_2, rc, errno2name());
+
+ puts("+++ exited with 0 +++");
+ return 0;
+}
+
+#else
+
+SKIP_MAIN_UNDEFINED("__NR_symlink")
+
+#endif
diff --git a/tests/symlink.test b/tests/symlink.test
new file mode 100755
index 0000000..79b93ba
--- /dev/null
+++ b/tests/symlink.test
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# Check symlink syscall decoding.
+
+. "${srcdir=.}/init.sh"
+run_strace_match_diff -a34