brintos

brintos / llvm-project-archived public Read only

0
0
Text · 454 B · 9b56471 Raw
19 lines · cpp
1// RUN: %clangxx -O0 %s -o %t && %run %t2// UNSUPPORTED: lsan,ubsan3 4#include <assert.h>5#include <sys/time.h>6#include <sys/resource.h>7 8int main() {9  struct rlimit lim_core;10  getrlimit(RLIMIT_CORE, &lim_core);11  void *p;12  if (sizeof(p) == 8) {13    // rlim_cur will be set to zero or one depending on the target OS and14    // initial core limits. See comments in DisableCoreDumperIfNecessary().15    assert(lim_core.rlim_cur <= 1u);16  }17  return 0;18}19