The test had a few style issues, and I noticed a hole in the coverage (namely that the search order wasn't tested). Adding cases for the hole in turn meant other cases weren't important.
The .so test case isn't important, since the code is shared code, so I've removed it. Additionally, I've modified the usage of the "bar" directive to show that an unneeded library must still be present, or the link will fail, even though it isn't linked in.
Up to you, but Inputs/deplibs-lib_foo.s can also be removed. It is small and thus inlining it helps reading.
echo '.globl foo; foo:' | llvm-mc -filetype=obj -triple=x86_64 - -o %tfoo.o (most -unknown-linux are not useful)