Auto merge of #146414 - GuillaumeGomez:run-test-with-gcc-backend, r=Kobzol

Add a CI job that runs a subset of UI tests with the GCC backend

Part of https://github.com/rust-lang/compiler-team/issues/891.

r? `@Kobzol`
This commit is contained in:
bors 2025-10-14 09:21:23 +00:00
commit 2f7620a5cc
484 changed files with 1661 additions and 1240 deletions

View file

@ -0,0 +1,54 @@
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
bzip2 \
g++ \
make \
ninja-build \
file \
curl \
ca-certificates \
python3 \
git \
cmake \
sudo \
gdb \
libssl-dev \
pkg-config \
xz-utils \
mingw-w64 \
zlib1g-dev \
libzstd-dev \
# libgccjit dependencies
flex \
libmpfr-dev \
libgmp-dev \
libmpc3 \
libmpc-dev \
&& rm -rf /var/lib/apt/lists/*
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
ENV NO_DEBUG_ASSERTIONS 1
ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
--enable-sanitizers \
--enable-profiler \
--enable-compiler-docs \
--set llvm.libzstd=true \
--set 'rust.codegen-backends=[\"llvm\",\"gcc\"]'
ENV SCRIPT python3 ../x.py \
--stage 2 \
test tests \
--test-codegen-backend gcc \
--skip tests/coverage \
--skip tests/coverage-run-rustdoc \
--skip tests/rustdoc \
--skip tests/rustdoc-gui \
--skip tests/rustdoc-js \
--skip tests/rustdoc-js-std \
--skip tests/rustdoc-json \
--skip tests/rustdoc-ui \
--set 'rust.codegen-backends=[\"llvm\",\"gcc\"]'

View file

@ -141,6 +141,9 @@ pr:
<<: *job-linux-4c
- name: x86_64-gnu-miri
<<: *job-linux-4c
- name: x86_64-gnu-gcc
doc_url: https://rustc-dev-guide.rust-lang.org/tests/codegen-backend-tests/cg_gcc.html
<<: *job-linux-4c
# Jobs that run when you perform a try build (@bors try)
# These jobs automatically inherit envs.try, to avoid repeating
@ -348,6 +351,10 @@ auto:
- name: x86_64-gnu
<<: *job-linux-4c
- name: x86_64-gnu-gcc
doc_url: https://rustc-dev-guide.rust-lang.org/tests/codegen-backend-tests/cg_gcc.html
<<: *job-linux-4c
# This job ensures commits landing on nightly still pass the full
# test suite on the stable channel. There are some UI tests that
# depend on the channel being built (for example if they include the

View file

@ -1,5 +1,6 @@
//@ known-bug: #118244
//@ compile-flags: -Cdebuginfo=2
//@ ignore-backends: gcc
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]

View file

@ -1,5 +1,6 @@
//@ known-bug: #134479
//@ compile-flags: -Csymbol-mangling-version=v0 -Cdebuginfo=1
//@ ignore-backends: gcc
#![feature(generic_const_exprs)]

View file

@ -1,5 +1,6 @@
//@ known-bug: #139462
//@ compile-flags: -Cdebuginfo=2
//@ ignore-backends: gcc
#![feature(unsafe_binders)]
use std::unsafe_binder::wrap_binder;
fn main() {

View file

@ -1,6 +1,7 @@
//@ compile-flags: -g -Copt-level=0 -Z verify-llvm-ir
//@ known-bug: #34127
//@ only-64bit
//@ ignore-backends: gcc
pub fn main() {
let _a = [(); 1 << 63];

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================
// gdb-command:run

View file

@ -6,6 +6,7 @@
//@ ignore-loongarch64: Doesn't work yet.
//@ ignore-riscv64: Doesn't work yet.
//@ compile-flags: -g
//@ ignore-backends: gcc
// gdb-command: run
// FIXME(#97083): Should we be able to break on initialization of zero-sized types?

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// gdb-command:run
// gdb-command:whatis basic_types_globals_metadata::B

View file

@ -5,6 +5,7 @@
//@ [lto] compile-flags:-C lto
//@ [lto] no-prefer-dynamic
//@ ignore-backends: gcc
// lldb-command:run
// lldb-command:v B

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// gdb-command:run
// gdb-command:whatis unit

View file

@ -6,6 +6,7 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// gdb-command:run

View file

@ -6,6 +6,7 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -2,6 +2,7 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -2,6 +2,7 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ edition:2021
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================
// gdb-command:run

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ edition:2021
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================
// gdb-command:run

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -6,6 +6,7 @@
// without collapse_debuginfo attribute.
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -3,11 +3,12 @@
// Test that static debug info is not collapsed with #[collapse_debuginfo(external)]
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================
// gdb-command:info line collapse_debuginfo_static_external::FOO
// gdb-check:[...]Line 15[...]
// gdb-check:[...]Line 16[...]
#[collapse_debuginfo(external)]
macro_rules! decl_foo {

View file

@ -3,11 +3,12 @@
// Test that static debug info is collapsed with #[collapse_debuginfo(yes)]
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================
// gdb-command:info line collapse_debuginfo_static::FOO
// gdb-check:[...]Line 19[...]
// gdb-check:[...]Line 20[...]
#[collapse_debuginfo(yes)]
macro_rules! decl_foo {

View file

@ -1,6 +1,7 @@
//@ min-lldb-version: 310
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -6,6 +6,7 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -3,6 +3,7 @@ extern crate cross_crate_spans;
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -3,6 +3,7 @@ extern crate cross_crate_debuginfo_type_uniquing;
//@ no-prefer-dynamic
//@ compile-flags:-g -C lto
//@ ignore-backends: gcc
pub struct C;
pub fn p() -> C {

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,6 +1,7 @@
//@ min-lldb-version: 310
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -63,6 +63,7 @@
#![debugger_visualizer(gdb_script_file = "embedded-visualizer.py")]
//@ aux-build: dependency-with-embedded-visualizers.rs
//@ ignore-backends: gcc
extern crate dependency_with_embedded_visualizers;
use dependency_with_embedded_visualizers::Person;

View file

@ -1,6 +1,7 @@
//@ ignore-windows-gnu: #128981
//@ ignore-android: FIXME(#10381)
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,6 +1,7 @@
//@ min-lldb-version: 1800
//@ compile-flags:-g -Z thinlto
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================
// gdb-command:run

View file

@ -9,6 +9,7 @@
//@ compile-flags:-g -Zmir-enable-passes=-SingleUseConsts
// SingleUseConsts shouldn't need to be disabled, see #128945
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -2,6 +2,7 @@
//@ min-gdb-version: 10.1
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -3,6 +3,7 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -4,6 +4,7 @@
//@ min-gdb-version: 11.2
//@ compile-flags: -g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -2,6 +2,7 @@
//@ ignore-android: FIXME(#10381)
//@ compile-flags:-g
//@ ignore-backends: gcc
// gdb-command: run

View file

@ -2,6 +2,7 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================
// gdb-command:run

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// gdb-command:run

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// gdb-command:set print union on
// gdb-command:run

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -3,6 +3,7 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// gdb-command:run
// gdb-command:print string1.length
// gdb-check:$1 = 48

View file

@ -4,6 +4,7 @@
//@ min-lldb-version: 1800
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,4 +1,5 @@
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ==================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -2,6 +2,7 @@
//@ compile-flags:-C debuginfo=1
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// Make sure functions have proper names
// gdb-command:info functions

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -3,6 +3,7 @@
//@ compile-flags:-g -Ccodegen-units=2
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===============================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ min-gdb-version: 10.1
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================
// gdb-command:run

View file

@ -9,6 +9,7 @@
// unblock the tree.
//@ only-64bit
//@ min-cdb-version: 10.0.26100.2161
//@ ignore-backends: gcc
// Tests the visualizations for `NonZero<T>`, `Wrapping<T>` and
// `Atomic{Bool,I8,I16,I32,I64,Isize,U8,U16,U32,U64,Usize}` located in `libcore.natvis`.

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -2,6 +2,7 @@
//@ ignore-android: FIXME(#10381)
//@ ignore-aix: FIXME(#137965)
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,6 +1,7 @@
//@ ignore-android: FIXME(#10381)
//@ ignore-windows-gnu: #128981
//@ compile-flags:-g
//@ ignore-backends: gcc
// gdb-command: run

View file

@ -1,6 +1,7 @@
//@ ignore-android: FIXME(#10381)
//@ ignore-windows-gnu: #128981
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -4,6 +4,7 @@
//@ compile-flags:-g
//@ min-lldb-version: 1800
//@ min-cdb-version: 10.0.18317.1001
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,6 +1,7 @@
//@ ignore-windows-gnu: #128981
//@ ignore-android: FIXME(#10381)
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -2,6 +2,7 @@
//@ compile-flags:-g
//@ min-cdb-version: 10.0.18317.1001
//@ ignore-backends: gcc
// === GDB TESTS ==================================================================================

View file

@ -2,6 +2,7 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// gdb-command:run

View file

@ -4,6 +4,7 @@
//
//@ compile-flags:-g -Zmir-enable-passes=+ReferencePropagation,-ConstDebugInfo
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,4 +1,5 @@
//@ compile-flags:-g
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -8,6 +8,7 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// gdb-command:run
// gdb-command:print vi8x16

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags: -g -Zmir-enable-passes=-CheckAlignment
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

View file

@ -1,5 +1,6 @@
//@ compile-flags:-g
//@ disable-gdb-pretty-printers
//@ ignore-backends: gcc
// === GDB TESTS ===================================================================================

Some files were not shown because too many files have changed in this diff Show more