[clang] [flang] [flang][AIX] Enable -b flag (PR #235101)

Tarun Prabhu via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 25 11:53:08 PDT 2026


================
@@ -92,6 +92,18 @@
 ! NO-PIE-NOT: "-pie"
 ! UNUSED: warning: argument unused during compilation: '{{(-no)?}}-pie'
 ! ------------------------------------------------------------------------------
+!
+! On AIX, '-b <arg>' is passed to the linker.
+! RUN: %flang --target=powerpc-ibm-aix -bmaxdata:0x80000000 -### %s 2>&1 \
+! RUN:   | FileCheck %s --check-prefix=B-OPT
+! RUN: %flang --target=powerpc-ibm-aix -b maxdata:0x80000000 -### %s 2>&1 \
+! RUN:   | FileCheck %s --check-prefix=B-OPT
+! RUN: not %flang --target=x86_64-unknown-linux-gnu -bmaxdata:0x80000000 -### %s 2>&1 \
+! RUN:   | FileCheck %s --check-prefix=B-OPT-NON-AIX
+!
+! B-OPT: "-b" "maxdata:0x80000000"
----------------
tarunprabhu wrote:

Ideally, we should check that `-b` appears in the linker invocation. In general, that's difficult to do because the name of the linker executable, and the arguments passed to it, vary a lot across systems. However, since this test targets a single platform, is it something that can be done reliably there? If so, we should do it, but it's probably not worth putting too much effort into.

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


More information about the cfe-commits mailing list