Skip to content

Improve attr_implements_fp.swift test. #20841

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
merged 10 commits into from
Nov 29, 2018
Merged

Improve attr_implements_fp.swift test. #20841

merged 10 commits into from
Nov 29, 2018

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Nov 28, 2018

Several small changes:

  • Ensure that it tests calling both variants from generic contexts.
  • Use a new protocol rather than Comparable so that we can ensure this works properly with designated types
  • Restate the requirement for comparison as a @_nonoverride.
  • Actually make use of designated types, ensuring that we produce the expected result.

@rudkx
Copy link
Contributor Author

rudkx commented Nov 28, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Nov 29, 2018

@swift-ci Please smoke test

@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: echo 'main()' >%t/main.swift
// RUN: %target-swiftc_driver -o %t/a.out %s %t/main.swift -Xfrontend -enable-operator-designated-types -Xfrontend -solver-enable-operator-designated-types
// RUN: %target-swiftc_driver -Xfrontend -enable-operator-designated-types -Xfrontend -solver-enable-operator-designated-types -o %t/a.out %s %t/main.swift
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're improving this test anyway, please use %target-build-swift instead of %target-swiftc_driver, which includes things like -module-cache-path.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Okay, that one specifically is in both, but there are some other options that are only in target-build-swift. And I should probably look into whether we still need both.)

@rudkx
Copy link
Contributor Author

rudkx commented Nov 29, 2018

Interesting. Swapping the position of the frontend arguments doesn't make any difference, but running tests with build-script rather than lit does (the latter passing, which is how I've been testing it).

This reverts commit 0346fed.

It turns out moving these arguments didn't result in this test
passing. For some reason it's failing with `build-script -t`, but
passing with `lit`.
This also builds `attr_implements_fp.swift`, and then uses it, so it
also needed updating.
@rudkx
Copy link
Contributor Author

rudkx commented Nov 29, 2018

Oh actually it's attr_implements_serial.swift that is failing.

@rudkx
Copy link
Contributor Author

rudkx commented Nov 29, 2018

@swift-ci Please smoke test

@rudkx rudkx merged commit 11131c4 into swiftlang:master Nov 29, 2018
@rudkx rudkx deleted the update-implements-test branch November 29, 2018 18:47
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.

3 participants