[flang-rt][lit] Set dynamic library lookup path for shared runtime tests (#244114)
When the shared Fortran runtime (libflang_rt.runtime) is built, tests
that execute compiled binaries fail on macOS because the test RUN lines
only set LD_LIBRARY_PATH, which dyld ignores, and the test binaries do
not embed an LC_RPATH to the resource library directory.
This patch adopts the approach used in compiler-rt
(push_dynamic_library_lookup_path) to automatically set the appropriate
dynamic library lookup variable across platforms (DYLD_LIBRARY_PATH on
macOS, LD_LIBRARY_PATH on Linux, PATH on Windows, and LIBPATH on AIX).
Assisted-by: IBM Bob