]> granicus.if.org Git - clang/commitdiff
[X86] Define i586 and pentium preprocessor defines for -march=lakemont to match GCC
authorCraig Topper <craig.topper@intel.com>
Wed, 1 Nov 2017 02:18:49 +0000 (02:18 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 1 Nov 2017 02:18:49 +0000 (02:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317069 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets/X86.cpp
test/Preprocessor/predefined-arch-macros.c

index 93dcd4e234c8176a7a5bd610bd761741ccd0e969..ee70c14e1d2f3b708f31f263aad14c69aaa2bfc6 100644 (file)
@@ -852,6 +852,8 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
   case CK_KNM:
     break;
   case CK_Lakemont:
+    defineCPUMacros(Builder, "i586", /*Tuning*/false);
+    defineCPUMacros(Builder, "pentium", /*Tuning*/false);
     Builder.defineMacro("__tune_lakemont__");
     break;
   case CK_K6_2:
index 2f3d9e30475cd0852ae1932ffc8f0473880a8388..d7c10cec58caaefab9d4b3803c746cd3d4cc1c98 100644 (file)
 //
 // RUN: %clang -march=lakemont -m32 -E -dM %s -o - 2>&1 \
 // RUN:     -target i386-unknown-linux \
-// RUN:   | FileCheck %s -check-prefix=CHECK_LMT_M32
-// CHECK_LMT_M32: #define __i386 1
-// CHECK_LMT_M32: #define __i386__ 1
-// CHECK_LMT_M32: #define __tune_lakemont__ 1
-// CHECK_LMT_M32: #define i386 1
+// RUN:   | FileCheck %s -check-prefix=CHECK_LAKEMONT_M32
+// CHECK_LAKEMONT_M32: #define __i386 1
+// CHECK_LAKEMONT_M32: #define __i386__ 1
+// CHECK_LAKEMONT_M32: #define __i586 1
+// CHECK_LAKEMONT_M32: #define __i586__ 1
+// CHECK_LAKEMONT_M32: #define __pentium 1
+// CHECK_LAKEMONT_M32: #define __pentium__ 1
+// CHECK_LAKEMONT_M32: #define __tune_lakemont__ 1
+// CHECK_LAKEMONT_M32: #define i386 1
 // RUN: not %clang -march=lakemont -m64 -E -dM %s -o - 2>&1 \
 // RUN:     -target i386-unknown-linux \
-// RUN:   | FileCheck %s -check-prefix=CHECK_LMT_M64
-// CHECK_LMT_M64: error:
+// RUN:   | FileCheck %s -check-prefix=CHECK_LAKEMONT_M64
+// CHECK_LAKEMONT_M64: error:
 //
 // RUN: %clang -march=geode -m32 -E -dM %s -o - 2>&1 \
 // RUN:     -target i386-unknown-linux \