From dfa4110ec6e41bb4027a3c77c14f25f05bd44f44 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Tue, 11 Jul 2017 15:50:48 +0000 Subject: [PATCH] NetBSD uses soft-float by default, unless the environment is EABIHF or GNUEABIHF. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307665 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains/Arch/ARM.cpp | 12 ++++++++++++ test/Preprocessor/init.c | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/lib/Driver/ToolChains/Arch/ARM.cpp b/lib/Driver/ToolChains/Arch/ARM.cpp index 8cafd3c74b..95b86f784f 100644 --- a/lib/Driver/ToolChains/Arch/ARM.cpp +++ b/lib/Driver/ToolChains/Arch/ARM.cpp @@ -179,6 +179,18 @@ arm::FloatABI arm::getARMFloatABI(const ToolChain &TC, const ArgList &Args) { ABI = FloatABI::Hard; break; + case llvm::Triple::NetBSD: + switch (Triple.getEnvironment()) { + case llvm::Triple::EABIHF: + case llvm::Triple::GNUEABIHF: + ABI = FloatABI::Hard; + break; + default: + ABI = FloatABI::Soft; + break; + } + break; + case llvm::Triple::FreeBSD: switch (Triple.getEnvironment()) { case llvm::Triple::GNUEABIHF: diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index f7b14f7b76..0ee7edecb3 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -2333,6 +2333,7 @@ // ARM-NETBSD:#define __SIZE_MAX__ 4294967295UL // ARM-NETBSD:#define __SIZE_TYPE__ long unsigned int // ARM-NETBSD:#define __SIZE_WIDTH__ 32 +// ARM-NETBSD:#define __SOFTFP__ 1 // ARM-NETBSD:#define __UINT16_C_SUFFIX__ // ARM-NETBSD:#define __UINT16_MAX__ 65535 // ARM-NETBSD:#define __UINT16_TYPE__ unsigned short @@ -2377,6 +2378,11 @@ // ARM-NETBSD:#define __arm 1 // ARM-NETBSD:#define __arm__ 1 +// RUN: %clang -E -dM -ffreestanding -target arm-netbsd-eabihf %s -o - | FileCheck -match-full-lines -check-prefix ARMHF-NETBSD %s +// ARMHF-NETBSD:#define __SIZE_WIDTH__ 32 +// ARMHF-NETBSD-NOT:#define __SOFTFP__ 1 +// ARMHF-NETBSD:#define __UINT16_C_SUFFIX__ + // RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-none-eabi < /dev/null | FileCheck -match-full-lines -check-prefix ARM-NONE-EABI %s // RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-none-eabihf < /dev/null | FileCheck -match-full-lines -check-prefix ARM-NONE-EABI %s // RUN: %clang_cc1 -E -dM -ffreestanding -triple=aarch64-none-eabi < /dev/null | FileCheck -match-full-lines -check-prefix ARM-NONE-EABI %s -- 2.40.0