[llvm] [Mips] Derive module ABI flags from a function definition (PR #220672)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 03:16:04 PDT 2026


================
@@ -0,0 +1,53 @@
+; When the target machine has no feature string of its own, the module's ABI
+; flags are derived from a function's target attributes. Check the two cases
+; where the function they used to be read from carries no attributes: a module
+; starting with a declaration, and a module with no functions at all.
+
+; RUN: split-file %s %t
+; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips32 \
+; RUN:     %t/single-float.ll -o %t/single-float.o
+; RUN: llvm-readobj -A %t/single-float.o | FileCheck %s -check-prefix=SINGLE
+; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips32 \
+; RUN:     %t/soft-float.ll -o %t/soft-float.o
+; RUN: llvm-readobj -A %t/soft-float.o | FileCheck %s -check-prefix=SOFT
+; RUN: llc -filetype=asm -mtriple mipsel-unknown-linux -mcpu=mips32 \
+; RUN:     %t/soft-float.ll -o - | FileCheck %s -check-prefix=SOFT-ASM
+; RUN: llc -filetype=obj -mtriple mipsel-unknown-linux -mcpu=mips32 \
+; RUN:     %t/no-functions.ll -o %t/no-functions.o
+; RUN: llvm-readobj -A %t/no-functions.o | FileCheck %s -check-prefix=NONE
+
+; RUN: llc -filetype=asm -mtriple mips64-unknown-linux -target-abi o32 \
----------------
arsenm wrote:

Don't need -filetype=asm. Also consistently use = form of arguments?

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


More information about the llvm-commits mailing list