forked from OSchip/llvm-project
Revert "Revert "Move more tests to globalMemCounter and reset.""
Test regressions not included this time :) This reverts commit 1ed671082ef4b13d44e2c0f42ddedf9d450258a7.
This commit is contained in:
parent
aca7167535
commit
9c5d0ea678
|
@ -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
|
||||
|
|
|
@ -45,6 +45,7 @@ struct A
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
new_called = 0;
|
||||
A *ap = new (std::nothrow) A[3];
|
||||
DoNotOptimize(ap);
|
||||
assert(ap);
|
||||
|
|
|
@ -46,6 +46,7 @@ struct A
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
new_called = 0;
|
||||
A *ap = new A[3];
|
||||
DoNotOptimize(ap);
|
||||
assert(ap);
|
||||
|
|
|
@ -45,6 +45,7 @@ struct A
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
new_called = 0;
|
||||
A *ap = new (std::nothrow) A;
|
||||
DoNotOptimize(ap);
|
||||
assert(ap);
|
||||
|
|
|
@ -44,6 +44,7 @@ struct A
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
new_called = 0;
|
||||
A *ap = new A;
|
||||
DoNotOptimize(ap);
|
||||
assert(ap);
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
globalMemCounter.reset();
|
||||
assert(globalMemCounter.checkOutstandingNewEq(0));
|
||||
{
|
||||
typedef std::codecvt_utf16<wchar_t> C;
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
globalMemCounter.reset();
|
||||
assert(globalMemCounter.checkOutstandingNewEq(0));
|
||||
{
|
||||
typedef std::codecvt_utf8<wchar_t> C;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
globalMemCounter.reset();
|
||||
typedef std::wbuffer_convert<std::codecvt_utf8<wchar_t> > B;
|
||||
#if TEST_STD_VER > 11
|
||||
static_assert(!std::is_convertible<std::streambuf*, B>::value, "");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -59,6 +59,7 @@ int h(int) {return 1;}
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
globalMemCounter.reset();
|
||||
assert(globalMemCounter.checkOutstandingNewEq(0));
|
||||
{
|
||||
std::function<int(int)> f1 = A(1);
|
||||
|
|
|
@ -62,6 +62,7 @@ struct LValueCallable {
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
globalMemCounter.reset();
|
||||
assert(globalMemCounter.checkOutstandingNewEq(0));
|
||||
{
|
||||
std::function<int(int)> f = A();
|
||||
|
|
|
@ -65,6 +65,7 @@ struct LValueCallable {
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
globalMemCounter.reset();
|
||||
assert(globalMemCounter.checkOutstandingNewEq(0));
|
||||
{
|
||||
std::function<int(int)> f;
|
||||
|
|
|
@ -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<int(int)> f = A();
|
||||
|
|
|
@ -52,6 +52,7 @@ int g(int) {return 0;}
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
globalMemCounter.reset();
|
||||
assert(globalMemCounter.checkOutstandingNewEq(0));
|
||||
{
|
||||
std::function<int(int)> f = A();
|
||||
|
|
|
@ -50,6 +50,7 @@ int g(int) {return 0;}
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
globalMemCounter.reset();
|
||||
assert(globalMemCounter.checkOutstandingNewEq(0));
|
||||
{
|
||||
std::function<int(int)> f = A();
|
||||
|
|
|
@ -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<int(int)> f1 = A(1);
|
||||
|
|
|
@ -54,6 +54,7 @@ struct PrivateBase : private std::enable_shared_from_this<PrivateBase> {
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
globalMemCounter.reset();
|
||||
{ // https://bugs.llvm.org/show_bug.cgi?id=18843
|
||||
std::shared_ptr<T const> t1(new T);
|
||||
std::shared_ptr<T const> t2(std::make_shared<T>());
|
||||
|
|
|
@ -37,6 +37,7 @@ int A::count = 0;
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
globalMemCounter.reset();
|
||||
A* ptr = new A;
|
||||
globalMemCounter.throw_after = 0;
|
||||
try
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue