diff options
-rw-r--r-- | lib/Basic/Targets.cpp | 4 | ||||
-rw-r--r-- | lib/Driver/Tools.cpp | 3 | ||||
-rw-r--r-- | test/Driver/arm-alignment.c | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 87ecc57b0d..4397c7a677 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -4452,10 +4452,6 @@ public: if (Feature[0] == '+') Features[Feature+1] = true; - if (ArchVersion < 6 || - (ArchVersion == 6 && ArchProfile == llvm::ARM::PK_M)) - Features["strict-align"] = true; - return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec); } diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 1b42ff70f2..649f90784e 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -834,7 +834,8 @@ static void getARMTargetFeatures(const ToolChain &TC, // The above behavior is consistent with GCC. int VersionNum = getARMSubArchVersionNumber(Triple); if (Triple.isOSDarwin() || Triple.isOSNetBSD()) { - if (VersionNum < 6) + if (VersionNum < 6 || + Triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v6m) Features.push_back("+strict-align"); } else if (Triple.isOSLinux() || Triple.isOSNaCl()) { if (VersionNum < 7) diff --git a/test/Driver/arm-alignment.c b/test/Driver/arm-alignment.c index 21a29192a5..3e21652039 100644 --- a/test/Driver/arm-alignment.c +++ b/test/Driver/arm-alignment.c @@ -59,6 +59,12 @@ // RUN: %clang -target armv6-unknown-nacl-gnueabihf -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s +// RUN: %clang -target armv6m-apple-darwin -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s + +// RUN: %clang -target armv6m-netbsd-eabi -### %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-ALIGNED-ARM < %t %s + // RUN: %clang -target aarch64-none-gnueabi -mno-unaligned-access -### %s 2> %t // RUN: FileCheck --check-prefix=CHECK-ALIGNED-AARCH64 < %t %s |