[clang] [flang] [Flang] [Driver] Add -fplt and -fno-plt options (PR #235622)

Tarun Prabhu via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 27 06:07:44 PDT 2026


================
@@ -0,0 +1,39 @@
+! Test -f[no-]plt.
+! The driver forwards -fno-plt only for ELF x86 and AArch64. The default is
+! PLT, so -fplt is not forwarded. Other targets warn that the flag is unused.
+! In codegen, -fno-plt marks external procedures nonlazybind and requests GOT
+! for compiler-rt. A procedure defined in this file is left unchanged.
+! The default, and -fplt after -fno-plt, do neither.
+
+! RUN: %flang -### --target=x86_64-unknown-linux-gnu -fno-plt %s 2>&1 | FileCheck %s --check-prefixes=FC1,DRIVER-NOPLT
+! RUN: %flang -### --target=aarch64-unknown-linux-gnu -fno-plt %s 2>&1 | FileCheck %s --check-prefixes=FC1,DRIVER-NOPLT
+! RUN: %flang -### --target=x86_64-unknown-linux-gnu -fplt -fno-plt %s 2>&1 | FileCheck %s --check-prefixes=FC1,DRIVER-NOPLT
+! RUN: %flang -### --target=x86_64-unknown-linux-gnu %s 2>&1 | FileCheck %s --check-prefixes=FC1,DRIVER-PLT
----------------
tarunprabhu wrote:

nit: Could you move this to be he first test. It is just more organized if the very first test is the default where no flags are given.

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


More information about the cfe-commits mailing list