]> git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/asan/TestCases/Windows/on_error_callback.cc
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / compiler-rt / test / asan / TestCases / Windows / on_error_callback.cc
1 // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
2
3 // FIXME: merge this with the common on_error_callback test when we can run
4 // common tests on Windows.
5
6 #include <stdio.h>
7 #include <stdlib.h>
8
9 extern "C"
10 void __asan_on_error() {
11 fprintf(stderr, "__asan_on_error called");
12 fflush(0);
13 }
14
15 int main() {
16 char *x = (char*)malloc(10 * sizeof(char));
17 free(x);
18 return x[5];
19 // CHECK: __asan_on_error called
20 }