From 9c5d0ea6784bf08337bd20d44911ebf6bfbd2822 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 13 Mar 2020 13:55:26 -0700 Subject: [PATCH] Revert "Revert "Move more tests to globalMemCounter and reset."" Test regressions not included this time :) This reverts commit 1ed671082ef4b13d44e2c0f42ddedf9d450258a7. --- .../new.delete/new.delete.array/new_array_nothrow.pass.cpp | 1 + .../new.delete.array/new_array_nothrow_replace.pass.cpp | 1 + .../new.delete/new.delete.array/new_array_replace.pass.cpp | 1 + .../new.delete/new.delete.single/new_nothrow_replace.pass.cpp | 1 + .../new.delete/new.delete.single/new_replace.pass.cpp | 1 + .../test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp | 1 + libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp | 1 + .../conversions/conversions.buffer/ctor.pass.cpp | 1 + .../localization/locales/locale/locale.members/combine.pass.cpp | 1 + .../func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp | 1 + .../func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp | 1 + .../func.wrap.func/func.wrap.func.con/F_assign.pass.cpp | 1 + .../func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp | 1 + .../func.wrap.func/func.wrap.func.con/copy_move.pass.cpp | 1 + .../func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp | 1 + .../func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp | 1 + .../util.smartptr.enab/enable_shared_from_this.pass.cpp | 1 + .../util.smartptr.shared.const/pointer_deleter_throw.pass.cpp | 1 + .../util.smartptr.shared.const/pointer_throw.pass.cpp | 1 + 19 files changed, 19 insertions(+) diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp index b4d8aa349860..ce8b18d04364 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow.pass.cpp @@ -36,6 +36,7 @@ struct A int main(int, char**) { + new_handler_called = 0; std::set_new_handler(my_new_handler); #ifndef TEST_HAS_NO_EXCEPTIONS try diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp index 4d90aa9a3fe0..90785d8dc24d 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_nothrow_replace.pass.cpp @@ -45,6 +45,7 @@ struct A int main(int, char**) { + new_called = 0; A *ap = new (std::nothrow) A[3]; DoNotOptimize(ap); assert(ap); diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp index e705fc3b499f..9058171bbdc3 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_array_replace.pass.cpp @@ -46,6 +46,7 @@ struct A int main(int, char**) { + new_called = 0; A *ap = new A[3]; DoNotOptimize(ap); assert(ap); diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp index 1f186d8b3d17..cf6e5f458600 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_nothrow_replace.pass.cpp @@ -45,6 +45,7 @@ struct A int main(int, char**) { + new_called = 0; A *ap = new (std::nothrow) A; DoNotOptimize(ap); assert(ap); diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp index 4854c2fb7761..807d1fd67f5d 100644 --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_replace.pass.cpp @@ -44,6 +44,7 @@ struct A int main(int, char**) { + new_called = 0; A *ap = new A; DoNotOptimize(ap); assert(ap); diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp index bb69ef1d2400..40f8ae299206 100644 --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf16.pass.cpp @@ -28,6 +28,7 @@ int main(int, char**) { + globalMemCounter.reset(); assert(globalMemCounter.checkOutstandingNewEq(0)); { typedef std::codecvt_utf16 C; diff --git a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp index 4fc4201ee178..08f98fa2999a 100644 --- a/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp +++ b/libcxx/test/std/localization/locale.stdcvt/codecvt_utf8.pass.cpp @@ -28,6 +28,7 @@ int main(int, char**) { + globalMemCounter.reset(); assert(globalMemCounter.checkOutstandingNewEq(0)); { typedef std::codecvt_utf8 C; diff --git a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp index f879afb7a2f2..bf6355d17d15 100644 --- a/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp +++ b/libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/ctor.pass.cpp @@ -23,6 +23,7 @@ int main(int, char**) { + globalMemCounter.reset(); typedef std::wbuffer_convert > B; #if TEST_STD_VER > 11 static_assert(!std::is_convertible::value, ""); diff --git a/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp b/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp index 68c0438abb7c..8a908b58271c 100644 --- a/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp +++ b/libcxx/test/std/localization/locales/locale/locale.members/combine.pass.cpp @@ -66,6 +66,7 @@ std::locale::id my_facet::id; int main(int, char**) { { + globalMemCounter.reset(); { std::locale loc; std::locale loc2(loc, new my_facet); diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp index cf3477ff5544..9393da08964d 100644 --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp @@ -59,6 +59,7 @@ int h(int) {return 1;} int main(int, char**) { + globalMemCounter.reset(); assert(globalMemCounter.checkOutstandingNewEq(0)); { std::function f1 = A(1); diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp index 5944f5900ee0..7cb220d993af 100644 --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp @@ -62,6 +62,7 @@ struct LValueCallable { int main(int, char**) { + globalMemCounter.reset(); assert(globalMemCounter.checkOutstandingNewEq(0)); { std::function f = A(); diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp index 26178551edb3..75471326b370 100644 --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp @@ -65,6 +65,7 @@ struct LValueCallable { int main(int, char**) { + globalMemCounter.reset(); assert(globalMemCounter.checkOutstandingNewEq(0)); { std::function f; diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp index d97b699ea96a..05c52a1c2a28 100644 --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp @@ -49,6 +49,7 @@ int g2(int, int) { return 2; } int g3(int, int, int) { return 3; } int main(int, char**) { + globalMemCounter.reset(); assert(globalMemCounter.checkOutstandingNewEq(0)); { std::function f = A(); diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp index b756e7ecef92..1251e62f4bab 100644 --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp @@ -52,6 +52,7 @@ int g(int) {return 0;} int main(int, char**) { + globalMemCounter.reset(); assert(globalMemCounter.checkOutstandingNewEq(0)); { std::function f = A(); diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp index 16d9f05622d3..264b0fe7ca4e 100644 --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp @@ -50,6 +50,7 @@ int g(int) {return 0;} int main(int, char**) { + globalMemCounter.reset(); assert(globalMemCounter.checkOutstandingNewEq(0)); { std::function f = A(); diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp index f034eb71e4d7..eedba02a9c26 100644 --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp @@ -60,6 +60,7 @@ int g2(int, int) { return 2; } int g3(int, int, int) { return 3; } int main(int, char**) { + globalMemCounter.reset(); assert(globalMemCounter.checkOutstandingNewEq(0)); { std::function f1 = A(1); diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp index 8dd984dcddee..e403ea6fc102 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp @@ -54,6 +54,7 @@ struct PrivateBase : private std::enable_shared_from_this { int main(int, char**) { + globalMemCounter.reset(); { // https://bugs.llvm.org/show_bug.cgi?id=18843 std::shared_ptr t1(new T); std::shared_ptr t2(std::make_shared()); diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp index 4a5ae751bc40..826862f66c74 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_deleter_throw.pass.cpp @@ -37,6 +37,7 @@ int A::count = 0; int main(int, char**) { + globalMemCounter.reset(); A* ptr = new A; globalMemCounter.throw_after = 0; try diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp index fd33ce9cb9ea..6506890aa353 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/pointer_throw.pass.cpp @@ -37,6 +37,7 @@ int A::count = 0; int main(int, char**) { + globalMemCounter.reset(); A* ptr = new A; assert(A::count == 1); globalMemCounter.throw_after = 0;