Skip to content

[send-non-sendable] Convert some of the concurrency tests that test targeted concurrency to also test complete and complete + sis #68195

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

Merged

Conversation

gottesmm
Copy link
Contributor

In this PR, there are three commits:

  1. The first adds a new option to the diagnostic verifier called '-verify-additional-prefix' This allows for one to create customized expected-$PREFIX{error,warning,note,remark} that one can conditionally enable/disable. This allows for us in a single concurrency test, test targeted, complete, and complete + send non sendable so we can analyze the diagnostics.
  2. I went through a bunch of the sendable tests that were just doing type checking and converted them to instead use emit-sil tests. Since we also emit type checker errors there I erred on the side of making the change even if it seemed that we were only checking type checker stuff.
  3. I updated some of the main sendable tests to test with strict-concurrency={targeted,complete,complete+sns} using the feature from 1.

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@hborla hborla requested review from DougGregor and hborla August 29, 2023 21:18
@gottesmm gottesmm force-pushed the pr-1f647dd0c785123c93b7a25e78addfca45c2b473 branch from 4910a6f to 0df1ab8 Compare August 30, 2023 19:59
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

@swift-ci test windows platform

…tional check prefixes to the DiagnosticVerifier.

This enables one to use varying prefixes when checking diagnostics with the
DiagnosticVerifier. So for instance, I can make a test work both with and
without send-non-sendable enabled by adding additional prefixes. As an example:

```swift
// RUN: %target-swift-frontend ... -verify-additional-prefix no-sns-
// RUN: %target-swift-frontend ... -verify-additional-prefix sns-

let x = ... // expected-error {{This is always checked no matter what prefixes I added}}
let y = ... // expected-no-sns-error {{This is only checked if send non sendable is disabled}}
let z = ... // expected-sns-error {{This is only checked if send non sendable is enabled}}
let w = ... // expected-no-sns-error {{This is checked for a specific error when sns is disabled...}}
// expected-sns-error @-1 {{and for a different error when sns is enabled}}
```

rdar://114643840
…ll concurrency modes as appropriate.

This means that:

1. In test cases where minimal is the default (swift 5 without
-warn-concurrency), I added RUN lines for targeted, complete, and complete +
sns.

2. In test cases where complete is the default (swift 6, -warn-concurrency,
specified complete with -strict-concurrency), I added a send non-sendable run
line.

In each of these cases, I added additional expected-* lines as appropriate so
the tests can compile in each mode successfully.
… main Concurrency test directory.

I added a sendnonsendable_ prefix to the test names so we still know they are
for sendnonsendable.
@gottesmm gottesmm force-pushed the pr-1f647dd0c785123c93b7a25e78addfca45c2b473 branch from 0df1ab8 to e8448ee Compare August 30, 2023 20:40
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test linux platform

1 similar comment
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test linux platform

@gottesmm gottesmm merged commit 5c3a580 into swiftlang:main Aug 31, 2023
beccadax added a commit that referenced this pull request Sep 13, 2024
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.

1 participant