[llvm] [Bazel] Remove redundant gtest_main from codegen_tests, codegen_globalisel_tests, mi_tests (PR #135316)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 21:14:51 PDT 2025


https://github.com/HighW4y2H3ll created https://github.com/llvm/llvm-project/pull/135316

 For codegen_tests, codegen_globalisel_tests and mi_tests, they already have their own `main` function defined, so there should be no need to add `gtest_main` dependency for the main function...

- codegen_tests: https://github.com/llvm/llvm-project/blob/main/llvm/unittests/CodeGen/TargetOptionsTest.cpp#L73
- codegen_globalisel_tests: https://github.com/llvm/llvm-project/blob/main/llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp#L978
- mi_tests: https://github.com/llvm/llvm-project/blob/main/llvm/unittests/MI/LiveIntervalTest.cpp#L933

>From 09738a23799cb56531e6454136070ab6286fd4b1 Mon Sep 17 00:00:00 2001
From: h2h <h2h at meta.com>
Date: Thu, 10 Apr 2025 21:04:10 -0700
Subject: [PATCH] [Bazel] Remove redundant gtest_main from codegen_tests,
 codegen_globalisel_tests, mi_tests

---
 utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel
index 3b778fc90fe1a..97528392ec07f 100644
--- a/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/llvm/unittests/BUILD.bazel
@@ -174,7 +174,6 @@ cc_test(
         "//llvm:Target",
         "//llvm:TestingSupport",
         "//third-party/unittest:gtest",
-        "//third-party/unittest:gtest_main",
     ],
 )
 
@@ -203,7 +202,6 @@ cc_test(
         "//llvm:Support",
         "//llvm:Target",
         "//third-party/unittest:gtest",
-        "//third-party/unittest:gtest_main",
     ],
 )
 
@@ -501,7 +499,6 @@ cc_test(
         "//llvm:Support",
         "//llvm:Target",
         "//third-party/unittest:gtest",
-        "//third-party/unittest:gtest_main",
     ],
 )
 



More information about the llvm-commits mailing list