Skip to content
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

Document needs-target-has-atomic directive #2154

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Dec 2, 2024

@jieyouxu jieyouxu added S-blocked Status: this PR is blocked waiting for something A-compiletest Area: src/tools/compiletest A-test-suite Area: our test suite `tests/` T-compiler Relevant to compiler team T-bootstrap Relevant to bootstrap team labels Dec 2, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 2, 2024
…r=compiler-errors

Add `needs-target-has-atomic` directive

Before this PR, the test writer has to specify platforms and architectures by hand for targets that have differing atomic width support. `#[cfg(target_has_atomic="...")]` is not quite the same because (1) you may have to specify additional matchers manually which has to be maintained individually, and (2) the `#[cfg]` blocks does not communicate to compiletest that a test would be ignored for a given target.

This PR implements a `//@ needs-target-has-atomic` directive which admits a comma-separated list of required atomic widths that the target must satisfy in order for the test to run.

```
//@ needs-target-has-atomic: 8, 16, ptr
```

See <rust-lang#87377>.

This PR supersedes rust-lang#133095 and is co-authored by `@kei519,` because it was somewhat subtle, and it turned out easier to implement than to review.

rustc-dev-guide docs PR: rust-lang/rustc-dev-guide#2154
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 2, 2024
Rollup merge of rust-lang#133736 - jieyouxu:needs-target-has-atomic, r=compiler-errors

Add `needs-target-has-atomic` directive

Before this PR, the test writer has to specify platforms and architectures by hand for targets that have differing atomic width support. `#[cfg(target_has_atomic="...")]` is not quite the same because (1) you may have to specify additional matchers manually which has to be maintained individually, and (2) the `#[cfg]` blocks does not communicate to compiletest that a test would be ignored for a given target.

This PR implements a `//@ needs-target-has-atomic` directive which admits a comma-separated list of required atomic widths that the target must satisfy in order for the test to run.

```
//@ needs-target-has-atomic: 8, 16, ptr
```

See <rust-lang#87377>.

This PR supersedes rust-lang#133095 and is co-authored by `@kei519,` because it was somewhat subtle, and it turned out easier to implement than to review.

rustc-dev-guide docs PR: rust-lang/rustc-dev-guide#2154
@jieyouxu
Copy link
Member Author

jieyouxu commented Dec 5, 2024

Aur anur I forgot about this

@jieyouxu jieyouxu removed the S-blocked Status: this PR is blocked waiting for something label Dec 5, 2024
@jieyouxu jieyouxu marked this pull request as ready for review December 5, 2024 05:01
@jieyouxu jieyouxu merged commit e312507 into rust-lang:master Dec 5, 2024
1 check passed
@jieyouxu jieyouxu deleted the needs-target-has-atomic branch December 5, 2024 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: src/tools/compiletest A-test-suite Area: our test suite `tests/` T-bootstrap Relevant to bootstrap team T-compiler Relevant to compiler team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant