brintos

brintos / llvm-project-archived public Read only

0
0
Text · 572 B · 8dee270 Raw
25 lines · cpp
1// MSAN re-execs on unlimited stacks. We use that to verify ReExec() uses the2// right path.3// REQUIRES: shell4// RUN: %clangxx_msan -O0 %s -o %t && ulimit -s unlimited && %run %t | FileCheck %s5 6#include <stdio.h>7 8#if !defined(__GLIBC_PREREQ)9#define __GLIBC_PREREQ(a, b) 010#endif11 12#if __GLIBC_PREREQ(2, 16)13#include <sys/auxv.h>14#endif15 16int main() {17#if __GLIBC_PREREQ(2, 16)18  // Make sure AT_EXECFN didn't get overwritten by re-exec.19  puts(reinterpret_cast<const char *>(getauxval(AT_EXECFN)));20#else21  puts("No getauxval");22#endif23  // CHECK-NOT: /proc/self/exe24}25