summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2015-02-16 15:24:20 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2015-02-16 15:24:20 +0000
commite7c7225cf896113b5d98acf2cc27dc5c4c88cca0 (patch)
treef0acdab3e5bce480fa60a95b79fe9773965c9be9
parenta32dbfd28edef3c909856705db8ddc5e3222acdb (diff)
[ASan/Win] Add an OOM test
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229399 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/asan/TestCases/Windows/oom.cc12
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 000000000..b24cddf17
--- /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
+}