================
@@ -48,3 +48,17 @@
 ! MSVC-SAME: FortranDecimal.lib
 ! MSVC-SAME: /subsystem:console
 ! MSVC-SAME: "[[object_file]]"
+
+! Verify that certain linker flags are known to the frontend and are passed on
+! to the linker.
+
+! RUN: %flang -### --target=x86_64-linux-gnu -rpath /path/to/dir -shared \
+! RUN:     -static %s 2>&1 | FileCheck \
+! RUN:     --check-prefixes=CHECK-LINKER-OPTIONS,GNU-LINKER-OPTIONS %s
+! RUN: %flang -### --target=x86_64-windows-msvc -rpath /path/to/dir -shared \
+! RUN:     -static %s 2>&1 | FileCheck \
+! RUN:     --check-prefixes=CHECK-LINKER-OPTIONS,MSVC-LINKER-OPTIONS %s
+! CHECK-LINKER-OPTIONS-DAG: "-rpath" "/path/to/dir"
+! GNU-LINKER-OPTIONS-DAG: "-shared"
+! MSVC-LINKER-OPTIONS-DAG: "-dll"
+! GNU-LINKER-OPTIONS-DAG: "-static"
----------------
tarunprabhu wrote:

>     I would separate the two things into different files.

Done.

>     * Why would we test `-shared` and `-static` in one invocation?

This was because of a suggestion by @MaskRay [in an earlier 
comment](https://github.com/llvm/llvm-project/pull/66702#discussion_r1331136897)

>     * We should make sure that what's being tested is indeed the linker 
> invocation.

Done.



https://github.com/llvm/llvm-project/pull/66702
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to