-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Emit default arg for a package func during silgen #69414
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
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.
Could you add a test to test/TBD
that exercises this and uses -validate-tbd-against-ir
?
|
||
// RUN: %target-build-swift -I %t -L %t -lUtils %s -o %t/main %target-rpath(%t) -package-name mypkg | ||
|
||
// RUN: %target-run %t/main %t/%target-library-name(Utils) > %t/run-result.output |
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.
Seems like this test may need a REQUIRES: executable_test
. I would also organize it under test/Interpreter
rather than test/Sema
.
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.
will do
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.
does the test really need to be executable? I think test/TBD/ is the best place for it and it should not be executable, just check that the symbol appears in the TBD.
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.
You don't even need to write any CHECK:
lines in a TBD test for this, the -validate-tbd-against-ir
infrastructure does all the validation automatically by matching up the tbd contents and LLVM IR.
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.
you're right we don't need an executable; removed, added the flag, and moved to test/tbd.
in TBD, causing a linker error. This is because the default arg is not generated during silgen. This PR adds a check to make sure it's represented by SILDeclRef and its linkage emitted. Resolves rdar://116184295
@swift-ci smoke test |
@swift-ci smoke test |
If a package func has a default arg, its symbol is not generated
in TBD, causing a linker error. This is because the default arg
is not generated during silgen. This PR adds a check to make sure
it's represented by SILDeclRef and its linkage emitted.
Resolves rdar://116184295