-
-
Notifications
You must be signed in to change notification settings - Fork 608
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
Fix issue 19329 pragms(lib) and pragma(linkerDirective) can emit dupl… #12308
Conversation
|
Thanks for your pull request and interest in making D better, @thewilsonator! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.
|
6830951
to
7dba6c4
Compare
|
this should be good to go mod tests, cc @TurkeyMan |
aba2d2f
to
2522f0f
Compare
Maybe create a |
|
ping @thewilsonator |
|
You could also try to override the linker to check the arguments (as done for E.g. enum LIB = "uniqueLibraryName1234";
version (AS_TEST)
{
// Insert actual test here
pragma(lib, LIB);
// ...
}
else:
import std.algorithm;
import std.stdio;
import dshell;
int main(const string[] args)
{
// Cannot easily override the linker on windows
if (OS == "windows")
return DISABLED;
// Invoked as CC?
if (args.length > 1)
{
const num = args.count!(a => a.canFind(LIB));
if (num == 1)
return 0;
writeln();
writeln(num ? "Passed `LIB` multiple times!" : "Didn't pass `LIB` at all!");
writeln(args);
writeln();
return 1;
}
// Recompile this file as the test defined above
string cmd = "$DMD -m$MODEL -version=AS_TEST -od=$OUTPUT_BASE " ~ __FILE_FULL_PATH__;
string[string] env = [
"DFLAGS": "",
"CC": args[0],
];
return tryRun(parseCommand(cmd), stdout, stderr, env);
} |
|
ping @thewilsonator |
|
@thewilsonator please add the test suggested by @MoonlightSentinel so that we can get this in. |
…icate entries to the object
2522f0f
to
7d9d59f
Compare
…icate entries to the object
Not sure how to write a test for this