1 // RUN: %clangxx_asan -DWAIT3 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_asan -DWAIT3 -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
4 // RUN: %clangxx_asan -DWAIT3_RUSAGE -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
5 // RUN: %clangxx_asan -DWAIT3_RUSAGE -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
7 // UNSUPPORTED: android,darwin
13 int main(int argc, char **argv) {
17 int *status = x + argc * 3;
20 res = wait3(status, WNOHANG, NULL);
21 #elif defined(WAIT3_RUSAGE)
22 struct rusage *ru = (struct rusage*)(x + argc * 3);
24 res = wait3(&good_status, WNOHANG, ru);
26 // CHECK: stack-buffer-overflow
27 // CHECK: {{WRITE of size .* at 0x.* thread T0}}
28 // CHECK: {{in .*wait}}
29 // CHECK: {{in main .*wait3.cc:}}
30 // CHECK: is located in stack of thread T0 at offset
32 return res == -1 ? 1 : 0;