This is an archive of the discontinued LLVM Phabricator instance.

Test data for symbol lookup. NFC
AbandonedPublic

Authored by sepavloff on May 3 2023, 9:10 AM.

Details

Summary

This change adds ELF file with different kinds of symbols to be used in
test for symbol lookup. It is a prerequisite for implementation of
symbol lookup in llvm-symbolizer.

Diff Detail

Event Timeline

sepavloff created this revision.May 3 2023, 9:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2023, 9:10 AM
sepavloff requested review of this revision.May 3 2023, 9:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2023, 9:10 AM

This patch only adds files to be used in another patch. It does not change any code or add any new tests and has no value of its own. It should be merged with the main patch, or relevant parts of D149759 should be moved here, whichever is preferable.

llvm/test/tools/llvm-symbolizer/Inputs/symbols.part3.c
13

Please remove the blank line at EOF

llvm/test/tools/llvm-symbolizer/Inputs/symbols.part4.c
14

Likewise

I wonder whether these files should go to cross-project-tests/

I wonder whether these files should go to cross-project-tests/

One of my original motivations for making cross-project-tests included finding a good way to runtime generate llvm-symbolizer test inputs (see https://lists.llvm.org/pipermail/llvm-dev/2021-January/148048.html), rather than relying on canned binaries, so I agree that it's likely a good idea to move those sorts of tests.

I wonder whether these files should go to cross-project-tests/

One of my original motivations for making cross-project-tests included finding a good way to runtime generate llvm-symbolizer test inputs (see https://lists.llvm.org/pipermail/llvm-dev/2021-January/148048.html), rather than relying on canned binaries, so I agree that it's likely a good idea to move those sorts of tests.

Conversely, all features should be tested in the subproject - cross-project-tests can be for broader integration testing, but it shouldn't mean we see code changes in subprojects without tests in those subprojects. If these tests are the "wider" sort of testing - testing interactions between different parts of the code, where the parts are tested each in isolation in the subproject, then that seems OK to me to move these wider tests out to cross-project-tests.

(maybe that's a formalization of the heuristic: All code should be covered, ideally all conditions should be falsifiable (eg: if you add a ! in some condition, a test should fail - though I understand this is a fairly high/lofty/not-often-achieved goal) by in-subproject tests, but checking that codepath A1 interacts well with codepath B2 may be more suitably done in cross-project-tests, for instance)

sepavloff updated this revision to Diff 555571.Sep 2 2023, 2:42 AM

Change the patch according to review notes

I don't think building test binaries in test time is possible for this particular case. The tests using the binary from here expect symbols at concrete locations. If something in code generation changes, and the locations become different, the tests would fail.

This patch only adds files to be used in another patch. It does not change any code or add any new tests and has no value of its own. It should be merged with the main patch, or relevant parts of D149759 should be moved here, whichever is preferable.

You are right, these changes are a part of D149759. They are however independent of it and moving them to a separate patch could facilitate the review process.

I don't think building test binaries in test time is possible for this particular case. The tests using the binary from here expect symbols at concrete locations. If something in code generation changes, and the locations become different, the tests would fail.

This patch only adds files to be used in another patch. It does not change any code or add any new tests and has no value of its own. It should be merged with the main patch, or relevant parts of D149759 should be moved here, whichever is preferable.

You are right, these changes are a part of D149759. They are however independent of it and moving them to a separate patch could facilitate the review process.

Precommitting tests is encouraged by some (I'm not a huge fan, but I appreciate the benefits) - the purpose is to precommit a running test that demonstrates the existing (problematic/broken/buggy/suboptimal) behavior, then when the fix is committed, it includes only the changes to the test that demonstrate the improvement/fix - this makes it easier to see the change the test causes (rather than seeing the whole test and being unsure about what part of what the test is testing is new/different behavior)

Committing the files without executing them as a test doesn't provide this value and shouldn't be done - then the files are committed without any verification of their behavior, obscuring their intent in this commit and in the subsequent bug fix.

Please either include a running test that verifies the buggy behavior in a precommit like this, or roll these files into the fix commit.

If @jhenderson would prefer them separate for review, but combined for commit, that's OK/I'll leave it up to him.

Strong +1 to what both @ikudrin and @dblaikie have said: these files on their own don't do anything useful (not even add a test), so they shouldn't be added on their own in a separate commit/review. Please merge them into the review that uses them, or create the test that uses them, but showing the old behaviour instead (I think the former is my preference in this context).

I think I have concerns about these files in their current state anyway, but I'd like to avoid commenting on them until they are in the "right" patch.

sepavloff abandoned this revision.Sep 25 2023, 2:06 AM

It has been merged to D149759.