]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/msan/Linux/reexec_unlimited_stack.cc
Vendor import of compiler-rt trunk r351319 (just before the release_80
[FreeBSD/FreeBSD.git] / test / msan / Linux / reexec_unlimited_stack.cc
1 // MSAN re-execs on unlimited stacks. We use that to verify ReExec() uses the
2 // right path.
3 // RUN: %clangxx_msan -O0 %s -o %t && ulimit -s unlimited && %run %t | FileCheck %s
4
5 #include <stdio.h>
6
7 #if !defined(__GLIBC_PREREQ)
8 #define __GLIBC_PREREQ(a, b) 0
9 #endif
10
11 #if __GLIBC_PREREQ(2, 16)
12 #include <sys/auxv.h>
13 #endif
14
15 int main() {
16 #if __GLIBC_PREREQ(2, 16)
17   // Make sure AT_EXECFN didn't get overwritten by re-exec.
18   puts(reinterpret_cast<const char *>(getauxval(AT_EXECFN)));
19 #else
20   puts("No getauxval");
21 #endif
22   // CHECK-NOT: /proc/self/exe
23 }