[llvm] [CodeGen] Refactor rematerializer unit tests to reduce boilerplate (NFC) (PR #197575)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 05:56:58 PDT 2026


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `fuchsia-x86_64-linux` running on `fuchsia-debian-64-us-central1-a-1` while building `llvm` at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/41880

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 4 (annotate) failure: 'python ../llvm-zorg/zorg/buildbot/builders/annotated/fuchsia-linux.py ...' (failure)
...
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using wasm-ld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/bin/wasm-ld
-- Testing: 3202 tests, 60 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 

Testing Time: 24.30s

Total Discovered Tests: 3202
  Unsupported:  596 (18.61%)
  Passed     : 2606 (81.39%)
[941/1544] Building CXX object unittests/CodeGen/CMakeFiles/CodeGenTests.dir/RematerializerTest.cpp.o
FAILED: unittests/CodeGen/CMakeFiles/CodeGenTests.dir/RematerializerTest.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /usr/bin/clang++ -DLLVM_BUILD_STATIC -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/unittests/CodeGen -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/CodeGen -I/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/include -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/include -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/third-party/unittest/googletest/include -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -ffat-lto-objects -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj=../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -O3 -DNDEBUG -fvisibility=default -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -Wno-suggest-override -std=c++17 -Winvalid-pch -Xclang -include-pch -Xclang /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/cmake_pch.hxx -MD -MT unittests/CodeGen/CMakeFiles/CodeGenTests.dir/RematerializerTest.cpp.o -MF unittests/CodeGen/CMakeFiles/CodeGenTests.dir/RematerializerTest.cpp.o.d -o unittests/CodeGen/CMakeFiles/CodeGenTests.dir/RematerializerTest.cpp.o -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/CodeGen/RematerializerTest.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/CodeGen/RematerializerTest.cpp:96:5: error: use of undeclared identifier 'LLVMInitializeAMDGPUTargetInfo'; did you mean 'LLVMInitializeARMTargetInfo'?
   96 |     LLVMInitializeAMDGPUTargetInfo();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     LLVMInitializeARMTargetInfo
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/include/llvm/Config/Targets.def:27:1: note: 'LLVMInitializeARMTargetInfo' declared here
   27 | LLVM_TARGET(ARM)
      | ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/include/llvm/Support/TargetSelect.h:24:17: note: expanded from macro 'LLVM_TARGET'
   24 |   LLVM_ABI void LLVMInitialize##TargetName##TargetInfo();
      |                 ^
<scratch space>:30:1: note: expanded from here
   30 | LLVMInitializeARMTargetInfo
      | ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/CodeGen/RematerializerTest.cpp:97:5: error: use of undeclared identifier 'LLVMInitializeAMDGPUTarget'; did you mean 'LLVMInitializeARMTarget'?
   97 |     LLVMInitializeAMDGPUTarget();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |     LLVMInitializeARMTarget
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/include/llvm/Config/Targets.def:27:1: note: 'LLVMInitializeARMTarget' declared here
   27 | LLVM_TARGET(ARM)
      | ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/include/llvm/Support/TargetSelect.h:28:17: note: expanded from macro 'LLVM_TARGET'
   28 |   LLVM_ABI void LLVMInitialize##TargetName##Target();
      |                 ^
<scratch space>:38:1: note: expanded from here
   38 | LLVMInitializeARMTarget
      | ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/CodeGen/RematerializerTest.cpp:98:5: error: use of undeclared identifier 'LLVMInitializeAMDGPUTargetMC'; did you mean 'LLVMInitializeARMTargetMC'?
   98 |     LLVMInitializeAMDGPUTargetMC();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     LLVMInitializeARMTargetMC
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/include/llvm/Config/Targets.def:27:1: note: 'LLVMInitializeARMTargetMC' declared here
   27 | LLVM_TARGET(ARM)
      | ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/include/llvm/Support/TargetSelect.h:33:17: note: expanded from macro 'LLVM_TARGET'
   33 |   LLVM_ABI void LLVMInitialize##TargetName##TargetMC();
      |                 ^
<scratch space>:46:1: note: expanded from here
Step 7 (check) failure: check (failure)
...
llvm-lit: /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/utils/lit/lit/llvm/config.py:569: note: using wasm-ld: /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/bin/wasm-ld
-- Testing: 3202 tests, 60 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 

Testing Time: 24.30s

Total Discovered Tests: 3202
  Unsupported:  596 (18.61%)
  Passed     : 2606 (81.39%)
[941/1544] Building CXX object unittests/CodeGen/CMakeFiles/CodeGenTests.dir/RematerializerTest.cpp.o
FAILED: unittests/CodeGen/CMakeFiles/CodeGenTests.dir/RematerializerTest.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /usr/bin/clang++ -DLLVM_BUILD_STATIC -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/unittests/CodeGen -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/CodeGen -I/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/include -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/include -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/third-party/unittest/googletest/include -I/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Xclang -fno-pch-timestamp -ffat-lto-objects -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj=../../llvm-project -ffile-prefix-map=/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/= -no-canonical-prefixes -O3 -DNDEBUG -fvisibility=default -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -Wno-suggest-override -std=c++17 -Winvalid-pch -Xclang -include-pch -Xclang /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/cmake_pch.hxx -MD -MT unittests/CodeGen/CMakeFiles/CodeGenTests.dir/RematerializerTest.cpp.o -MF unittests/CodeGen/CMakeFiles/CodeGenTests.dir/RematerializerTest.cpp.o.d -o unittests/CodeGen/CMakeFiles/CodeGenTests.dir/RematerializerTest.cpp.o -c /var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/CodeGen/RematerializerTest.cpp
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/CodeGen/RematerializerTest.cpp:96:5: error: use of undeclared identifier 'LLVMInitializeAMDGPUTargetInfo'; did you mean 'LLVMInitializeARMTargetInfo'?
   96 |     LLVMInitializeAMDGPUTargetInfo();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     LLVMInitializeARMTargetInfo
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/include/llvm/Config/Targets.def:27:1: note: 'LLVMInitializeARMTargetInfo' declared here
   27 | LLVM_TARGET(ARM)
      | ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/include/llvm/Support/TargetSelect.h:24:17: note: expanded from macro 'LLVM_TARGET'
   24 |   LLVM_ABI void LLVMInitialize##TargetName##TargetInfo();
      |                 ^
<scratch space>:30:1: note: expanded from here
   30 | LLVMInitializeARMTargetInfo
      | ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/CodeGen/RematerializerTest.cpp:97:5: error: use of undeclared identifier 'LLVMInitializeAMDGPUTarget'; did you mean 'LLVMInitializeARMTarget'?
   97 |     LLVMInitializeAMDGPUTarget();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |     LLVMInitializeARMTarget
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/include/llvm/Config/Targets.def:27:1: note: 'LLVMInitializeARMTarget' declared here
   27 | LLVM_TARGET(ARM)
      | ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/include/llvm/Support/TargetSelect.h:28:17: note: expanded from macro 'LLVM_TARGET'
   28 |   LLVM_ABI void LLVMInitialize##TargetName##Target();
      |                 ^
<scratch space>:38:1: note: expanded from here
   38 | LLVMInitializeARMTarget
      | ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/unittests/CodeGen/RematerializerTest.cpp:98:5: error: use of undeclared identifier 'LLVMInitializeAMDGPUTargetMC'; did you mean 'LLVMInitializeARMTargetMC'?
   98 |     LLVMInitializeAMDGPUTargetMC();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     LLVMInitializeARMTargetMC
/var/lib/buildbot/fuchsia-x86_64-linux/build/llvm-build-2oo3u3hj/include/llvm/Config/Targets.def:27:1: note: 'LLVMInitializeARMTargetMC' declared here
   27 | LLVM_TARGET(ARM)
      | ^
/var/lib/buildbot/fuchsia-x86_64-linux/llvm-project/llvm/include/llvm/Support/TargetSelect.h:33:17: note: expanded from macro 'LLVM_TARGET'
   33 |   LLVM_ABI void LLVMInitialize##TargetName##TargetMC();
      |                 ^
<scratch space>:46:1: note: expanded from here

```

</details>

https://github.com/llvm/llvm-project/pull/197575


More information about the llvm-commits mailing list