Skip to content

[clang] Shard out some small gtest binaries #138021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2025
Merged

Conversation

rnk
Copy link
Collaborator

@rnk rnk commented Apr 30, 2025

@nico mentioned that FormatTests and BasicTests are small binaries with
few dependencies, so keeping them separate is nice. I broke them out as
distinct test binaries, and they are still pretty small:

$ find tools/clang/unittests/ -type f -name '*Tests' | xargs du -cksh | sort -nr
708M total
276M tools/clang/unittests/AllClangUnitTests
244M tools/clang/unittests/Interpreter/ClangReplInterpreterTests
167M tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
13M tools/clang/unittests/Format/FormatTests
6.9M tools/clang/unittests/Basic/BasicTests
1.1M tools/clang/unittests/libclang/CrashTests/libclangCrashTests

I also broke out libclangCrashTests and re-enabled the failing test to
resolve #137855.

@nico mentioned that FormatTests and BasicTests are small binaries with
few dependencies, so keeping them separate is nice. I broke them out as
distinct test binaries, and they are still pretty small:

$ find tools/clang/unittests/ -type f -name '*Tests' | xargs du -cksh | sort -nr
708M    total
276M    tools/clang/unittests/AllClangUnitTests
244M    tools/clang/unittests/Interpreter/ClangReplInterpreterTests
167M    tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
 13M    tools/clang/unittests/Format/FormatTests
6.9M    tools/clang/unittests/Basic/BasicTests
1.1M    tools/clang/unittests/libclang/CrashTests/libclangCrashTests

I also broke out libclangCrashTests and re-enabled the failing test to
resolve llvm#137855.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang-format labels Apr 30, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 30, 2025

@llvm/pr-subscribers-clang

Author: Reid Kleckner (rnk)

Changes

@nico mentioned that FormatTests and BasicTests are small binaries with
few dependencies, so keeping them separate is nice. I broke them out as
distinct test binaries, and they are still pretty small:

$ find tools/clang/unittests/ -type f -name '*Tests' | xargs du -cksh | sort -nr
708M total
276M tools/clang/unittests/AllClangUnitTests
244M tools/clang/unittests/Interpreter/ClangReplInterpreterTests
167M tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
13M tools/clang/unittests/Format/FormatTests
6.9M tools/clang/unittests/Basic/BasicTests
1.1M tools/clang/unittests/libclang/CrashTests/libclangCrashTests

I also broke out libclangCrashTests and re-enabled the failing test to
resolve llvm#137855.


Full diff: https://github.com/llvm/llvm-project/pull/138021.diff

4 Files Affected:

  • (modified) clang/unittests/Basic/CMakeLists.txt (+1-1)
  • (modified) clang/unittests/Format/CMakeLists.txt (+1-1)
  • (modified) clang/unittests/libclang/CrashTests/CMakeLists.txt (+1-1)
  • (modified) clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp (+1-2)
