summaryrefslogtreecommitdiff
path: root/test/sanitizer_common
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2018-03-23 21:44:59 +0000
committerVitaly Buka <vitalybuka@google.com>2018-03-23 21:44:59 +0000
commitf40efdb90fed2c5d01b17677c9603bf5f1d19b60 (patch)
tree66d53656e939e2e807082a7751862e54d36558ed /test/sanitizer_common
parent132d1ff971cc7e7b8930107388f9806bb2feb00e (diff)
FreeBSD sanitizer common, intercept couple of more functions
Summary: Intercepts lstat, acct, access, faccessat and strlcpy/strlcat Patch by David CARLIER Reviewers: visa, vitalybuka Subscribers: krytarowski, fedor.sergeev, srhines, kubamracek, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D44432 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328376 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/sanitizer_common')
-rw-r--r--test/sanitizer_common/TestCases/Posix/access.cc (renamed from test/sanitizer_common/TestCases/NetBSD/access.cc)0
-rw-r--r--test/sanitizer_common/TestCases/Posix/devname.cc (renamed from test/sanitizer_common/TestCases/NetBSD/devname.cc)1
-rw-r--r--test/sanitizer_common/TestCases/Posix/devname_r.cc (renamed from test/sanitizer_common/TestCases/NetBSD/devname_r.cc)3
-rw-r--r--test/sanitizer_common/TestCases/Posix/fgetln.cc (renamed from test/sanitizer_common/TestCases/NetBSD/fgetln.cc)1
-rw-r--r--test/sanitizer_common/TestCases/Posix/getpass.cc8
-rw-r--r--test/sanitizer_common/TestCases/Posix/lstat.cc (renamed from test/sanitizer_common/TestCases/NetBSD/lstat.cc)0
-rw-r--r--test/sanitizer_common/TestCases/Posix/strlcat.cc (renamed from test/sanitizer_common/TestCases/NetBSD/strlcat.cc)2
-rw-r--r--test/sanitizer_common/TestCases/Posix/strlcpy.cc (renamed from test/sanitizer_common/TestCases/NetBSD/strlcpy.cc)2
-rw-r--r--test/sanitizer_common/lit.common.cfg2
9 files changed, 16 insertions, 3 deletions
diff --git a/test/sanitizer_common/TestCases/NetBSD/access.cc b/test/sanitizer_common/TestCases/Posix/access.cc
index 92c2a9fd8..92c2a9fd8 100644
--- a/test/sanitizer_common/TestCases/NetBSD/access.cc
+++ b/test/sanitizer_common/TestCases/Posix/access.cc
diff --git a/test/sanitizer_common/TestCases/NetBSD/devname.cc b/test/sanitizer_common/TestCases/Posix/devname.cc
index 8cde9eb3c..da4bb8853 100644
--- a/test/sanitizer_common/TestCases/NetBSD/devname.cc
+++ b/test/sanitizer_common/TestCases/Posix/devname.cc
@@ -1,4 +1,5 @@
// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: linux, solaris
#include <stdio.h>
#include <stdlib.h>
diff --git a/test/sanitizer_common/TestCases/NetBSD/devname_r.cc b/test/sanitizer_common/TestCases/Posix/devname_r.cc
index ef65dfd93..f7925f555 100644
--- a/test/sanitizer_common/TestCases/NetBSD/devname_r.cc
+++ b/test/sanitizer_common/TestCases/Posix/devname_r.cc
@@ -1,4 +1,5 @@
// RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: linux, solaris
#include <sys/cdefs.h>
#include <sys/stat.h>
@@ -16,7 +17,7 @@ int main(void) {
type = S_ISCHR(st.st_mode) ? S_IFCHR : S_IFBLK;
- if (devname_r(st.st_rdev, type, name, __arraycount(name)))
+ if (devname_r(st.st_rdev, type, name, sizeof(name)))
exit(1);
printf("%s\n", name);
diff --git a/test/sanitizer_common/TestCases/NetBSD/fgetln.cc b/test/sanitizer_common/TestCases/Posix/fgetln.cc
index 2c4f83d46..e98cf449a 100644
--- a/test/sanitizer_common/TestCases/NetBSD/fgetln.cc
+++ b/test/sanitizer_common/TestCases/Posix/fgetln.cc
@@ -1,4 +1,5 @@
// RUN: %clangxx -O0 -g %s -o %t && %run %t
+// UNSUPPORTED: linux
#include <stdio.h>
#include <stdlib.h>
diff --git a/test/sanitizer_common/TestCases/Posix/getpass.cc b/test/sanitizer_common/TestCases/Posix/getpass.cc
index b91a3d7d5..bf198eff9 100644
--- a/test/sanitizer_common/TestCases/Posix/getpass.cc
+++ b/test/sanitizer_common/TestCases/Posix/getpass.cc
@@ -5,13 +5,19 @@
#include <assert.h>
#include <stdio.h>
-#include <unistd.h>
#include <string.h>
#if __linux__
#include <pty.h>
+#elif defined(__FreeBSD__)
+#include <libutil.h>
+#include <pwd.h>
+#include <sys/ioctl.h>
+#include <sys/termios.h>
+#include <sys/types.h>
#else
#include <util.h>
#endif
+#include <unistd.h>
int
main (int argc, char** argv)
diff --git a/test/sanitizer_common/TestCases/NetBSD/lstat.cc b/test/sanitizer_common/TestCases/Posix/lstat.cc
index 37237d821..37237d821 100644
--- a/test/sanitizer_common/TestCases/NetBSD/lstat.cc
+++ b/test/sanitizer_common/TestCases/Posix/lstat.cc
diff --git a/test/sanitizer_common/TestCases/NetBSD/strlcat.cc b/test/sanitizer_common/TestCases/Posix/strlcat.cc
index ea504589e..bdabada76 100644
--- a/test/sanitizer_common/TestCases/NetBSD/strlcat.cc
+++ b/test/sanitizer_common/TestCases/Posix/strlcat.cc
@@ -1,5 +1,7 @@
// RUN: %clangxx -O0 -g %s -o %t && %run %t
+// UNSUPPORTED: linux
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/test/sanitizer_common/TestCases/NetBSD/strlcpy.cc b/test/sanitizer_common/TestCases/Posix/strlcpy.cc
index 996348602..83053911d 100644
--- a/test/sanitizer_common/TestCases/NetBSD/strlcpy.cc
+++ b/test/sanitizer_common/TestCases/Posix/strlcpy.cc
@@ -1,5 +1,7 @@
// RUN: %clangxx -O0 -g %s -o %t && %run %t
+// UNSUPPORTED: linux
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/test/sanitizer_common/lit.common.cfg b/test/sanitizer_common/lit.common.cfg
index 72e3e5e10..0e9183b1b 100644
--- a/test/sanitizer_common/lit.common.cfg
+++ b/test/sanitizer_common/lit.common.cfg
@@ -59,5 +59,5 @@ config.substitutions.append( ('%env_tool_opts=',
config.suffixes = ['.c', '.cc', '.cpp']
-if config.host_os not in ['Linux', 'Darwin', 'NetBSD']:
+if config.host_os not in ['Linux', 'Darwin', 'NetBSD', 'FreeBSD']:
config.unsupported = True