1 ! Verify that the Fortran runtime libraries are present in the linker
2 ! invocation. These libraries are added on top of other standard runtime
3 ! libraries that the Clang driver will include.
5 ! RUN: %flang -### -flang-experimental-exec -target ppc64le-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,GNU
6 ! RUN: %flang -### -flang-experimental-exec -target aarch64-apple-darwin %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,DARWIN
7 ! RUN: %flang -### -flang-experimental-exec -target x86_64-windows-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MINGW
9 ! NOTE: Clang's driver library, clangDriver, usually adds 'libcmt' and
10 ! 'oldnames' on Windows, but they are not needed when compiling
11 ! Fortran code and they might bring in additional dependencies.
12 ! Make sure they're not added.
13 ! RUN: %flang -### -flang-experimental-exec -target aarch64-windows-msvc %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MSVC --implicit-check-not libcmt --implicit-check-not oldnames
15 ! Compiler invocation to generate the object file
16 ! CHECK-LABEL: {{.*}} "-emit-obj"
17 ! CHECK-SAME: "-o" "[[object_file:.*\.o]]" {{.*}}Inputs/hello.f90
19 ! Linker invocation to generate the executable
20 ! GNU-LABEL: "{{.*}}ld"
21 ! GNU-SAME: "[[object_file]]"
22 ! GNU-SAME: -lFortran_main
23 ! GNU-SAME: -lFortranRuntime
24 ! GNU-SAME: -lFortranDecimal
27 ! DARWIN-LABEL: "{{.*}}ld"
28 ! DARWIN-SAME: "[[object_file]]"
29 ! DARWIN-SAME: -lFortran_main
30 ! DARWIN-SAME: -lFortranRuntime
31 ! DARWIN-SAME: -lFortranDecimal
33 ! MINGW-LABEL: "{{.*}}ld"
34 ! MINGW-SAME: "[[object_file]]"
35 ! MINGW-SAME: -lFortran_main
36 ! MINGW-SAME: -lFortranRuntime
37 ! MINGW-SAME: -lFortranDecimal
39 ! NOTE: This also matches lld-link (when CLANG_DEFAULT_LINKER=lld) and
40 ! any .exe suffix that is added when resolving to the full path of
41 ! (lld-)link.exe on Windows platforms. The suffix may not be added
42 ! when the executable is not found or on non-Windows platforms.
44 ! MSVC-SAME: Fortran_main.lib
45 ! MSVC-SAME: FortranRuntime.lib
46 ! MSVC-SAME: FortranDecimal.lib
47 ! MSVC-SAME: /subsystem:console
48 ! MSVC-SAME: "[[object_file]]"