[compiler-rt] r208643 - Mark ptrace test as Linux-specific
Alexey Samsonov
samsonov at google.com
Mon May 12 17:02:18 PDT 2014
Author: samsonov
Date: Mon May 12 19:02:18 2014
New Revision: 208643
URL: http://llvm.org/viewvc/llvm-project?rev=208643&view=rev
Log:
Mark ptrace test as Linux-specific
Added:
compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/
compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/lit.local.cfg
compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/ptrace.cc
- copied unchanged from r208625, compiler-rt/trunk/test/sanitizer_common/TestCases/ptrace.cc
Removed:
compiler-rt/trunk/test/sanitizer_common/TestCases/ptrace.cc
Added: compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/lit.local.cfg?rev=208643&view=auto
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/lit.local.cfg (added)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/Linux/lit.local.cfg Mon May 12 19:02:18 2014
@@ -0,0 +1,9 @@
+def getRoot(config):
+ if not config.parent:
+ return config
+ return getRoot(config.parent)
+
+root = getRoot(config)
+
+if root.host_os not in ['Linux']:
+ config.unsupported = True
Removed: compiler-rt/trunk/test/sanitizer_common/TestCases/ptrace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/sanitizer_common/TestCases/ptrace.cc?rev=208642&view=auto
==============================================================================
--- compiler-rt/trunk/test/sanitizer_common/TestCases/ptrace.cc (original)
+++ compiler-rt/trunk/test/sanitizer_common/TestCases/ptrace.cc (removed)
@@ -1,43 +0,0 @@
-// RUN: %clangxx -O0 %s -o %t && %run %t
-
-#include <assert.h>
-#include <signal.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;
- res = ptrace(PTRACE_GETREGS, pid, NULL, ®s);
- assert(!res);
- if (regs.rip)
- printf("%zx\n", regs.rip);
-
- user_fpregs_struct fpregs;
- res = ptrace(PTRACE_GETFPREGS, pid, NULL, &fpregs);
- assert(!res);
- if (fpregs.mxcsr)
- printf("%x\n", fpregs.mxcsr);
-
- siginfo_t siginfo;
- res = ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo);
- assert(!res);
- assert(siginfo.si_pid == pid);
-
- ptrace(PTRACE_CONT, pid, NULL, NULL);
-
- wait(NULL);
- }
- return 0;
-}
More information about the llvm-commits
mailing list