[llvm] r304165 - Don't destroy ManagedStatics in a unit test.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Mon May 29 10:25:37 PDT 2017


Author: d0k
Date: Mon May 29 12:25:37 2017
New Revision: 304165

URL: http://llvm.org/viewvc/llvm-project?rev=304165&view=rev
Log:
Don't destroy ManagedStatics in a unit test.

Turns out this is very hostile towards other unit tests running in the
same process, it unregisters all flags.

Modified:
    llvm/trunk/unittests/Support/ManagedStatic.cpp

Modified: llvm/trunk/unittests/Support/ManagedStatic.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ManagedStatic.cpp?rev=304165&r1=304164&r2=304165&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/ManagedStatic.cpp (original)
+++ llvm/trunk/unittests/Support/ManagedStatic.cpp Mon May 29 12:25:37 2017
@@ -78,10 +78,6 @@ TEST(ManagedStaticTest, NestedStatics) {
   *Ms2;
   EXPECT_TRUE(Ms1.isConstructed());
   EXPECT_TRUE(Ms2.isConstructed());
-
-  llvm_shutdown();
-  EXPECT_FALSE(Ms1.isConstructed());
-  EXPECT_FALSE(Ms2.isConstructed());
 }
 } // namespace NestedStatics
 
@@ -94,8 +90,6 @@ void *CustomCreate() {
 static ManagedStatic<int, CustomCreate, std::free> Custom;
 TEST(ManagedStaticTest, CustomCreatorDeletor) {
   EXPECT_EQ(42, *Custom);
-  llvm_shutdown();
-  EXPECT_FALSE(Custom.isConstructed());
 }
 } // namespace CustomCreatorDeletor
 




More information about the llvm-commits mailing list