Files
clang-p2996/compiler-rt/test/asan/TestCases/Linux/bzero.cpp
Nico Weber 673dc3d4a0 compiler-rt: Rename cc files below test/asan to cpp
See r367803 and similar other changes.

llvm-svn: 367887
2019-08-05 16:48:12 +00:00

16 lines
382 B
C++

// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// REQUIRES: !android
#include <assert.h>
#include <strings.h>
int main(int argc, char *argv[]) {
char buf[100];
// *& to suppress bzero-to-memset optimization.
(*&bzero)(buf, sizeof(buf) + 1);
// CHECK: AddressSanitizer: stack-buffer-overflow
// CHECK-NEXT: WRITE of size 101 at
return 0;
}