This change adds testing for handling of bitcode files in archives, particularly the creation of symbol tables and through MRI scripts. Although there is some testing of bitcode handling in the archive library testing, this was not covered.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/tools/llvm-ar/bitcode-add.ll | ||
---|---|---|
4–5 ↗ | (On Diff #442110) | Fold these two into one line and then cd into them immediately before doing the mkdir and llvm-as commands, so that you can drop the %t from those commands. |
11 ↗ | (On Diff #442110) | I'd add c to this command, to suppress the new archive creation warning (it's not generally an issue, but could cause confusion if a user tried to inspect the verbose output or run the command directly and started getting additional output). Ditto elsewhere in the file. |
15 ↗ | (On Diff #442110) | Should you check that there are no other files too (e.g. by adding --implicit-check-not={{.}} to your FileCheck command)? |
17–18 ↗ | (On Diff #442110) | This is only going to prevent ldata and lfunc appearing before gdata and gfunc. Given that you sort before the checks, this will always pass, regardless of whats in the output! You probably want to be using --implicit-check-not={{.}} and check the entire contents of the output (using SYMS-NEXT as appropriate too for improved output messages). |
30 ↗ | (On Diff #442110) | |
31 ↗ | (On Diff #442110) | What's in the output in this case? Can we check for that and use --implicit-check-not={{.}} to make the test more robust to changes in how the "Archive map" header is formatted? |
38 ↗ | (On Diff #442110) | These "update" test cases are about creating a symbol table in an existing archive, but the test is called "bitcode-add.ll". Is the test misnamed? These update cases, aren't really "adding" anything. |
41 ↗ | (On Diff #442110) | |
48 ↗ | (On Diff #442110) | Do you need the S here? What does suppressing the archive symtab in this case actually achieve? Ditto below. |
60–62 ↗ | (On Diff #442110) | Again, not a test case to do with "adding" anything. |
llvm/test/tools/llvm-ar/mri-bitcode.ll | ||
1 ↗ | (On Diff #442110) | This test basically looks identical to the other test, except that MRI scripts are used to drive the program. I feel like it would be better to include the MRI cases alongside the non-MRI cases in the same test file. |
Combined tests into one file, added us of --implicit-check-not, supressed archive creation warnings and fixed comments.
llvm/test/tools/llvm-ar/bitcode-add.ll | ||
---|---|---|
38 ↗ | (On Diff #442110) | I agree the test is poorly named, hopefully the more general name is more fitting? |
60 ↗ | (On Diff #442110) | I forgot to change these uses of %t, I'll fix it. |
60–62 ↗ | (On Diff #442110) | As mentioned above. |
llvm/test/tools/llvm-ar/mri-bitcode.ll | ||
1 ↗ | (On Diff #442110) | Agreed, I've combined them. |
Looks good once the outstanding comments have been addressed.
llvm/test/tools/llvm-ar/bitcode.ll | ||
---|---|---|
82 | This comment looks garbled. |
As far as I can tell, this test doesn't pass: http://45.33.8.238/linux/81164/step_12.txt
Please take a look and revert for now if it takes a while to fix.
The issue stemmed from the output of sort differing between OS, removing it's use should fix things.
These lines can use -NEXT: