[compiler-rt] r323837 - [sanitizer] Move readlinkat.c test from Linux to Posix
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 16:04:10 PST 2018
Author: vitalybuka
Date: Tue Jan 30 16:04:10 2018
New Revision: 323837
URL: http://llvm.org/viewvc/llvm-project?rev=323837&view=rev
Log:
[sanitizer] Move readlinkat.c test from Linux to Posix
Added:
compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/readlinkat.c
Removed:
compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/readlinkat.c
Removed: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/readlinkat.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/readlinkat.c?rev=323836&view=auto
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/readlinkat.c (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/readlinkat.c (removed)
@@ -1,25 +0,0 @@
-// RUN: %clang -O0 %s -o %t && %run %t
-
-#include <assert.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-int main(int argc, char **argv) {
- char symlink_path[NAME_MAX];
- snprintf(symlink_path, sizeof(symlink_path), "%s_%d.symlink", argv[0],
- getpid());
- int res = symlink(argv[0], symlink_path);
- assert(!res);
-
- char readlinkat_path[NAME_MAX];
- int res2 = readlinkat(AT_FDCWD, symlink_path, readlinkat_path,
- sizeof(readlinkat_path));
- assert(res2 >= 0);
- readlinkat_path[res2] = '\0';
- assert(!strcmp(readlinkat_path, argv[0]));
-
- return 0;
-}
Added: compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/readlinkat.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/readlinkat.c?rev=323837&view=auto
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/readlinkat.c (added)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Posix/readlinkat.c Tue Jan 30 16:04:10 2018
@@ -0,0 +1,25 @@
+// RUN: %clang -O0 %s -o %t && %run %t
+
+#include <assert.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+int main(int argc, char **argv) {
+ char symlink_path[NAME_MAX];
+ snprintf(symlink_path, sizeof(symlink_path), "%s_%d.symlink", argv[0],
+ getpid());
+ int res = symlink(argv[0], symlink_path);
+ assert(!res);
+
+ char readlinkat_path[NAME_MAX];
+ int res2 = readlinkat(AT_FDCWD, symlink_path, readlinkat_path,
+ sizeof(readlinkat_path));
+ assert(res2 >= 0);
+ readlinkat_path[res2] = '\0';
+ assert(!strcmp(readlinkat_path, argv[0]));
+
+ return 0;
+}
More information about the llvm-commits
mailing list