-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix Interpreter/dynamic_self.swift test for ExistentialSpecializer #24411
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
Conversation
@swift-ci test. |
@swift-ci test linux |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should comment why the attribute is necessary, at least in the commit message but preferably in test itself--the optimizer may specialize the call and attempt to inline, but inlining that would defeat the purpose of the test which is intended to exercise IRGen on these function bodies. Inlining may also cause self
to be destroyed before the print statement executes.
@rajbarik Does the behavior of the test change without the |
@atrick I don't understand what you're suggesting here. Optimizations should never change the behavior of any code. The test is run with both optimizations off and on (check-swift-validation and check-swift-validation-optimize) and the latter has caught optimizer bugs before. |
Oh I see. How about we just remove the print statements from the deinits. |
@slavapestov I think it's a problem in general when IRGen unit tests are written in .swift. I agree it's best not to change the RUN line. So the question is whether you still want the test to be useful at -O. My point is that if the test is actually useful, then those print statements will be in the correct order. It seems strange to me to write passing CHECKs for a test that's already broken. But I don't have a strong opinion. |
@atrick The part of the test that tests when the deinit occurs is not very useful. We should remove it. The rest is still useful. It's mostly an execution test for code generated by IRGen, but it has randomly turned up optimizer crashes in the past, mostly because our coverage of DyamicSelfType elsewhere in the optimizer wasn't great. |
@slavapestov sounds fine to me. I was just guessing at the purpose of the test, and couldn't help but notice that IRGen will never even see a @rajbarik I guess you can just remove the print statements in the deinitializers, then you don't need the |
77f476f
to
4a23442
Compare
@swift-ci test. |
@swift-ci test linux |
Build failed |
@swift-ci test. |
Build failed |
Build failed |
No description provided.