From: Jim Grosbach Date: Thu, 26 Jun 2014 17:24:16 +0000 (+0000) Subject: ARM: Correctly identify cortex-m4 as v7em. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be83cb8c96c2630817283844611bad86e8ef41da;p=platform%2Fupstream%2Fllvm.git ARM: Correctly identify cortex-m4 as v7em. Get the predefined macro for the architecture correct. cortex-m4: __ARM_ARCH_7EM__ cortex-m3: __ARM_ARCH_7M__ cortex-m0: __ARM_ARCH_6M__ rdar://17420090 llvm-svn: 211792 --- diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index fde4284..33ea6fb 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -3840,7 +3840,8 @@ public: .Cases("cortex-r4", "cortex-r5", "7R") .Case("swift", "7S") .Case("cyclone", "8A") - .Cases("cortex-m3", "cortex-m4", "7M") + .Case("cortex-m3", "7M") + .Case("cortex-m4", "7EM") .Case("cortex-m0", "6M") .Cases("cortex-a53", "cortex-a57", "8A") .Default(nullptr); diff --git a/clang/test/Preprocessor/macho-embedded-predefines.c b/clang/test/Preprocessor/macho-embedded-predefines.c index 8356bc9..74f2919 100644 --- a/clang/test/Preprocessor/macho-embedded-predefines.c +++ b/clang/test/Preprocessor/macho-embedded-predefines.c @@ -1,5 +1,20 @@ -// RUN: %clang_cc1 -E -dM -triple thumbv7m-apple-unknown-macho %s | FileCheck %s +// RUN: %clang_cc1 -E -dM -triple thumbv7m-apple-unknown-macho -target-cpu cortex-m3 %s | FileCheck %s -check-prefix CHECK-7M -// CHECK: #define __APPLE_CC__ -// CHECK: #define __APPLE__ -// CHECK-NOT: #define __MACH__ +// CHECK-7M: #define __APPLE_CC__ +// CHECK-7M: #define __APPLE__ +// CHECK-7M: #define __ARM_ARCH_7M__ +// CHECK-7M-NOT: #define __MACH__ + +// RUN: %clang_cc1 -E -dM -triple thumbv7em-apple-unknown-macho -target-cpu cortex-m4 %s | FileCheck %s -check-prefix CHECK-7EM + +// CHECK-7EM: #define __APPLE_CC__ +// CHECK-7EM: #define __APPLE__ +// CHECK-7EM: #define __ARM_ARCH_7EM__ +// CHECK-7EM-NOT: #define __MACH__ + +// RUN: %clang_cc1 -E -dM -triple thumbv6m-apple-unknown-macho -target-cpu cortex-m0 %s | FileCheck %s -check-prefix CHECK-6M + +// CHECK-6M: #define __APPLE_CC__ +// CHECK-6M: #define __APPLE__ +// CHECK-6M: #define __ARM_ARCH_6M__ +// CHECK-6M-NOT: #define __MACH__