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
llvm-svn: 267293
21 lines
741 B
C
21 lines
741 B
C
// 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
|
|
}
|