diff --git a/clang/unittests/Basic/CMakeLists.txt b/clang/unittests/Basic/CMakeLists.txt
index e818bd3e2c372..95f3a0fb480cb 100644
--- a/clang/unittests/Basic/CMakeLists.txt
+++ b/clang/unittests/Basic/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_clang_unittest(BasicTests
+add_distinct_clang_unittest(BasicTests
   CharInfoTest.cpp
   DarwinSDKInfoTest.cpp
   DiagnosticTest.cpp
diff --git a/clang/unittests/Format/CMakeLists.txt b/clang/unittests/Format/CMakeLists.txt
index 0af571a65dafa..f44d25b756a58 100644
--- a/clang/unittests/Format/CMakeLists.txt
+++ b/clang/unittests/Format/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_clang_unittest(FormatTests
+add_distinct_clang_unittest(FormatTests
   BracesInserterTest.cpp
   BracesRemoverTest.cpp
   CleanupTest.cpp
diff --git a/clang/unittests/libclang/CrashTests/CMakeLists.txt b/clang/unittests/libclang/CrashTests/CMakeLists.txt
index de7b5a8f6ee91..d8b164e2957b0 100644
--- a/clang/unittests/libclang/CrashTests/CMakeLists.txt
+++ b/clang/unittests/libclang/CrashTests/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_clang_unittest(libclangCrashTests
+add_distinct_clang_unittest(libclangCrashTests
   LibclangCrashTest.cpp
   LINK_LIBS
   libclang
diff --git a/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp b/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp
index be1f26f5ae53e..26c63cfbd427b 100644
--- a/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp
+++ b/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp
@@ -23,8 +23,7 @@ TEST_F(LibclangParseTest, InstallAbortingLLVMFatalErrorHandler) {
                "");
 }
 
-// FIXME: Re-enable after Mac-AArch64 signpost crash issues are debugged.
-TEST_F(LibclangParseTest, DISABLED_UninstallAbortingLLVMFatalErrorHandler) {
+TEST_F(LibclangParseTest, UninstallAbortingLLVMFatalErrorHandler) {
   clang_toggleCrashRecovery(0);
   clang_install_aborting_llvm_fatal_error_handler();
   clang_uninstall_llvm_fatal_error_handler();

@llvmbot
Copy link
Member

llvmbot commented Apr 30, 2025

@llvm/pr-subscribers-clang-format

Author: Reid Kleckner (rnk)

Changes

@nico mentioned that FormatTests and BasicTests are small binaries with
few dependencies, so keeping them separate is nice. I broke them out as
distinct test binaries, and they are still pretty small:

$ find tools/clang/unittests/ -type f -name '*Tests' | xargs du -cksh | sort -nr
708M total
276M tools/clang/unittests/AllClangUnitTests
244M tools/clang/unittests/Interpreter/ClangReplInterpreterTests
167M tools/clang/unittests/Interpreter/ExceptionTests/ClangReplInterpreterExceptionTests
13M tools/clang/unittests/Format/FormatTests
6.9M tools/clang/unittests/Basic/BasicTests
1.1M tools/clang/unittests/libclang/CrashTests/libclangCrashTests

I also broke out libclangCrashTests and re-enabled the failing test to
resolve llvm#137855.


Full diff: https://github.com/llvm/llvm-project/pull/138021.diff

4 Files Affected:

  • (modified) clang/unittests/Basic/CMakeLists.txt (+1-1)
  • (modified) clang/unittests/Format/CMakeLists.txt (+1-1)
  • (modified) clang/unittests/libclang/CrashTests/CMakeLists.txt (+1-1)
  • (modified) clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp (+1-2)
diff --git a/clang/unittests/Basic/CMakeLists.txt b/clang/unittests/Basic/CMakeLists.txt
index e818bd3e2c372..95f3a0fb480cb 100644
--- a/clang/unittests/Basic/CMakeLists.txt
+++ b/clang/unittests/Basic/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_clang_unittest(BasicTests
+add_distinct_clang_unittest(BasicTests
   CharInfoTest.cpp
   DarwinSDKInfoTest.cpp
   DiagnosticTest.cpp
diff --git a/clang/unittests/Format/CMakeLists.txt b/clang/unittests/Format/CMakeLists.txt
index 0af571a65dafa..f44d25b756a58 100644
--- a/clang/unittests/Format/CMakeLists.txt
+++ b/clang/unittests/Format/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_clang_unittest(FormatTests
+add_distinct_clang_unittest(FormatTests
   BracesInserterTest.cpp
   BracesRemoverTest.cpp
   CleanupTest.cpp
diff --git a/clang/unittests/libclang/CrashTests/CMakeLists.txt b/clang/unittests/libclang/CrashTests/CMakeLists.txt
index de7b5a8f6ee91..d8b164e2957b0 100644
--- a/clang/unittests/libclang/CrashTests/CMakeLists.txt
+++ b/clang/unittests/libclang/CrashTests/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_clang_unittest(libclangCrashTests
+add_distinct_clang_unittest(libclangCrashTests
   LibclangCrashTest.cpp
   LINK_LIBS
   libclang
diff --git a/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp b/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp
index be1f26f5ae53e..26c63cfbd427b 100644
--- a/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp
+++ b/clang/unittests/libclang/CrashTests/LibclangCrashTest.cpp
@@ -23,8 +23,7 @@ TEST_F(LibclangParseTest, InstallAbortingLLVMFatalErrorHandler) {
                "");
 }
 
-// FIXME: Re-enable after Mac-AArch64 signpost crash issues are debugged.
-TEST_F(LibclangParseTest, DISABLED_UninstallAbortingLLVMFatalErrorHandler) {
+TEST_F(LibclangParseTest, UninstallAbortingLLVMFatalErrorHandler) {
   clang_toggleCrashRecovery(0);
   clang_install_aborting_llvm_fatal_error_handler();
   clang_uninstall_llvm_fatal_error_handler();

Copy link
Contributor

@nico nico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool, thanks!

Thoughts on #134196 (comment) ? :)

@rnk rnk merged commit afd738c into llvm:main Apr 30, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Apr 30, 2025

LLVM Buildbot has detected a new failure on builder openmp-offload-amdgpu-runtime-2 running on rocm-worker-hw-02 while building clang at step 6 "test-openmp".

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

Here is the relevant piece of the build log for the reference
Step 6 (test-openmp) failure: test (failure)
******************** TEST 'libomp :: tasking/issue-94260-2.c' FAILED ********************
Exit Code: -11

Command Output (stdout):
--
# RUN: at line 1
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/clang -fopenmp   -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test -L /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src  -fno-omit-frame-pointer -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/ompt /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/tasking/issue-94260-2.c -o /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp -lm -latomic && /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp
# executed command: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/./bin/clang -fopenmp -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test -L /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/src -fno-omit-frame-pointer -I /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/ompt /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/openmp/runtime/test/tasking/issue-94260-2.c -o /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp -lm -latomic
# note: command had no output on stdout or stderr
# executed command: /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/runtimes/runtimes-bins/openmp/runtime/test/tasking/Output/issue-94260-2.c.tmp
# note: command had no output on stdout or stderr
# error: command failed with exit status: -11

--

********************


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category clang-format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

libclang abort death test fails when run as part of AllClangUnitTests binary
4 participants