]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/asan/TestCases/Posix/wait.cc
1 // RUN: %clangxx_asan -DWAIT -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_asan -DWAIT -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
4 // RUN: %clangxx_asan -DWAITPID -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
5 // RUN: %clangxx_asan -DWAITPID -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
12 int main(int argc
, char **argv
) {
16 int *status
= x
+ argc
* 3;
20 #elif defined(WAITPID)
21 res
= waitpid(pid
, status
, WNOHANG
);
23 // CHECK: stack-buffer-overflow
24 // CHECK: {{WRITE of size .* at 0x.* thread T0}}
25 // CHECK: {{in .*wait}}
26 // CHECK: {{in main .*wait.cc:}}
27 // CHECK: is located in stack of thread T0 at offset
29 return res
== -1 ? 1 : 0;