[compiler-rt] r229399 - [ASan/Win] Add an OOM test

Timur Iskhodzhanov timurrrr at google.com
Mon Feb 16 07:24:20 PST 2015


Author: timurrrr
Date: Mon Feb 16 09:24:20 2015
New Revision: 229399

URL: http://llvm.org/viewvc/llvm-project?rev=229399&view=rev
Log:
[ASan/Win] Add an OOM test

Added:
    compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc

Added: compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc?rev=229399&view=auto
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc (added)
+++ compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc Mon Feb 16 09:24:20 2015
@@ -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
+}





More information about the llvm-commits mailing list