A user can force a function to be inlined by specifying the always_inline attribute. Currently, thinlto implementation is not aware of always_inline functions and does not guarantee import of such functions, which in turn can prevent inlining of such functions.
Thanks for working on this! One suggestion for test cleanup below.
I don't think you need all these calls to @bar (or any, or the def of @bar). I believe this was from another test that was testing the import-instr-limit. Since you have 0 you don't need anything here.