Manual-sync mirror of chromium.googlesource.com/external/github.com/llvm/llvm-project (bare monorepo, no subtree suffix)
Find a file
Michael Kruse 0957656a40
[runtimes][GTest] LLVM-independent unittests (#164794)
The LLVM-customized GTest has a dependency on LLVM to support
`llvm::raw_ostream` and hence has to link to LLVMSupport. The runtimes
use the LLVMSupport from the bootstrapping LLVM build. The problem is
that the boostrapping compiler and the runtimes target can diverge in
their ABI, even in the runtimes default build. For instance, Clang is
built using gcc which uses libstdc++, but the runtimes is built by Clang
which can be configured to use libcxx by default. Altough it does not
use gcc, this issue has caused
[flang-aarch64-libcxx](https://lab.llvm.org/buildbot/#/builders/89)) to
break, and is still (again?) broken.

This patch makes the runtimes' GTest independent from LLVMSupport so we
do not link any runtimes component with LLVM components.

Runtime projects that use GTest unittests:
 * flang-rt
 * libc
* compiler-rt: Adds `gtest-all.cpp` with
[GTEST_NO_LLVM_SUPPORT=1](f801b6f67e/compiler-rt/CMakeLists.txt (L723))
to each unittest without using `llvm_gtest`. Not touched by this PR.
* openmp: Handled by #159416. Not touched for now by this PR to avoid
conflict.

The current state of this PR tries to reuse
https://github.com/llvm/llvm-project/blob/main/third-party/unittest/CMakeLists.txt
as much as possible, altough personally I would prefer to make it use
"modern CMake" style. third-party/unittest/CMakeLists.txt will detect
whether it is used in runtimes build and adjaust accordingly. It creates
a different target for LLVM (`llvm_gtest`, NFCI) and another one for the
runtimes (`runtimes_gtest`). It is not possible to reuse `llvm_gtest`
for both since `llvm_gtest` is imported using `find_package(LLVM)` if
configured using LLVM_INSTALL_GTEST. An alias `default_gtest` is used to
select between the two. `default_gtest` could also be used for openmp
which also supports standalone and
[LLVM_ENABLE_PROJECTS](https://github.com/llvm/llvm-project/pull/152189)
build mode.
2025-11-12 11:50:33 +01:00
.ci Reapply "[CI] Make premerge_advisor_explain write comments" (#167198) 2025-11-10 11:57:35 -08:00
.github workflows/release-binaries: Drop use of setup-windows action (#167440) 2025-11-11 23:34:09 -08:00
bolt [BOLT] Move call probe information to CallSiteInfo 2025-11-11 11:55:36 -08:00
clang [Clang][CodeGen] Add disable_sanitizer_instrumentation attribute to multiversion resolvers (#167516) 2025-11-12 10:39:30 +00:00
clang-tools-extra [clang-tidy] Provide fix-its for downcasts in google-readability-casting (#165411) 2025-11-12 08:37:41 +01:00
cmake [CMake][gRPC] Update FindGRPC.cmake to support newer gRPC versions (#162935) 2025-10-15 13:14:14 -07:00
compiler-rt [Clang][CodeGen] Add disable_sanitizer_instrumentation attribute to multiversion resolvers (#167516) 2025-11-12 10:39:30 +00:00
cross-project-tests Wasm fmuladd relaxed (#163177) 2025-10-13 16:50:53 +01:00
flang [flang][debug] Track dummy argument positions explicitly. (#167489) 2025-11-12 10:21:32 +00:00
flang-rt [runtimes][GTest] LLVM-independent unittests (#164794) 2025-11-12 11:50:33 +01:00
libc [runtimes][GTest] LLVM-independent unittests (#164794) 2025-11-12 11:50:33 +01:00
libclc [NFC][libclc] Rename clc_cbrt.inc to clc_cbrt.h (#166330) 2025-11-05 08:20:29 +08:00
libcxx [libc++] Mark string functions as [[nodiscard]] (#166524) 2025-11-12 10:18:56 +01:00
libcxxabi [libc++abi] Add a test to ensure the abi namespace alias is declared correctly (#167485) 2025-11-12 10:12:13 +01:00
libsycl [SYCL] Add libsycl, a SYCL RT library implementation project (#144372) 2025-07-31 11:28:39 -07:00
libunwind libunwind: Implement the unw_strerror function for better nongnu libunwind compatibility (#160887) 2025-11-11 20:45:42 -08:00
lld [lld][macho] Fix segfault while processing malformed object file. (#167025) 2025-11-11 14:27:03 -08:00
lldb Revert "[lldb] Introduce ScriptedFrameProvider for real threads" (#167662) 2025-11-12 10:13:43 +00:00
llvm [runtimes][GTest] LLVM-independent unittests (#164794) 2025-11-12 11:50:33 +01:00
llvm-libgcc
mlir [mlir][tosa] Fix validation support for argmax with int64 output (#167378) 2025-11-12 10:42:28 +00:00
offload [PGO][Offload] Fix missing names bug in GPU PGO (#166444) 2025-11-10 10:11:53 -06:00
openmp [Offload] Remove handling for device memory pool (#163629) 2025-11-06 10:15:18 -06:00
orc-rt [orc-rt] Make Session explicitly immovable. (#167640) 2025-11-12 16:36:52 +11:00
polly [Polly] Retain vectorization for fallback loop when RTC is unsatisfiable (#165525) 2025-11-10 13:48:15 +05:30
runtimes [runtimes][GTest] LLVM-independent unittests (#164794) 2025-11-12 11:50:33 +01:00
third-party [runtimes][GTest] LLVM-independent unittests (#164794) 2025-11-12 11:50:33 +01:00
utils/bazel [BAZEL] Fix missing GpuDialect dependency added in #166865 (#167503) 2025-11-11 13:29:22 +00:00
.clang-format Enforce Unix line endings for Clang/LLVM/MLIR projects (#161460) 2025-10-02 06:09:12 -07:00
.clang-format-ignore Add empty top level .clang-format-ignore (#136022) 2025-04-16 15:48:30 -07:00
.clang-tidy Add default empty header filter regex to root .clang-tidy (#167386) 2025-11-11 01:36:25 +03:00
.git-blame-ignore-revs Revert "Update .git-blame-ignore-revs for Pack/Unpack move (#152469)" (#152661) 2025-08-10 17:02:35 +01:00
.gitattributes Revert "Finally formalise our defacto line-ending policy" 2024-10-18 21:16:24 +01:00
.gitignore [llvm] Ignore coding assistant artifacts (#153853) 2025-08-15 12:27:54 -07:00
.mailmap [mailmap] Update my name 2025-04-14 16:54:14 +08:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md [www][docs] Remove last mentions of IRC (#139076) 2025-05-08 09:40:33 -04:00
LICENSE.TXT
pyproject.toml
README.md
SECURITY.md

The LLVM Compiler Infrastructure

OpenSSF Scorecard OpenSSF Best Practices libc++

Welcome to the LLVM project!

This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.

The LLVM project has multiple components. The core of the project is itself called "LLVM". This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.

C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.

Other components include: the libc++ C++ standard library, the LLD linker, and more.

Getting the Source Code and Building LLVM

Consult the Getting Started with LLVM page for information on building and running LLVM.

For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.

Getting in touch

Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.

The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.