[clang][ARM] follow GCC behavior for defining __SOFTFP__
authorTies Stuij <ties.stuij@arm.com>
Tue, 18 Oct 2022 12:47:03 +0000 (13:47 +0100)
committerTies Stuij <ties.stuij@arm.com>
Tue, 18 Oct 2022 13:38:03 +0000 (14:38 +0100)
commit95bbe9a1930886cffc79f1f5b953f5aafff1557f
tree7b1898acc351ef3d0a0c3b05e1b726a27ed58bde
parentbb3c90d3ecd142e60cf994338bdd4b59d8788cd3
[clang][ARM] follow GCC behavior for defining __SOFTFP__

GCC behavior regarding defining __SOFTFP__ when (implicitly) specifying
-mfloat-abi=softfp:
- compile without (implicit) FP: define __SOFTFP__
- compile with (implicit) FP: don't define __SOFTFP__

Currently Clang doesn't define __SOFTFP__ when softfp is specified, either with
or without FP. This patch brings Clang in line with GCC behavior.

This was raised by itaig1 over on Github:
https://github.com/llvm/llvm-project/issues/55755

Reviewed By: pratlucas

Differential Revision: https://reviews.llvm.org/D135680
clang/lib/Basic/Targets/ARM.cpp
clang/test/Preprocessor/init-arm.c