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

Update tests & docs for new atomic intrinsics without ordering restrictions #1487

Merged
merged 3 commits into from
Aug 11, 2022

Conversation

adpaco-aws
Copy link
Contributor

Description of changes:

Restrictions on memory orderings for atomic compare-exchange intrinsics were lifted about a month ago (see #1340 for more details).

These new orderings were already supported, but not tested. This PR updates the corresponding tests, and updates the intrinsics table including all changes in #1340 as well.

Resolved issues:

Resolves #1344

Call-outs:

No changes to the tests for the stable versions of these intrinsics (i.e., compare_exchange) have been made because the compiler throws errors such as:

error: `compare_exchange`'s success ordering must be at least as strong as its failure ordering
  --> main.rs:56:46
   |
56 |     assert!(a3.compare_exchange(true, false, Ordering::AcqRel, Ordering::SeqCst) == Ok(true));
   |                                              ^^^^^^^^^^^^^^^^  ---------------- `SeqCst` failure ordering
   |                                              |
   |                                              `AcqRel` success ordering
   |                                              help: consider using `SeqCst` success ordering instead
   |
   = note: `#[deny(invalid_atomic_ordering)]` on by default

Testing:

  • How is this change tested? Existing regression and adding more cases in related tests.

  • Is this a refactor change? No.

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@adpaco-aws adpaco-aws requested a review from a team as a code owner August 10, 2022 21:04
@adpaco-aws adpaco-aws merged commit 4f59fda into model-checking:main Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to new atomic instrinsics.
3 participants