Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / FreeBSD / procctl.cpp
bloba5c6a5e6709902187c9ad68108666680626c5cae
1 // RUN: %clangxx %s -o %t && %run %t %p
3 #include <assert.h>
4 #include <errno.h>
5 #include <unistd.h>
6 #include <sys/procctl.h>
8 int main() {
9 struct procctl_reaper_status status = {0};
10 int res, aslr;
11 res = procctl(P_PID, getpid(), PROC_REAP_STATUS, &status);
12 if (res < 0) {
13 assert(errno == EPERM);
14 return 0;
17 assert(status.rs_flags >= REAPER_STATUS_OWNED);
19 res = procctl(P_PID, getpid(), PROC_ASLR_STATUS, &aslr);
20 if (res < 0) {
21 assert(errno == EPERM);
22 return 0;
25 assert(aslr >= PROC_ASLR_FORCE_ENABLE);
27 return 0;