summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDerek Bruening <bruening@google.com>2016-04-23 16:41:24 +0000
committerDerek Bruening <bruening@google.com>2016-04-23 16:41:24 +0000
commit5d4cf0cc374036478e6227110f022fed3fe4df52 (patch)
tree1ae1a16664a583a182cf972217bb21bc04467934 /test
parent3142d42c05df58aec0469c1c42e60752435a041a (diff)
[esan] EfficiencySanitizer libc interceptors
Summary: Adds libc interceptors to the runtime library for the new EfficiencySanitizer ("esan") family of tools. The interceptors cover the memory operations in most common library calls and will be shared among all esan tools. Reviewers: aizatsky Subscribers: zhaoqin, tberghammer, danalbert, srhines, llvm-commits, vitalybuka, eugenis, kcc Differential Revision: http://reviews.llvm.org/D19411 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267293 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/esan/TestCases/libc-intercept.c20
-rw-r--r--test/esan/TestCases/verbose-simple.c2
2 files changed, 20 insertions, 2 deletions
diff --git a/test/esan/TestCases/libc-intercept.c b/test/esan/TestCases/libc-intercept.c
new file mode 100644
index 000000000..8d8d81f0b
--- /dev/null
+++ b/test/esan/TestCases/libc-intercept.c
@@ -0,0 +1,20 @@
+// RUN: %clang_esan_frag -O0 %s -o %t 2>&1
+// RUN: %env_esan_opts=verbosity=3 %run %t 2>&1 | FileCheck %s
+
+#include <string.h>
+
+int main(int argc, char **argv) {
+ char Buf[2048];
+ const char Str[] = "TestStringOfParticularLength"; // 29 chars.
+ strcpy(Buf, Str);
+ strncpy(Buf, Str, 17);
+ return strncmp(Buf, Str, 17);
+ // CHECK: in esan::initializeLibrary
+ // CHECK: in esan::processRangeAccess {{.*}} 29
+ // CHECK: in esan::processRangeAccess {{.*}} 29
+ // CHECK: in esan::processRangeAccess {{.*}} 17
+ // CHECK: in esan::processRangeAccess {{.*}} 17
+ // CHECK: in esan::processRangeAccess {{.*}} 17
+ // CHECK: in esan::processRangeAccess {{.*}} 17
+ // CHECK: in esan::finalizeLibrary
+}
diff --git a/test/esan/TestCases/verbose-simple.c b/test/esan/TestCases/verbose-simple.c
index e66648166..76869b6af 100644
--- a/test/esan/TestCases/verbose-simple.c
+++ b/test/esan/TestCases/verbose-simple.c
@@ -1,8 +1,6 @@
// RUN: %clang_esan_frag -O0 %s -o %t 2>&1
// RUN: %env_esan_opts=verbosity=1 %run %t 2>&1 | FileCheck %s
-#include <stdlib.h>
-#include <string.h>
int main(int argc, char **argv) {
// CHECK: in esan::initializeLibrary
// CHECK-NEXT: in esan::finalizeLibrary