Driver test cross-linux.c fails when CLANG_DEFAULT_RTLIB is "compiler-rt"
as the it expects a GCC-style "crtbegin.o" after "crti.o" but instead
receives something akin to this in the frontend invocation:
"crt1.o" "crti.o" "/o/b/llvm-test/v10.0.4010/bin/../lib/clang/10.0.4010/lib/linux/clang_rt.crtbegin-x86_64.o"
In lib/Driver/ToolChain.cpp it's implied that using --rtlib=platform is
acceptable in tests to override the configuration-time default.
// Only use "platform" in tests to override CLANG_DEFAULT_RTLIB // ... else if (LibName == "platform") return GetDefaultRuntimeLibType();
This patch adds said override to cross-linux.c tests so the expected result
is produced regardless of the compile-time default rtlib, as having tests
fail due to that is fairly confusing. After applying the patch, the test passes
regardless of the CLANG_DEFAULT_RTLIB setting.
nb. Originally ran across this issue in D69758.
clang-format: please reformat the code
-// CHECK-I386: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/../../../../i386-unknown-linux-gnu/bin{{/|\\\\}}as" "--32" -// CHECK-I386: "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/../../../../i386-unknown-linux-gnu/bin{{/|\\\\}}ld" {{.*}} "-m" "elf_i386" +// CHECK-I386: +// "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/../../../../i386-unknown-linux-gnu/bin{{/|\\\\}}as" +// "--32" CHECK-I386: +// "{{.*}}/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/4.6.0/../../../../i386-unknown-linux-gnu/bin{{/|\\\\}}ld" +// {{.*}} "-m" "elf_i386"