[compiler-rt] e4085a0 - [sanitizer] Fix prctl unit test on non-SMT systems
Ulrich Weigand via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 21 10:31:53 PDT 2022
Author: Ulrich Weigand
Date: 2022-04-21T19:31:04+02:00
New Revision: e4085a012c04ba9e379c18675815b0f76866107b
URL: https://github.com/llvm/llvm-project/commit/e4085a012c04ba9e379c18675815b0f76866107b
DIFF: https://github.com/llvm/llvm-project/commit/e4085a012c04ba9e379c18675815b0f76866107b.diff
LOG: [sanitizer] Fix prctl unit test on non-SMT systems
On systems where the kernel supports the PR_SCHED_CORE
interface, but there is no SMT, the prctl call will set
errno to ENODEV, which currently causes the test to fail.
Fix by accepting ENODEV in addition to EINVAL.
Added:
Modified:
compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp
Removed:
################################################################################
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp
index 7c0739cee6c2d..a250dd5f8fa8d 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp
@@ -22,7 +22,7 @@ int main() {
int res;
res = prctl(PR_SCHED_CORE, PR_SCHED_CORE_CREATE, 0, 0, 0);
if (res < 0) {
- assert(errno == EINVAL);
+ assert(errno == EINVAL || errno == ENODEV);
return 0;
}
More information about the llvm-commits
mailing list