[flang] Use clang sysroot image to test fastmath linking
authorTom Eccles <tom.eccles@arm.com>
Sat, 28 Jan 2023 13:45:44 +0000 (13:45 +0000)
committerTom Eccles <tom.eccles@arm.com>
Wed, 8 Feb 2023 10:01:09 +0000 (10:01 +0000)
This test has been very unreliable across different machines. Update it
to use clang's sysroot image so that the fastmath object file name is
stable across different distributions and distro types.

Based on clang/test/Driver/linux-ld.c

Thanks to mnadeem for pointing this out at https://reviews.llvm.org/D138675

Differential Revision: https://reviews.llvm.org/D142807

flang/test/Driver/fast_math.f90

index 996fdf0..aadd723 100644 (file)
@@ -70,6 +70,8 @@
 ! UNSUPPORTED: system-windows
 ! UNSUPPORTED: target=powerpc{{.*}}
 ! RUN: %flang -ffast-math -### %s -o %t 2>&1 \
+! RUN:           --target=x86_64-unknown-linux -no-pie --gcc-toolchain="" \
+! RUN:           --sysroot=%S/../../../clang/test/Driver/Inputs/basic_linux_tree \
 ! RUN:     | FileCheck --check-prefix=CHECK-CRT %s
 ! CHECK-CRT: {{crtbegin.?\.o}}
 ! CHECK-CRT-SAME: crtfastmath.o