blob: 0ad83d549af25f53be7860d352b6029db8c0210d [file] [log] [blame]
Stephen Hines2d1fdb22014-05-28 23:58:16 -07001// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
2
Stephen Hines2d1fdb22014-05-28 23:58:16 -07003#include <stdio.h>
4#include <stdlib.h>
5
6extern "C"
7void __asan_on_error() {
8 fprintf(stderr, "__asan_on_error called");
9}
10
11int main() {
12 char *x = (char*)malloc(10 * sizeof(char));
13 free(x);
14 return x[5];
15 // CHECK: __asan_on_error called
16}