Add test that ensures that an avr-libc in $SYSROOT/avr is found, modeled after the similar test checking for $SYSROOT/usr/lib/avr.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/test/Driver/avr-toolchain.c | ||
---|---|---|
22–23 | Please do not change existing tests, you can add new lines. |
We need not add another basic_avr_tree_opt_local, since you added /avr to possible avr-libc pathes, you can test your change by specifying --sysroot %S/Inputs/basic_avr_tree/usr/lib/ .
Sorry, only spefifying --sysroot %S/Inputs/basic_avr_tree/usr/lib/ does not work, since the search for avr-ld also relies on --sysroot.
So I suggest adding a new dir name avr inside Inputs/basic_avr_tree/, and also put a copy of the fake avr-libc files at Inputs/basic_avr_tree/avr.
In this way the searchs for both avr-gcc and avr-libc should work.
For the purpose of the test, that doesn't matter, since we're just looking for the existence of the -internal-isystem argument.
clang/test/Driver/avr-toolchain.c | ||
---|---|---|
29 | Please use the pattern in linux-cross.cpp |
clang/test/Driver/avr-toolchain.c | ||
---|---|---|
29 | To be clear, which pattern? Placing each checked argument in its own check line? I'm happy to do that, although the other tests here don't do so... |
Rebase atop recent changes; use separate check lines and string substitution for SYSROOT.
--sysroot %S/Inputs/basic_avr_tree/usr/lib seems incorrect.
sysroot is usually a directory which contains usr/lib and lib/. somewhere/usr/lib is not usually used as a sysroot.
Yeah, I agree it's weird. This is basically a shortcut to avoid creating a duplicate sysroot in Inputs. Would you prefer I create the duplicate tree?
It seems we need not adding this test, since a similiar test is added in https://reviews.llvm.org/rGb31199bab4865deef4e778d7a028c8ec64285654
Please do not change existing tests, you can add new lines.