Move init code in AArch64SelectionDAGTest to SetUpTestCase (NFC)
authorScott Linder <scott@scottlinder.com>
Thu, 6 Sep 2018 18:40:35 +0000 (18:40 +0000)
committerScott Linder <scott@scottlinder.com>
Thu, 6 Sep 2018 18:40:35 +0000 (18:40 +0000)
llvm-svn: 341574

llvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp

index 6a39a0f..620dfc8 100644 (file)
@@ -22,13 +22,13 @@ using namespace llvm;
 
 namespace {
 
-void initLLVM() {
-  InitializeAllTargets();
-  InitializeAllTargetMCs();
-}
-
 class AArch64SelectionDAGTest : public testing::Test {
 protected:
+  static void SetUpTestCase() {
+    InitializeAllTargets();
+    InitializeAllTargetMCs();
+  }
+
   void SetUp() override {
     StringRef Assembly = "define void @f() { ret void }";
 
@@ -160,9 +160,3 @@ TEST_F(AArch64SelectionDAGTest, SimplifyDemandedVectorElts_EXTRACT_SUBVECTOR) {
 }
 
 } // end anonymous namespace
-
-int main(int argc, char **argv) {
-  ::testing::InitGoogleTest(&argc, argv);
-  initLLVM();
-  return RUN_ALL_TESTS();
-}