[llvm] ARM: Read float ABI from the "float-abi" module flag (PR #212981)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 01:49:02 PDT 2026


================
@@ -0,0 +1,43 @@
+; The "float-abi" module flag selects the floating-point calling convention.
+; RUN: split-file %s %t
+
+; Hard float ABI module flag: FP argument returned in a VFP register (s0).
+; RUN: llc -mtriple=armv7-none-eabi -mattr=+vfp3 < %t/hard.ll | FileCheck %s --check-prefix=HARD
+
+; Soft float ABI module flag: FP argument returned in a GPR (r0).
+; RUN: llc -mtriple=armv7-none-eabi -mattr=+vfp3 < %t/soft.ll | FileCheck %s --check-prefix=SOFT
+
+; No module flag: the -float-abi command-line option still applies.
+; RUN: llc -mtriple=armv7-none-eabi -mattr=+vfp3 -float-abi=hard < %t/none.ll | FileCheck %s --check-prefix=HARD
+; RUN: llc -mtriple=armv7-none-eabi -mattr=+vfp3 -float-abi=soft < %t/none.ll | FileCheck %s --check-prefix=SOFT
+
+; The module flag overrides the target-default soft ABI even without -float-abi.
----------------
smithp35 wrote:

Agreed, although the comment says
> ; The module flag overrides the target-default soft ABI even without -float-abi.

It perhaps ought to say.
``` When there is no module flag, the target-default is soft ABI.```

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


More information about the llvm-commits mailing list