diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-07 19:55:37 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-07 19:55:37 +0000 |
commit | ca9211ecdede9bdedb812b2243a4abdb8dacd1b9 (patch) | |
tree | 9b19e801150082c33e9152275829a6ce90614b55 /lib/asan/lit_tests/TestCases/Linux/ptrace.cc | |
parent | 8ef50bf3d1c287b5013c3168de77a462dfce3495 (diff) |
Notes
Diffstat (limited to 'lib/asan/lit_tests/TestCases/Linux/ptrace.cc')
-rw-r--r-- | lib/asan/lit_tests/TestCases/Linux/ptrace.cc | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/lib/asan/lit_tests/TestCases/Linux/ptrace.cc b/lib/asan/lit_tests/TestCases/Linux/ptrace.cc deleted file mode 100644 index 8831b81efa96d..0000000000000 --- a/lib/asan/lit_tests/TestCases/Linux/ptrace.cc +++ /dev/null @@ -1,52 +0,0 @@ -// RUN: %clangxx_asan -O0 %s -o %t && %t -// RUN: %clangxx_asan -DPOSITIVE -O0 %s -o %t && not %t 2>&1 | FileCheck %s - -#include <assert.h> -#include <stdio.h> -#include <sys/ptrace.h> -#include <sys/types.h> -#include <sys/user.h> -#include <sys/wait.h> -#include <unistd.h> - -int main(void) { - pid_t pid; - pid = fork(); - if (pid == 0) { // child - ptrace(PTRACE_TRACEME, 0, NULL, NULL); - execl("/bin/true", "true", NULL); - } else { - wait(NULL); - user_regs_struct regs; - int res; - user_regs_struct * volatile pregs = ®s; -#ifdef POSITIVE - ++pregs; -#endif - res = ptrace(PTRACE_GETREGS, pid, NULL, pregs); - // CHECK: AddressSanitizer: stack-buffer-overflow - // CHECK: {{.*ptrace.cc:}}[[@LINE-2]] - assert(!res); -#if __WORDSIZE == 64 - printf("%zx\n", regs.rip); -#else - printf("%lx\n", regs.eip); -#endif - - user_fpregs_struct fpregs; - res = ptrace(PTRACE_GETFPREGS, pid, NULL, &fpregs); - assert(!res); - printf("%lx\n", (unsigned long)fpregs.cwd); - -#if __WORDSIZE == 32 - user_fpxregs_struct fpxregs; - res = ptrace(PTRACE_GETFPXREGS, pid, NULL, &fpxregs); - assert(!res); - printf("%lx\n", (unsigned long)fpxregs.mxcsr); -#endif - - ptrace(PTRACE_CONT, pid, NULL, NULL); - wait(NULL); - } - return 0; -} |