1 ! Verify that certain linker flags are known to the frontend and are passed on
4 ! RUN: %flang -### --target=x86_64-linux-gnu -rpath /path/to/dir -shared \
5 ! RUN: -static %s 2>&1 | FileCheck \
6 ! RUN: --check-prefixes=GNU-LINKER-OPTIONS \
7 ! RUN: --implicit-check-not=GNU-LINKER-OPTIONS-NOT %s
8 ! RUN: %flang -### --target=x86_64-windows-msvc -rpath /path/to/dir -shared \
9 ! RUN: -static %s 2>&1 | FileCheck \
10 ! RUN: --check-prefixes=MSVC-LINKER-OPTIONS \
11 ! RUN: --implicit-check-not=MSVC-LINKER-OPTIONS-NOT %s
12 ! RUN: %flang -### --target=aarch64-linux-none -rdynamic %s 2>&1 | FileCheck --check-prefixes=RDYNAMIC-LINKER-OPTION %s
14 ! TODO: Could the linker have an extension or a suffix?
15 ! GNU-LINKER-OPTIONS: "{{.*}}ld{{(.exe)?}}"
16 ! GNU-LINKER-OPTIONS-SAME: "-shared"
17 ! GNU-LINKER-OPTIONS-SAME: "-static"
18 ! GNU-LINKER-OPTIONS-SAME: "-rpath" "/path/to/dir"
19 ! GNU-LINKER-OPTIONS-NOT: "-lFortran_main.a"
21 ! RDYNAMIC-LINKER-OPTION: "{{.*}}ld"
22 ! RDYNAMIC-LINKER-OPTION-SAME: "-export-dynamic"
24 ! For MSVC, adding -static does not add any additional linker options.
25 ! MSVC-LINKER-OPTIONS: "{{.*}}link{{(.exe)?}}"
26 ! MSVC-LINKER-OPTIONS-SAME: "-dll"
27 ! MSVC-LINKER-OPTIONS-SAME: "-rpath" "/path/to/dir"
28 ! MSVC-LINKER-OPTIONS-NOT: "/WHOLEARCHIVE:Fortran_main"