[clang] [llvm] [ARM] Emit an error when the hard-float ABI is enabled but can't be used. (PR #111334)

Chris Copeland via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 22 00:25:12 PST 2024


================
@@ -16,7 +16,7 @@
 
 // RUN: %clang --target=arm-none-eabi -mcpu=cortex-m33 -mfloat-abi=hard -O1 %s -flto=thin -c -o %t.call_thin.bc -DCALL_LIB
 // RUN: %clang --target=arm-none-eabi -mcpu=cortex-m33 -mfloat-abi=hard -O1 %s -flto=thin -c -o %t.define_thin.bc -DDEFINE_LIB
-// RUN: llvm-lto2 run -o %t.lto_thin -save-temps %t.call_thin.bc %t.define_thin.bc \
+// RUN: llvm-lto2 run --mcpu=cortex-m33 --float-abi=hard -o %t.lto_thin -save-temps %t.call_thin.bc %t.define_thin.bc \
----------------
chrisnc wrote:

I dug into this further as promised, and the error goes away for this test if you just remove the call to `printf` from the test, which the test expects to replace with a call to putchar. This means that the `llvm-lto2` invocation is eventually creating a new subtarget in which the target features and ABI are not inherited from the settings of either input file, and because the ones it lands on are incompatible, an error is raised. Pre-existing functions that were generated with a specific ABI and features are preserved as you would expect.

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


More information about the cfe-commits mailing list