[compiler-rt] 33af9a3 - [NFC] Move setuid.c test into sanitizer_common
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 8 18:24:13 PST 2021
Author: Vitaly Buka
Date: 2021-11-08T18:24:01-08:00
New Revision: 33af9a31c012c8b30105d010e3fa67a9e3f1b450
URL: https://github.com/llvm/llvm-project/commit/33af9a31c012c8b30105d010e3fa67a9e3f1b450
DIFF: https://github.com/llvm/llvm-project/commit/33af9a31c012c8b30105d010e3fa67a9e3f1b450.diff
LOG: [NFC] Move setuid.c test into sanitizer_common
Added:
compiler-rt/test/sanitizer_common/TestCases/Linux/setuid.c
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
Removed:
compiler-rt/test/tsan/setuid.c
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index fcdb891fd1da2..5d48f33860741 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -1745,7 +1745,8 @@ void *internal_start_thread(void *(*func)(void *arg), void *arg) {
internal_sigfillset(&set);
#if SANITIZER_LINUX && !SANITIZER_ANDROID
// Glibc uses SIGSETXID signal during setuid call. If this signal is blocked
- // on any thread, setuid call hangs (see test/tsan/setuid.c).
+ // on any thread, setuid call hangs.
+ // See test/sanitizer_common/TestCases/Linux/setuid.c.
internal_sigdelset(&set, 33);
#endif
internal_sigprocmask(SIG_SETMASK, &set, &old);
diff --git a/compiler-rt/test/tsan/setuid.c b/compiler-rt/test/sanitizer_common/TestCases/Linux/setuid.c
similarity index 78%
rename from compiler-rt/test/tsan/setuid.c
rename to compiler-rt/test/sanitizer_common/TestCases/Linux/setuid.c
index 2d6b7c866df86..9674ed34138a1 100644
--- a/compiler-rt/test/tsan/setuid.c
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/setuid.c
@@ -1,15 +1,17 @@
-// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
+// RUN: %clang -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
//
// setuid(0) hangs on powerpc64 big endian. When this is fixed remove
// the unsupported flag.
// https://llvm.org/bugs/show_bug.cgi?id=25799
//
// UNSUPPORTED: powerpc64-unknown-linux-gnu
-#include "test.h"
+
+#include <pthread.h>
+#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
-// Setuid call used to hang because the background tsan thread did not handle
+// Setuid call used to hang because the new thread did not handle
// SIGSETXID signal. Note that we don't care whether setuid call succeeds
// or not.
More information about the llvm-commits
mailing list