diff options
author | David Carlier <devnexen@gmail.com> | 2019-08-28 14:18:05 +0000 |
---|---|---|
committer | David Carlier <devnexen@gmail.com> | 2019-08-28 14:18:05 +0000 |
commit | 72cb9db5c79e19b08e9ba74848d034d887f6c564 (patch) | |
tree | fcc96dc23925ce9a30b6bc01f3c56ac251f4066b | |
parent | 07a5c129c6d721a7f4670dd1f6fd27289217d9b6 (diff) | |
download | bcm5719-llvm-72cb9db5c79e19b08e9ba74848d034d887f6c564.tar.gz bcm5719-llvm-72cb9db5c79e19b08e9ba74848d034d887f6c564.zip |
[XRay] Fixing one test case for FreeBSD
Reviewers: dberris
Reviewed By: dberris
Differential Revision: https://reviews.llvm.org/D66867
llvm-svn: 370209
-rw-r--r-- | compiler-rt/test/xray/TestCases/Posix/fork_basic_logging.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler-rt/test/xray/TestCases/Posix/fork_basic_logging.cpp b/compiler-rt/test/xray/TestCases/Posix/fork_basic_logging.cpp index 3873325ef74..fd8b781b8de 100644 --- a/compiler-rt/test/xray/TestCases/Posix/fork_basic_logging.cpp +++ b/compiler-rt/test/xray/TestCases/Posix/fork_basic_logging.cpp @@ -18,14 +18,24 @@ #include <stdio.h> #include <unistd.h> #include <stdint.h> +#if defined(__linux__) #include <sys/syscall.h> +#elif defined(__FreeBSD__) +#include <sys/thr.h> +#endif //modified from sanitizer static uintptr_t syscall_gettid() { uint64_t retval; +#ifdef __linux__ asm volatile("syscall" : "=a"(retval) : "a"(__NR_gettid) : "rcx", "r11", "memory", "cc"); +#else + long t; + thr_self(&t); + retval = static_cast<uint64_t>(t); +#endif return retval; } |