llvm/llvm-project
cross-project-tests
cross-project-tests/ is the home of integration tests that span more than one subproject. They are tests where the property being asserted is a contract between parts of the toolchain — for example, that debug info emitted by Clang round-trips correctly through LLVM codegen, lld, and LLDB.
Purpose
The bulk of LLVM testing lives inside each subproject's test/ directory and runs against that subproject in isolation. That is good for fast iteration but misses regressions that only show up when components are composed. Cross-project-tests is the layer where the entire compile → link → debug pipeline (or a similar multi-subproject flow) is exercised end-to-end.
Directory layout
cross-project-tests/
├── debuginfo-tests/ # The largest subdirectory — multi-subproject debug-info tests
├── intrinsic-header-tests/
├── lit.cfg.py # lit configuration
├── lit.site.cfg.py.in # CMake-substituted site config
├── pdb_tests/ # PDB round-trip tests (Windows debug info)
├── README # (Or top-level documentation in CMakeLists.txt)
└── ...Most tests are written in C/C++/Fortran source plus RUN: lit directives that build the program, optionally generate a debug-info dump, and FileCheck against the result.
What's tested
- Debug-info correctness across the toolchain: source → AST → IR → MIR → object → debug session. Tests verify that source locations, variable names, types, and inlining metadata survive the trip and that LLDB can resurface them.
- PDB tests: produce PDB on the Windows path and assert with
llvm-pdbutiland friends. - Intrinsic-header consistency: that the headers Clang ships agree with the intrinsics LLVM exposes.
- DTLTO / ThinLTO end-to-end (selectively, when the configuration is rich enough).
Build and run
The check-cross-project-tests target is registered when CROSS_PROJECT_TESTS_TEST_DEPS finds suitable in-tree builds (Clang plus LLDB, or Clang plus a linker, etc.). Many tests are gated on combinations being available — they self-skip if (e.g.) LLDB isn't built.
ninja -C build check-cross-project-testsIntegration points
These tests are the integration point — they don't have one in particular, they exercise all of them. The most-touched subprojects are:
- Clang (
clang) — emits the input - LLVM core (
llvm) — codegen - lld (
lld) — links - LLDB (
lldb) — consumes debug info - compiler-rt / libunwind / libcxx — runtime libraries pulled into the link
Entry points for modification
- Adding a debug-info regression test: usually a new file under
cross-project-tests/debuginfo-tests/with aRUN:line that builds, optionally runs LLDB scripted commands, andFileChecks the output. - Adding a Windows PDB test:
cross-project-tests/pdb_tests/.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.
Previous
llvm-libgcc
Next
Reference