Skip to content

Commit d0c16a6

Browse files
authored
Fix prctl test to execute all test cases if the first condition fails. (#102987)
1 parent fdc4955 commit d0c16a6

File tree

1 file changed

+7
-9
lines changed
  • compiler-rt/test/sanitizer_common/TestCases/Linux

1 file changed

+7
-9
lines changed

compiler-rt/test/sanitizer_common/TestCases/Linux/prctl.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,18 @@
2525
#endif
2626

2727
int main() {
28-
2928
int res;
3029
res = prctl(PR_SCHED_CORE, PR_SCHED_CORE_CREATE, 0, 0, 0);
3130
if (res < 0) {
3231
assert(errno == EINVAL || errno == ENODEV);
33-
return 0;
34-
}
35-
36-
uint64_t cookie = 0;
37-
res = prctl(PR_SCHED_CORE, PR_SCHED_CORE_GET, 0, 0, &cookie);
38-
if (res < 0) {
39-
assert(errno == EINVAL);
4032
} else {
41-
assert(cookie != 0);
33+
uint64_t cookie = 0;
34+
res = prctl(PR_SCHED_CORE, PR_SCHED_CORE_GET, 0, 0, &cookie);
35+
if (res < 0) {
36+
assert(errno == EINVAL);
37+
} else {
38+
assert(cookie != 0);
39+
}
4240
}
4341

4442
char invname[81], vlname[] = "prctl";

0 commit comments

Comments
 (0)