[clang] [flang][Driver] Support -rpath, -shared, and -static in the frontend (PR #66702)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 21 11:13:54 PDT 2023


================
@@ -50,3 +50,15 @@
 ! 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 -### -rpath /path/to/dir -shared -static %s 2>&1 \
+! RUN:   | FileCheck --check-prefix=CHECK-LINKER-FLAGS %s
+! CHECK-LINKER-FLAGS: ld
+! CHECK-LINKER-FLAGS-DAG: "-rpath" "/path/to/dir"
+! CHECK-LINKER-FLAGS-DAG: "-shared"
+! CHECK-LINKER-FLAGS-DAG: "-static"
+
----------------
MaskRay wrote:

Delete trailing blank lines

Flags mean boolean options. Better to rename the prefix.

https://github.com/llvm/llvm-project/pull/66702


More information about the cfe-commits mailing list