Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions src/ci/docker/host-x86_64/optional-x86_64-gnu-autodiff/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
ninja-build \
file \
curl \
ca-certificates \
python3 \
git \
cmake \
pkg-config \
xz-utils \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

ENV NO_DOWNLOAD_CI_LLVM 1
ENV CODEGEN_BACKENDS llvm

ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
--enable-llvm-enzyme \
--enable-llvm-link-shared \
--enable-ninja \
--enable-option-checking \
--disable-docs \
--set llvm.download-ci-llvm=false

ENV SCRIPT="../x.py test --stage 2 --no-fail-fast \
tests/codegen-llvm/autodiff \
tests/pretty/autodiff \
tests/ui/autodiff \
tests/ui/feature-gates/feature-gate-autodiff.rs"
5 changes: 5 additions & 0 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,11 @@ auto:
- name: x86_64-gnu-miri
<<: *job-linux-4c

- name: optional-x86_64-gnu-autodiff
continue_on_error: true
doc_url: https://rustc-dev-guide.rust-lang.org/tests/autodiff-ci-job.html
<<: *job-linux-4c

####################
# macOS Builders #
####################
Expand Down
1 change: 1 addition & 0 deletions src/doc/rustc-dev-guide/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- [Cranelift codegen backend](./tests/codegen-backend-tests/cg_clif.md)
- [GCC codegen backend](./tests/codegen-backend-tests/cg_gcc.md)
- [Performance testing](./tests/perf.md)
- [Autodiff CI job](./tests/autodiff-ci-job.md)
- [Pre-stabilization CI job for the next solver and polonius alpha](./tests/x86_64-gnu-next-trait-solver-polonius-ci-job.md)
- [Misc info](./tests/misc.md)
- [Debugging the compiler](./compiler-debugging.md)
Expand Down
45 changes: 45 additions & 0 deletions src/doc/rustc-dev-guide/src/tests/autodiff-ci-job.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Autodiff CI job

