Skip to content

Commit d9614c6

Browse files
committed
Combine --gcc-toolchain and -gcc-install-dir tests.
Also fix -help output checks.
1 parent 6abdea9 commit d9614c6

File tree

5 files changed

+24
-32
lines changed

5 files changed

+24
-32
lines changed

flang/test/Driver/driver-help-hidden.f90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@
104104
! CHECK-NEXT: -fversion-loops-for-stride
105105
! CHECK-NEXT: Create unit-strided versions of loops
106106
! CHECK-NEXT: -fxor-operator Enable .XOR. as a synonym of .NEQV.
107+
! CHECK-NEXT: --gcc-install-dir=<value>
108+
! CHECK-NEXT: Use GCC installation in the specified directory. The directory ends with path components like 'lib{,32,64}/gcc{,-cross}/$triple/$version'. Note: executables (e.g. ld) used by the compiler are not overridden by the selected GCC installation
109+
! CHECK-NEXT: --gcc-toolchain=<value> Specify a directory where Clang can find 'include' and 'lib{,32,64}/gcc{,-cross}/$triple/$version'. Clang will use the GCC installation with the largest version
107110
! CHECK-NEXT: -gline-directives-only Emit debug line info directives only
108111
! CHECK-NEXT: -gline-tables-only Emit debug line number tables only
109112
! CHECK-NEXT: -gpulibc Link the LLVM C Library for GPUs

flang/test/Driver/driver-help.f90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
! HELP-NEXT: -fversion-loops-for-stride
9393
! HELP-NEXT: Create unit-strided versions of loops
9494
! HELP-NEXT: -fxor-operator Enable .XOR. as a synonym of .NEQV.
95+
! HELP-NEXT: --gcc-install-dir=<value>
96+
! HELP-NEXT: Use GCC installation in the specified directory. The directory ends with path components like 'lib{,32,64}/gcc{,-cross}/$triple/$version'. Note: executables (e.g. ld) used by the compiler are not overridden by the selected GCC installation
97+
! HELP-NEXT: --gcc-toolchain=<value> Specify a directory where Clang can find 'include' and 'lib{,32,64}/gcc{,-cross}/$triple/$version'. Clang will use the GCC installation with the largest version
9598
! HELP-NEXT: -gline-directives-only Emit debug line info directives only
9699
! HELP-NEXT: -gline-tables-only Emit debug line number tables only
97100
! HELP-NEXT: -gpulibc Link the LLVM C Library for GPUs

flang/test/Driver/gcc-install-dir.f90

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
!! Test that --gcc-toolchain and --gcc-install-dir options are working as expected.
2+
!! It does not test cross-compiling (--sysroot), so crtbegin.o, libgcc/compiler-rt, libc, libFortranRuntime, etc. are not supposed to be affected.
3+
4+
! RUN: %flang 2>&1 -### -o %t %s -no-integrated-as -fuse-ld=ld --target=i386-unknown-linux-gnu --gcc-toolchain=%S/Inputs/basic_cross_linux_tree/usr | FileCheck %s --check-prefix=CHECK-I386
5+
! RUN: %flang 2>&1 -### -o %t %s -no-integrated-as -fuse-ld=ld --target=i386-unknown-linux-gnu --gcc-install-dir=%S/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/10.2.0 | FileCheck %s --check-prefix=CHECK-I386
6+
! CHECK-I386: "-fc1" "-triple" "i386-unknown-linux-gnu"
7+
! CHECK-I386: "[[PREFIX:[^"]+]]/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/10.2.0/../../../../i386-unknown-linux-gnu/bin{{/|\\\\}}as"
8+
! CHECK-I386: "[[PREFIX]]/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/10.2.0/../../../../i386-unknown-linux-gnu/bin{{/|\\\\}}ld" {{.*}} "-m" "elf_i386"
9+
! CHECK-I386-SAME: "-L[[PREFIX]]/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/10.2.0"
10+
! CHECK-I386-SAME: "-L[[PREFIX]]/Inputs/basic_cross_linux_tree/usr/lib/gcc/i386-unknown-linux-gnu/10.2.0/../../../../i386-unknown-linux-gnu/lib"
11+
12+
! RUN: %flang 2>&1 -### -o %t %s -no-integrated-as -fuse-ld=ld --target=x86_64-unknown-linux-gnu --gcc-toolchain=%S/Inputs/basic_cross_linux_tree/usr | FileCheck %s --check-prefix=CHECK-X86-64
13+
! RUN: %flang 2>&1 -### -o %t %s -no-integrated-as -fuse-ld=ld --target=x86_64-unknown-linux-gnu --gcc-install-dir=%S/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0 | FileCheck %s --check-prefix=CHECK-X86-64
14+
! CHECK-X86-64: "-fc1" "-triple" "x86_64-unknown-linux-gnu"
15+
! CHECK-X86-64: "[[PREFIX:[^"]+]]/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\\\}}as" "--64"
16+
! CHECK-X86-64: "[[PREFIX]]/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin{{/|\\\\}}ld" {{.*}} "-m" "elf_x86_64"
17+
! CHECK-X86-64-SAME: "-L[[PREFIX]]/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0"
18+
! CHECK-X86-64-SAME: "-L[[PREFIX]]/Inputs/basic_cross_linux_tree/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/lib"

flang/test/Driver/gcc-toolchain.f90

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)