This patch fixes llvm-link assertion when linking external variable
declaration with a definition with appending linkage.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Given the langref text I'm unsure what it means to link an append linkage variable to a non-append linkage one. I can see how extern is different but what would happen before & now if you remove the extern. And what happens before/now if you have append on both @var? We should add those tests if possible.
llvm/lib/Linker/IRMover.cpp | ||
---|---|---|
941 | parenthesis around the condition please. maybe move it to a new line given the complexity. |
Given the langref text I'm unsure what it means to link an append linkage variable to a non-append linkage one. I can see how extern is different but what would happen before & now if you remove the extern.
On current implementation llvm-link will die with an assertion no matter if extern is there or not. With this (updated) patch llvm-link will print an error message that both variables should have appending linkage (if extern is removed). I have added such test as well as few other negative tests.
And what happens before/now if you have append on both @var? We should add those tests if possible.
That should be fine, arrays from both vars will be appended in the result as described in the langref. This behavior is already checked by the following tests - Linker/AppendingLinkage.ll, Linker/AppendingLinkage2.ll.
parenthesis around the condition please. maybe move it to a new line given the complexity.