Author: ctopper Date: Tue Oct 31 19:18:49 2017 New Revision: 317069 URL: http://llvm.org/viewvc/llvm-project?rev=317069&view=rev Log: [X86] Define i586 and pentium preprocessor defines for -march=lakemont to match GCC
Modified: cfe/trunk/lib/Basic/Targets/X86.cpp cfe/trunk/test/Preprocessor/predefined-arch-macros.c Modified: cfe/trunk/lib/Basic/Targets/X86.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/X86.cpp?rev=317069&r1=317068&r2=317069&view=diff ============================================================================== --- cfe/trunk/lib/Basic/Targets/X86.cpp (original) +++ cfe/trunk/lib/Basic/Targets/X86.cpp Tue Oct 31 19:18:49 2017 @@ -852,6 +852,8 @@ void X86TargetInfo::getTargetDefines(con 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: Modified: cfe/trunk/test/Preprocessor/predefined-arch-macros.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/predefined-arch-macros.c?rev=317069&r1=317068&r2=317069&view=diff ============================================================================== --- cfe/trunk/test/Preprocessor/predefined-arch-macros.c (original) +++ cfe/trunk/test/Preprocessor/predefined-arch-macros.c Tue Oct 31 19:18:49 2017 @@ -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 \ _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits