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

source code of compiler-rt/test/asan/TestCases/Linux/bzero.cpp