r211792 - ARM: Correctly identify cortex-m4 as v7em.
Jim Grosbach
grosbach at apple.com
Thu Jun 26 10:24:16 PDT 2014
Author: grosbach
Date: Thu Jun 26 12:24:16 2014
New Revision: 211792
URL: http://llvm.org/viewvc/llvm-project?rev=211792&view=rev
Log:
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
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Preprocessor/macho-embedded-predefines.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=211792&r1=211791&r2=211792&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Jun 26 12:24:16 2014
@@ -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);
Modified: cfe/trunk/test/Preprocessor/macho-embedded-predefines.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/macho-embedded-predefines.c?rev=211792&r1=211791&r2=211792&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/macho-embedded-predefines.c (original)
+++ cfe/trunk/test/Preprocessor/macho-embedded-predefines.c Thu Jun 26 12:24:16 2014
@@ -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__
More information about the cfe-commits
mailing list