The [`optional-x86_64-gnu-autodiff`] job provides continuous test coverage for
the experimental `autodiff` feature and its integration with LLVM Enzyme. It is
an optional [auto job](./ci.md#auto-builds), so a failure does not prevent a
pull request from being merged.

For more context about the feature, see the [autodiff tracking issue] and the
[autodiff internals](../autodiff/internals.md) chapter.

## What is tested

The job checks:

- forward- and reverse-mode macro expansion and diagnostics;
- LLVM IR generation for autodiff;
- enforcement of the `autodiff` feature gate.

## Running the job

To run the job in a try build, comment on a pull request:

```text
@bors try jobs=optional-x86_64-gnu-autodiff
```

To run the job locally, run this command from a Rust checkout:

```console
$ cargo run --manifest-path src/ci/citool/Cargo.toml run-local optional-x86_64-gnu-autodiff
```

See [Testing with Docker](./docker.md) for more information about running CI
jobs locally.

## Point of contact

If you have questions or need help with a failure in this job, open a new topic
in the [autodiff Zulip channel]. For suspected Enzyme backend failures, see the
[autodiff debugging guide].

[autodiff Zulip channel]: https://rust-lang.zulipchat.com/#narrow/channel/390790-wg-autodiff
[autodiff debugging guide]: ../autodiff/debugging.md
[autodiff tracking issue]: https://github.com/rust-lang/rust/issues/124509
[`optional-x86_64-gnu-autodiff`]: https://github.com/rust-lang/rust/blob/HEAD/src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/51655>.
//! This used to ICE.
//@ check-pass

#![allow(dead_code)]

const PATH_DOT: &[u8] = &[b'.'];
Expand Down
13 changes: 13 additions & 0 deletions tests/ui/crate-loading/missing-target-error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/37131>.
//! Tests that compiling for a target which is not installed will result in a helpful
//! error message.
//~^^^ ERROR can't find crate for `std`
//~| NOTE target may not be installed
//~| NOTE can't find crate

//@ compile-flags: --target=thumbv6m-none-eabi
//@ ignore-arm
//@ needs-llvm-components: arm
//@ ignore-backends: gcc

fn main() { }
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use std::fmt;
//! Auxiliary file for <https://github.com/rust-lang/rust/issues/24687>.
//! This is a file with many multi-byte characters, to try to encourage
//! the compiler to trip on them. The Drop implementation below will
//! need to have its source location embedded into the debug info for
//! the output file.

// This ia file with many multi-byte characters, to try to encourage
// the compiler to trip on them. The Drop implementation below will
// need to have its source location embedded into the debug info for
// the output file.
use std::fmt;

// αααααααααααααααααααααααααααααααααααααααααααααααααααααααααααααααααααααα
// ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/debuginfo/auxiliary/cross-crate-multibyte-debuginfo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//! Auxiliary file for <https://github.com/rust-lang/rust/issues/24687>.
//! This is a file that pulls in a separate file as a submodule, where
//! that separate file has many multi-byte characters, to try to
//! encourage the compiler to trip on them.
#![crate_type="lib"]

#[path = "cross-crate-multibyte-debuginfo-comments.rs"]
mod issue_24687_mbcs_in_comments;

pub use issue_24687_mbcs_in_comments::D;
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/24687>.
//@ run-pass
//@ aux-build:issue-24687-lib.rs
//@ aux-build:cross-crate-multibyte-debuginfo.rs
//@ compile-flags:-g

extern crate issue_24687_lib as d;
extern crate cross_crate_multibyte_debuginfo as d;

fn main() {
// Create a `D`, which has a destructor whose body will be codegen'ed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/37510>.
//! Test that else-if after if-let is not considered a pattern guard.
//@ check-pass

fn foo(_: &mut i32) -> bool { true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/50618>.
//! This used to ICE.

struct Point {
pub x: u64,
pub y: u64,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0560]: struct `Point` has no field named `nonexistent`
--> $DIR/issue-50618.rs:14:13
--> $DIR/fru-unknown-field-in-closure.rs:17:13
|
LL | nonexistent: 0,
| ^^^^^^^^^^^ `Point` does not have this field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/38556>.
//! Reexport in macro caused ICE.
//@ run-pass

#![allow(dead_code)]
pub struct Foo;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/51116>.
//! This used to leak internal `__next` ident into suggestion.

fn main() {
let tiles = Default::default();
for row in &mut tiles {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0282]: type annotations needed
--> $DIR/issue-51116.rs:5:13
--> $DIR/for-loop-nested-array-inference.rs:8:13
|
LL | *tile = 0;
| ^^^^^ cannot infer type
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions tests/ui/issues/issue-37131.rs

This file was deleted.

8 changes: 0 additions & 8 deletions tests/ui/issues/issue-3779.rs

This file was deleted.

17 changes: 0 additions & 17 deletions tests/ui/issues/issue-3779.stderr

This file was deleted.

8 changes: 0 additions & 8 deletions tests/ui/issues/issue-5315.rs

This file was deleted.

27 changes: 0 additions & 27 deletions tests/ui/issues/issue-67039-unsound-pin-partialeq.rs

This file was deleted.

13 changes: 0 additions & 13 deletions tests/ui/issues/issue-67039-unsound-pin-partialeq.stderr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/37884>.
//! This used to leak compiler data structures in error message.
//@ dont-require-annotations: NOTE

struct RepeatMut<'a, T>(T, &'a ());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0308]: method not compatible with trait
--> $DIR/issue-37884.rs:8:5
--> $DIR/iterator-next-extra-named-lifetime.rs:10:5
|
LL | fn next(&'a mut self) -> Option<Self::Item>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
Expand All @@ -9,7 +9,7 @@ LL | fn next(&'a mut self) -> Option<Self::Item>
note: the anonymous lifetime as defined here...
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
note: ...does not necessarily outlive the lifetime `'a` as defined here
--> $DIR/issue-37884.rs:5:6
--> $DIR/iterator-next-extra-named-lifetime.rs:7:6
|
LL | impl<'a, T: 'a> Iterator for RepeatMut<'a, T> {
| ^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#![allow(unused_macros)]

// Tests that repetition matchers cannot match the empty token tree (since that would be
// ambiguous).
//! Regression test for <https://github.com/rust-lang/rust/issues/5067>.
//! Tests that repetition matchers cannot match the empty token tree (since that would be
//! ambiguous).

//@ edition:2018

#![allow(unused_macros)]

macro_rules! foo {
( $()* ) => {};
//~^ ERROR repetition matches empty token tree
Expand Down
Loading
Loading