[libcxxabi] r286337 - [libc++abi] Remove the test for checking using of fallback malloc in case of dynamic memory exhaustion.

Igor Kudrin via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 8 20:14:32 PST 2016


Author: ikudrin
Date: Tue Nov  8 22:14:31 2016
New Revision: 286337

URL: http://llvm.org/viewvc/llvm-project?rev=286337&view=rev
Log:
[libc++abi] Remove the test for checking using of fallback malloc in case of dynamic memory exhaustion.

This test is too fragile and doesn't add significant value. See https://reviews.llvm.org/D26150 for some details.

Removed:
    libcxxabi/trunk/test/test_exception_storage_nodynmem.pass.cpp

Removed: libcxxabi/trunk/test/test_exception_storage_nodynmem.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_exception_storage_nodynmem.pass.cpp?rev=286336&view=auto
==============================================================================
--- libcxxabi/trunk/test/test_exception_storage_nodynmem.pass.cpp (original)
+++ libcxxabi/trunk/test/test_exception_storage_nodynmem.pass.cpp (removed)
@@ -1,40 +0,0 @@
-//===--------------- test_exception_storage_nodynmem.cpp ------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: libcxxabi-no-exceptions
-
-// cxa_exception_storage does not use dynamic memory in the single thread mode.
-// UNSUPPORTED: libcpp-has-no-threads
-
-// Our overwritten calloc() is not compatible with these sanitizers.
-// UNSUPPORTED: msan, tsan
-
-#include <assert.h>
-#include <cstdlib>
-
-static bool OverwrittenCallocCalled = false;
-
-// Override calloc to simulate exhaustion of dynamic memory
-void *calloc(size_t, size_t) {
-    OverwrittenCallocCalled = true;
-    return 0;
-}
-
-int main(int argc, char *argv[]) {
-    // Run the test a couple of times
-    // to ensure that fallback memory doesn't leak.
-    for (int I = 0; I < 1000; ++I)
-        try {
-            throw 42;
-        } catch (...) {
-        }
-
-    assert(OverwrittenCallocCalled);
-    return 0;
-}




More information about the cfe-commits mailing list