[compiler-rt] d0c16a6 - Fix prctl test to execute all test cases if the first condition fails. (#102987)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 14 09:11:55 PDT 2024
Author: Kirill Stoimenov
Date: 2024-08-14T09:11:52-07:00
New Revision: d0c16a614247c36b8b1c8d7bff42d01e7b03ade3
URL: https://github.com/llvm/llvm-project/commit/d0c16a614247c36b8b1c8d7bff42d01e7b03ade3
DIFF: https://github.com/llvm/llvm-project/commit/d0c16a614247c36b8b1c8d7bff42d01e7b03ade3.diff
LOG: Fix prctl test to execute all test cases if the first condition fails. (#102987)
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 d5d81280e0b44c..f33aa2004db79e 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp
@@ -25,20 +25,18 @@
#endif
int main() {
-
int res;
res = prctl(PR_SCHED_CORE, PR_SCHED_CORE_CREATE, 0, 0, 0);
if (res < 0) {
assert(errno == EINVAL || errno == ENODEV);
- return 0;
- }
-
- uint64_t cookie = 0;
- res = prctl(PR_SCHED_CORE, PR_SCHED_CORE_GET, 0, 0, &cookie);
- if (res < 0) {
- assert(errno == EINVAL);
} else {
- assert(cookie != 0);
+ uint64_t cookie = 0;
+ res = prctl(PR_SCHED_CORE, PR_SCHED_CORE_GET, 0, 0, &cookie);
+ if (res < 0) {
+ assert(errno == EINVAL);
+ } else {
+ assert(cookie != 0);
+ }
}
char invname[81], vlname[] = "prctl";
More information about the llvm-commits
mailing list