summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/asan/TestCases/Windows/heapalloc_sanity.cpp
blob: a2ee68621a9e0e630652ccbf94da905af32586cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// RUN: %clang_cl_asan -Od %s -Fe%t
// RUN: %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <windows.h>

int main() {
  char *buffer;
  buffer = (char *)HeapAlloc(GetProcessHeap(), 0, 32),
  buffer[0] = 'a';
  HeapFree(GetProcessHeap(), 0, buffer);
  puts("Okay");
  // CHECK: Okay
}
OpenPOWER on IntegriCloud