brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.8 KiB · 2b56fdf Raw
90 lines · plain
1! Verify that the Fortran runtime libraries are present in the linker2! invocation. These libraries are added on top of other standard runtime3! libraries that the Clang driver will include.4 5! RUN: %flang -### --target=ppc64le-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,UNIX-F128%f128-lib6! RUN: %flang -### --target=sparc-sun-solaris2.11 %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,SOLARIS-F128%f128-lib7! RUN: %flang -### --target=x86_64-unknown-freebsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib8! RUN: %flang -### --target=x86_64-unknown-netbsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib9! RUN: %flang -### --target=x86_64-unknown-openbsd %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib10! RUN: %flang -### --target=x86_64-unknown-dragonfly %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD,BSD-F128%f128-lib11! RUN: %flang -### --target=aarch64-apple-darwin %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,DARWIN,DARWIN-F128%f128-lib12! RUN: %flang -### --target=x86_64-unknown-haiku %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,HAIKU,HAIKU-F128%f128-lib13! RUN: %flang -### --target=x86_64-windows-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MINGW,MINGW-F128%f128-lib14 15! RUN: %flang -### -rtlib=compiler-rt --target=aarch64-linux-gnu %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,UNIX,COMPILER-RT16 17! NOTE: Clang's driver library, clangDriver, usually adds 'oldnames' on Windows,18!       but it is not needed when compiling Fortran code and they might bring in19!       additional dependencies. Make sure its not added.20! RUN: %flang -### --target=aarch64-windows-msvc -fuse-ld= %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,MSVC --implicit-check-not oldnames21 22! RUN: %flang -### --target=ppc64le-linux-gnu -static-libflangrt %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=UNIX-STATIC-FLANGRT23! RUN: %flang -### --target=sparc-sun-solaris2.11 -static-libflangrt %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=UNIX-STATIC-FLANGRT24! RUN: %flang -### --target=x86_64-unknown-freebsd -static-libflangrt %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=BSD-STATIC-FLANGRT25! RUN: %flang -### --target=x86_64-unknown-netbsd -static-libflangrt %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=BSD-STATIC-FLANGRT26! RUN: %flang -### --target=x86_64-unknown-openbsd -static-libflangrt %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=BSD-STATIC-FLANGRT27! RUN: %flang -### --target=x86_64-unknown-dragonfly -static-libflangrt %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=CHECK,BSD-STATIC-FLANGRT28! RUN: %flang -### --target=aarch64-apple-darwin -static-libflangrt %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=DARWIN-STATIC-FLANGRT29! RUN: %flang -### --target=x86_64-unknown-haiku -static-libflangrt %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=HAIKU-STATIC-FLANGRT30! RUN: %flang -### --target=x86_64-windows-gnu -static-libflangrt %S/Inputs/hello.f90 2>&1 | FileCheck %s --check-prefixes=MINGW-STATIC-FLANGRT31 32! Compiler invocation to generate the object file33! CHECK-LABEL: {{.*}} "-emit-obj"34! CHECK-SAME:  "-o" "[[object_file:.*\.o]]" {{.*}}Inputs/hello.f9035 36! Linker invocation to generate the executable37! NOTE: Since we are cross-compiling, the host toolchain executables may38!       run on any other platform, such as Windows that use a .exe39!       suffix. Clang's driver will try to resolve the path to the ld40!       executable and may find the GNU linker from MinGW or Cygwin.41! UNIX-LABEL:  "{{.*}}ld{{(\.exe)?}}"42! UNIX-SAME: "[[object_file]]"43! UNIX-F128NONE-NOT: lang_rt.quadmath44! SOLARIS-F128NONE-NOT: flang_rt.quadmath45! UNIX-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"46! SOLARIS-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "-z" "ignore" "-lquadmath" "-z" "record"47! UNIX-SAME: "-lflang_rt.runtime" "-lm"48! COMPILER-RT: "{{.*}}{{\\|/}}libclang_rt.builtins.a"49! UNIX-STATIC-FLANGRT:   "{{.*}}{{\\|/}}libflang_rt.runtime.a"50 51! BSD-LABEL:  "{{.*}}ld{{(\.exe)?}}"52! BSD-SAME: "[[object_file]]"53! BSD-F128NONE-NOT: flang_rt.quadmath54! BSD-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"55! BSD-SAME: -lflang_rt.runtime56! BSD-SAME: -lexecinfo57! BSD-STATIC-FLANGRT: "{{.*}}{{\\|/}}libflang_rt.runtime.a"58 59! DARWIN-LABEL:  "{{.*}}ld{{(\.exe)?}}"60! DARWIN-SAME: "[[object_file]]"61! DARWIN-F128NONE-NOT: libflang_rt.quadmath62! DARWIN-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"63! DARWIN-SAME: -lflang_rt.runtime64! DARWIN-STATIC-FLANGRT: "{{.*}}{{\\|/}}libclang_rt.runtime_osx.a"65 66! HAIKU-LABEL:  "{{.*}}ld{{(\.exe)?}}"67! HAIKU-SAME: "[[object_file]]"68! HAIKU-F128NONE-NOT: libflang_rt.quadmath69! HAIKU-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"70! HAIKU-SAME: "-lflang_rt.runtime"71! HAIKU-STATIC-FLANGRT: "{{.*}}{{\\|/}}libflang_rt.runtime.a"72 73! MINGW-LABEL:  "{{.*}}ld{{(\.exe)?}}"74! MINGW-SAME: "[[object_file]]"75! MINGW-F128NONE-NOT: libflang_rt.quadmath76! MINGW-F128LIBQUADMATH-SAME: "-lflang_rt.quadmath" "--as-needed" "-lquadmath" "--no-as-needed"77! MINGW-SAME: -lflang_rt.runtime78! MINGW-STATIC-FLANGRT: "{{.*}}{{\\|/}}libflang_rt.runtime.a"79 80! NOTE: This also matches lld-link (when FLANG_DEFAULT_LINKER=lld) and81!       any .exe suffix that is added when resolving to the full path of82!       (lld-)link.exe on Windows platforms. The suffix may not be added83!       when the executable is not found or on non-Windows platforms.84! MSVC-LABEL: link85! MSVC-SAME: /subsystem:console86! MSVC-SAME: "[[object_file]]"87 88! COMPILER-RT-NOT: "-lgcc"89! COMPILER-RT-NOT: "-lgcc_s"90