This test ensures that llvm-nm will omit NULL symbol.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
20 ms | LLVM.tools/llvm-nm::Unknown Unit Message ("") |
Event Timeline
llvm/test/tools/llvm-nm/debug-syms.test | ||
---|---|---|
46 | I am not an expert in llvm-nm, but is debug-syms.test is a right place for this test? | |
47 | You have already tested --debug-syms/-a at the first lines. No need to test them again. | |
66 | Usually local symbols go first. | |
67 | Is it important to have "Section"? | |
70 | I think you can add DynamicSymbols to the first description and have a single YAML. |
Addressed comment.
- Use a single YAML file.
- Test --dynamic/-D
- Remove unrelated/unwanted fields
llvm/test/tools/llvm-nm/debug-syms.test | ||
---|---|---|
67 |
I think it's important. We use --implicit-check-not U to detect NULL symbol, so we should specify section field for symbols. |
--debug-syms may be legacy cruft of GNU nm. An x86 nm does not hide $a $t mapping symbols. I wonder whether we should drop the auto-hide logic.
Mapping symbols are an ARM thing. If we are dumping an ARM object, we should hide the mapping symbols for compatibility (I see people iterating over lists of symbols dumped by nm, so we can't change this behaviour). Obviously, if this isn't an ARM object, they aren't mapping symbols, and should be dumped.
I'm somewhat concerned by the --implicit-check-not U usage to ensure no undefined symbol is printed, as it feels fragile. I'd prefer a more stringent check like --implicit-check-not={{.}}. That will ensure that there is no output other than the checked output.
llvm/test/tools/llvm-nm/debug-syms.test | ||
---|---|---|
5–9 | Here and below, please add the letter column. This will help ensure the --implicit-check-not U is clearer. | |
16 | No need for two blank lines. | |
46 | I would suggest that a --dynamic dedicated test file makes sense, but that this test case here in this file also makes sense. |
llvm/test/tools/llvm-nm/debug-syms.test | ||
---|---|---|
46 |
Yeah, I've also came to it. Though we probably should not test -D here s it probably enough to test it once in a " --dynamic dedicated test file" |
Addressed comments.
- Remove test for --debug-syms -D (Leave it to a --dynamic dedicated test file)
- Use --implicit-check-not {{.}} for a more stringent check.
LGTM. @Higuoxing, would you mind writing a separate dedicated test for --dynamic? It would allow for testing the corner cases, which are outside the scope of this test file. It can be a separate patch, no problem.
LGTM. You can delete unneeded Phabricator tags with:
% which arcfilter arcfilter () { git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend -F - }
before committing.
Here and below, please add the letter column. This will help ensure the --implicit-check-not U is clearer.