[all-commits] [llvm/llvm-project] d93b10: [BOLT][test] Allow uninstantiated tests when no ma...

CSharperMantle via All-commits all-commits at lists.llvm.org
Mon Sep 7 00:06:55 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d93b10ea300fa0e86a736b3f0aac8605b23caeb9
      https://github.com/llvm/llvm-project/commit/d93b10ea300fa0e86a736b3f0aac8605b23caeb9
  Author: Rong "Mantle" Bao <rong.bao at csmantle.top>
  Date:   2026-09-07 (Mon, 07 Sep 2026)

  Changed paths:
    M bolt/unittests/Core/BinaryContext.cpp
    M bolt/unittests/Core/MCPlusBuilder.cpp
    M bolt/unittests/Core/MemoryMaps.cpp
    M bolt/unittests/Profile/PerfScripts.cpp

  Log Message:
  -----------
  [BOLT][test] Allow uninstantiated tests when no matching targets are enabled (#217604)

When neither X86 nor AArch64 is enabled, e.g. when only enabling the
RISCV target, `check-bolt-unit` triggers GTest's uninstantiated suite
errors on the following cases:

```plain-text
BOLT-Unit :: Core/./CoreTests/GoogleTestVerification/UninstantiatedParameterizedTestSuite<BinaryContextTester>
BOLT-Unit :: Core/./CoreTests/GoogleTestVerification/UninstantiatedParameterizedTestSuite<MCPlusBuilderTester>
BOLT-Unit :: Core/./CoreTests/GoogleTestVerification/UninstantiatedParameterizedTestSuite<MemoryMapsTester>
BOLT-Unit :: Profile/./ProfileTests/GoogleTestVerification/UninstantiatedParameterizedTestSuite<PerfScriptTestHelper>
```

... which looks like the following:

```plain-text
********************                                                                                                                                                20:28 [95/2055]
FAIL: BOLT-Unit :: Core/./CoreTests/6/9 (7 of 12)
******************** TEST 'BOLT-Unit :: Core/./CoreTests/6/9' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/home/csmantle/workspace/llvm-project/build/tools/bolt/unittests/Core/./CoreTests-BOLT-Unit-718646-6-9.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=9 GTEST_SHARD_INDE
X=6 /home/csmantle/workspace/llvm-project/build/tools/bolt/unittests/Core/./CoreTests
--

Script:
--
/home/csmantle/workspace/llvm-project/build/tools/bolt/unittests/Core/./CoreTests --gtest_filter=GoogleTestVerification.UninstantiatedParameterizedTestSuite<BinaryContextTester>
--
/home/csmantle/workspace/llvm-project/bolt/unittests/Core/BinaryContext.cpp:211: Failure
Parameterized test suite BinaryContextTester is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the
only ones provided expand to nothing.

Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in
to get other utilities.)

To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BinaryContextTester);


/home/csmantle/workspace/llvm-project/bolt/unittests/Core/BinaryContext.cpp:211
Parameterized test suite BinaryContextTester is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the
only ones provided expand to nothing.

Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in
to get other utilities.)

To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:

GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BinaryContextTester);
```

Add gated `GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST` to suppress
such warnings until appropriate tests have been implemented.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list