diff options
Diffstat (limited to 'test/asan/TestCases/Windows/oom.cc')
-rw-r--r-- | test/asan/TestCases/Windows/oom.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/asan/TestCases/Windows/oom.cc b/test/asan/TestCases/Windows/oom.cc new file mode 100644 index 000000000000..b24cddf17a97 --- /dev/null +++ b/test/asan/TestCases/Windows/oom.cc @@ -0,0 +1,12 @@ +// RUN: %clang_cl_asan -O0 %s -Fe%t +// RUN: not %run %t 2>&1 | FileCheck %s + +#include <malloc.h> + +int main() { + while (true) { + void *ptr = malloc(200 * 1024 * 1024); // 200MB + free(ptr); + } +// CHECK: failed to allocate +} |