[X86] Define i586 and pentium preprocessor defines for -march=lakemont to match GCC

llvm-svn: 317069
This commit is contained in:
Craig Topper 2017-11-01 02:18:49 +00:00
parent 700b1f8a56
commit a2b907a469
2 changed files with 13 additions and 7 deletions

View 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:

View File

@ -1158,15 +1158,19 @@
//
// 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 \