[cfe-commits] r140688 - in /cfe/trunk: lib/Basic/Targets.cpp test/Preprocessor/predefined-arch-macros.c
Chandler Carruth
chandlerc at gmail.com
Wed Sep 28 02:45:09 PDT 2011
Author: chandlerc
Date: Wed Sep 28 04:45:08 2011
New Revision: 140688
URL: http://llvm.org/viewvc/llvm-project?rev=140688&view=rev
Log:
Teach Clang to reject 32-bit only CPUs when compiling in 64-bit mode.
Add 64-bit preprocessor macro tests.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/test/Preprocessor/predefined-arch-macros.c
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=140688&r1=140687&r2=140688&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Sep 28 04:45:08 2011
@@ -1378,8 +1378,65 @@
.Case("geode", CK_Geode)
.Default(CK_Generic);
- // FIXME: When in 64-bit mode, reject 32-bit only CPUs.
- return CPU != CK_Generic;
+ // Perform any per-CPU checks necessary to determine if this CPU is
+ // acceptable.
+ // FIXME: This results in terrible diagnostics. Clang just says the CPU is
+ // invalid without explaining *why*.
+ switch (CPU) {
+ case CK_Generic:
+ // No processor selected!
+ return false;
+
+ case CK_i386:
+ case CK_i486:
+ case CK_WinChipC6:
+ case CK_WinChip2:
+ case CK_C3:
+ case CK_i586:
+ case CK_Pentium:
+ case CK_PentiumMMX:
+ case CK_i686:
+ case CK_PentiumPro:
+ case CK_Pentium2:
+ case CK_Pentium3:
+ case CK_Pentium3M:
+ case CK_PentiumM:
+ case CK_Yonah:
+ case CK_C3_2:
+ case CK_Pentium4:
+ case CK_Pentium4M:
+ case CK_Prescott:
+ case CK_K6:
+ case CK_K6_2:
+ case CK_K6_3:
+ case CK_Athlon:
+ case CK_AthlonThunderbird:
+ case CK_Athlon4:
+ case CK_AthlonXP:
+ case CK_AthlonMP:
+ case CK_Geode:
+ // Only accept certain architectures when compiling in 32-bit mode.
+ if (PointerWidth != 32)
+ return false;
+
+ // Fallthrough
+ case CK_Nocona:
+ case CK_Core2:
+ case CK_Penryn:
+ case CK_Atom:
+ case CK_Corei7:
+ case CK_Corei7AVX:
+ case CK_CoreAVXi:
+ case CK_Athlon64:
+ case CK_Athlon64SSE3:
+ case CK_AthlonFX:
+ case CK_K8:
+ case CK_K8SSE3:
+ case CK_Opteron:
+ case CK_OpteronSSE3:
+ case CK_x86_64:
+ return true;
+ }
}
};
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=140688&r1=140687&r2=140688&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/predefined-arch-macros.c (original)
+++ cfe/trunk/test/Preprocessor/predefined-arch-macros.c Wed Sep 28 04:45:08 2011
@@ -7,6 +7,9 @@
// CHECK_I386_M32: #define __i386__ 1
// CHECK_I386_M32: #define __tune_i386__ 1
// CHECK_I386_M32: #define i386 1
+// RUN: %clang -march=i386 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_I386_M64
+// CHECK_I386_M64: error:
//
// RUN: %clang -march=i486 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_I486_M32
@@ -16,6 +19,9 @@
// CHECK_I486_M32: #define __i486__ 1
// CHECK_I486_M32: #define __tune_i486__ 1
// CHECK_I486_M32: #define i386 1
+// RUN: %clang -march=i486 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_I486_M64
+// CHECK_I486_M64: error:
//
// RUN: %clang -march=i586 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_I586_M32
@@ -28,6 +34,9 @@
// CHECK_I586_M32: #define __tune_i586__ 1
// CHECK_I586_M32: #define __tune_pentium__ 1
// CHECK_I586_M32: #define i386 1
+// RUN: %clang -march=i586 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_I586_M64
+// CHECK_I586_M64: error:
//
// RUN: %clang -march=pentium -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M32
@@ -40,6 +49,9 @@
// CHECK_PENTIUM_M32: #define __tune_i586__ 1
// CHECK_PENTIUM_M32: #define __tune_pentium__ 1
// CHECK_PENTIUM_M32: #define i386 1
+// RUN: %clang -march=pentium -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M64
+// CHECK_PENTIUM_M64: error:
//
// RUN: %clang -march=pentium-mmx -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_MMX_M32
@@ -54,6 +66,9 @@
// CHECK_PENTIUM_MMX_M32: #define __tune_pentium__ 1
// CHECK_PENTIUM_MMX_M32: #define __tune_pentium_mmx__ 1
// CHECK_PENTIUM_MMX_M32: #define i386 1
+// RUN: %clang -march=pentium-mmx -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_MMX_M64
+// CHECK_PENTIUM_MMX_M64: error:
//
// RUN: %clang -march=winchip-c6 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP_C6_M32
@@ -63,6 +78,9 @@
// CHECK_WINCHIP_C6_M32: #define __i486__ 1
// CHECK_WINCHIP_C6_M32: #define __tune_i486__ 1
// CHECK_WINCHIP_C6_M32: #define i386 1
+// RUN: %clang -march=winchip-c6 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP_C6_M64
+// CHECK_WINCHIP_C6_M64: error:
//
// RUN: %clang -march=winchip2 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP2_M32
@@ -72,6 +90,9 @@
// CHECK_WINCHIP2_M32: #define __i486__ 1
// CHECK_WINCHIP2_M32: #define __tune_i486__ 1
// CHECK_WINCHIP2_M32: #define i386 1
+// RUN: %clang -march=winchip2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP2_M64
+// CHECK_WINCHIP2_M64: error:
//
// RUN: %clang -march=c3 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_C3_M32
@@ -81,6 +102,9 @@
// CHECK_C3_M32: #define __i486__ 1
// CHECK_C3_M32: #define __tune_i486__ 1
// CHECK_C3_M32: #define i386 1
+// RUN: %clang -march=c3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_C3_M64
+// CHECK_C3_M64: error:
//
// RUN: %clang -march=c3-2 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_C3_2_M32
@@ -94,6 +118,9 @@
// CHECK_C3_2_M32: #define __tune_pentium2__ 1
// CHECK_C3_2_M32: #define __tune_pentiumpro__ 1
// CHECK_C3_2_M32: #define i386 1
+// RUN: %clang -march=c3-2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_C3_2_M64
+// CHECK_C3_2_M64: error:
//
// RUN: %clang -march=i686 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_I686_M32
@@ -104,6 +131,9 @@
// CHECK_I686_M32: #define __pentiumpro 1
// CHECK_I686_M32: #define __pentiumpro__ 1
// CHECK_I686_M32: #define i386 1
+// RUN: %clang -march=i686 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_I686_M64
+// CHECK_I686_M64: error:
//
// RUN: %clang -march=pentiumpro -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUMPRO_M32
@@ -116,6 +146,9 @@
// CHECK_PENTIUMPRO_M32: #define __tune_i686__ 1
// CHECK_PENTIUMPRO_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUMPRO_M32: #define i386 1
+// RUN: %clang -march=pentiumpro -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUMPRO_M64
+// CHECK_PENTIUMPRO_M64: error:
//
// RUN: %clang -march=pentium2 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM2_M32
@@ -129,6 +162,9 @@
// CHECK_PENTIUM2_M32: #define __tune_pentium2__ 1
// CHECK_PENTIUM2_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM2_M32: #define i386 1
+// RUN: %clang -march=pentium2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM2_M64
+// CHECK_PENTIUM2_M64: error:
//
// RUN: %clang -march=pentium3 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3_M32
@@ -143,6 +179,9 @@
// CHECK_PENTIUM3_M32: #define __tune_pentium3__ 1
// CHECK_PENTIUM3_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM3_M32: #define i386 1
+// RUN: %clang -march=pentium3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3_M64
+// CHECK_PENTIUM3_M64: error:
//
// RUN: %clang -march=pentium3m -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3M_M32
@@ -155,6 +194,9 @@
// CHECK_PENTIUM3M_M32: #define __tune_i686__ 1
// CHECK_PENTIUM3M_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM3M_M32: #define i386 1
+// RUN: %clang -march=pentium3m -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3M_M64
+// CHECK_PENTIUM3M_M64: error:
//
// RUN: %clang -march=pentium-m -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M_M32
@@ -167,6 +209,9 @@
// CHECK_PENTIUM_M_M32: #define __tune_i686__ 1
// CHECK_PENTIUM_M_M32: #define __tune_pentiumpro__ 1
// CHECK_PENTIUM_M_M32: #define i386 1
+// RUN: %clang -march=pentium-m -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M_M64
+// CHECK_PENTIUM_M_M64: error:
//
// RUN: %clang -march=pentium4 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4_M32
@@ -176,6 +221,9 @@
// CHECK_PENTIUM4_M32: #define __pentium4__ 1
// CHECK_PENTIUM4_M32: #define __tune_pentium4__ 1
// CHECK_PENTIUM4_M32: #define i386 1
+// RUN: %clang -march=pentium4 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4_M64
+// CHECK_PENTIUM4_M64: error:
//
// RUN: %clang -march=pentium4m -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4M_M32
@@ -185,6 +233,9 @@
// CHECK_PENTIUM4M_M32: #define __pentium4__ 1
// CHECK_PENTIUM4M_M32: #define __tune_pentium4__ 1
// CHECK_PENTIUM4M_M32: #define i386 1
+// RUN: %clang -march=pentium4m -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4M_M64
+// CHECK_PENTIUM4M_M64: error:
//
// RUN: %clang -march=prescott -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_PRESCOTT_M32
@@ -194,6 +245,9 @@
// CHECK_PRESCOTT_M32: #define __nocona__ 1
// CHECK_PRESCOTT_M32: #define __tune_nocona__ 1
// CHECK_PRESCOTT_M32: #define i386 1
+// RUN: %clang -march=prescott -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_PRESCOTT_M64
+// CHECK_PRESCOTT_M64: error:
//
// RUN: %clang -march=nocona -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_NOCONA_M32
@@ -203,6 +257,15 @@
// CHECK_NOCONA_M32: #define __nocona__ 1
// CHECK_NOCONA_M32: #define __tune_nocona__ 1
// CHECK_NOCONA_M32: #define i386 1
+// RUN: %clang -march=nocona -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_NOCONA_M64
+// CHECK_NOCONA_M64: #define __amd64 1
+// CHECK_NOCONA_M64: #define __amd64__ 1
+// CHECK_NOCONA_M64: #define __nocona 1
+// CHECK_NOCONA_M64: #define __nocona__ 1
+// CHECK_NOCONA_M64: #define __tune_nocona__ 1
+// CHECK_NOCONA_M64: #define __x86_64 1
+// CHECK_NOCONA_M64: #define __x86_64__ 1
//
// RUN: %clang -march=core2 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE2_M32
@@ -212,6 +275,15 @@
// CHECK_CORE2_M32: #define __i386__ 1
// CHECK_CORE2_M32: #define __tune_core2__ 1
// CHECK_CORE2_M32: #define i386 1
+// RUN: %clang -march=core2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_CORE2_M64
+// CHECK_CORE2_M64: #define __amd64 1
+// CHECK_CORE2_M64: #define __amd64__ 1
+// CHECK_CORE2_M64: #define __core2 1
+// CHECK_CORE2_M64: #define __core2__ 1
+// CHECK_CORE2_M64: #define __tune_core2__ 1
+// CHECK_CORE2_M64: #define __x86_64 1
+// CHECK_CORE2_M64: #define __x86_64__ 1
//
// RUN: %clang -march=corei7 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_M32
@@ -221,6 +293,15 @@
// CHECK_COREI7_M32: #define __i386__ 1
// CHECK_COREI7_M32: #define __tune_corei7__ 1
// CHECK_COREI7_M32: #define i386 1
+// RUN: %clang -march=corei7 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_M64
+// CHECK_COREI7_M64: #define __amd64 1
+// CHECK_COREI7_M64: #define __amd64__ 1
+// CHECK_COREI7_M64: #define __corei7 1
+// CHECK_COREI7_M64: #define __corei7__ 1
+// CHECK_COREI7_M64: #define __tune_corei7__ 1
+// CHECK_COREI7_M64: #define __x86_64 1
+// CHECK_COREI7_M64: #define __x86_64__ 1
//
// RUN: %clang -march=corei7-avx -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_AVX_M32
@@ -230,6 +311,15 @@
// CHECK_COREI7_AVX_M32: #define __i386__ 1
// CHECK_COREI7_AVX_M32: #define __tune_corei7__ 1
// CHECK_COREI7_AVX_M32: #define i386 1
+// RUN: %clang -march=corei7-avx -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_AVX_M64
+// CHECK_COREI7_AVX_M64: #define __amd64 1
+// CHECK_COREI7_AVX_M64: #define __amd64__ 1
+// CHECK_COREI7_AVX_M64: #define __corei7 1
+// CHECK_COREI7_AVX_M64: #define __corei7__ 1
+// CHECK_COREI7_AVX_M64: #define __tune_corei7__ 1
+// CHECK_COREI7_AVX_M64: #define __x86_64 1
+// CHECK_COREI7_AVX_M64: #define __x86_64__ 1
//
// RUN: %clang -march=core-avx-i -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE_AVX_I_M32
@@ -239,6 +329,15 @@
// CHECK_CORE_AVX_I_M32: #define __i386__ 1
// CHECK_CORE_AVX_I_M32: #define __tune_corei7__ 1
// CHECK_CORE_AVX_I_M32: #define i386 1
+// RUN: %clang -march=core-avx-i -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_CORE_AVX_I_M64
+// CHECK_CORE_AVX_I_M64: #define __amd64 1
+// CHECK_CORE_AVX_I_M64: #define __amd64__ 1
+// CHECK_CORE_AVX_I_M64: #define __corei7 1
+// CHECK_CORE_AVX_I_M64: #define __corei7__ 1
+// CHECK_CORE_AVX_I_M64: #define __tune_corei7__ 1
+// CHECK_CORE_AVX_I_M64: #define __x86_64 1
+// CHECK_CORE_AVX_I_M64: #define __x86_64__ 1
//
// RUN: %clang -march=atom -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_ATOM_M32
@@ -248,6 +347,15 @@
// CHECK_ATOM_M32: #define __i386__ 1
// CHECK_ATOM_M32: #define __tune_atom__ 1
// CHECK_ATOM_M32: #define i386 1
+// RUN: %clang -march=atom -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_ATOM_M64
+// CHECK_ATOM_M64: #define __amd64 1
+// CHECK_ATOM_M64: #define __amd64__ 1
+// CHECK_ATOM_M64: #define __atom 1
+// CHECK_ATOM_M64: #define __atom__ 1
+// CHECK_ATOM_M64: #define __tune_atom__ 1
+// CHECK_ATOM_M64: #define __x86_64 1
+// CHECK_ATOM_M64: #define __x86_64__ 1
//
// RUN: %clang -march=geode -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_GEODE_M32
@@ -257,6 +365,9 @@
// CHECK_GEODE_M32: #define __i386__ 1
// CHECK_GEODE_M32: #define __tune_geode__ 1
// CHECK_GEODE_M32: #define i386 1
+// RUN: %clang -march=geode -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_GEODE_M64
+// CHECK_GEODE_M64: error:
//
// RUN: %clang -march=k6 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_M32
@@ -266,6 +377,9 @@
// CHECK_K6_M32: #define __k6__ 1
// CHECK_K6_M32: #define __tune_k6__ 1
// CHECK_K6_M32: #define i386 1
+// RUN: %clang -march=k6 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_K6_M64
+// CHECK_K6_M64: error:
//
// RUN: %clang -march=k6-2 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_2_M32
@@ -277,6 +391,9 @@
// CHECK_K6_2_M32: #define __tune_k6_2__ 1
// CHECK_K6_2_M32: #define __tune_k6__ 1
// CHECK_K6_2_M32: #define i386 1
+// RUN: %clang -march=k6-2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_K6_2_M64
+// CHECK_K6_2_M64: error:
//
// RUN: %clang -march=k6-3 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_3_M32
@@ -288,6 +405,9 @@
// CHECK_K6_3_M32: #define __tune_k6_3__ 1
// CHECK_K6_3_M32: #define __tune_k6__ 1
// CHECK_K6_3_M32: #define i386 1
+// RUN: %clang -march=k6-3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_K6_3_M64
+// CHECK_K6_3_M64: error:
//
// RUN: %clang -march=athlon -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_M32
@@ -297,6 +417,9 @@
// CHECK_ATHLON_M32: #define __i386__ 1
// CHECK_ATHLON_M32: #define __tune_athlon__ 1
// CHECK_ATHLON_M32: #define i386 1
+// RUN: %clang -march=athlon -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_M64
+// CHECK_ATHLON_M64: error:
//
// RUN: %clang -march=athlon-tbird -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_TBIRD_M32
@@ -306,6 +429,9 @@
// CHECK_ATHLON_TBIRD_M32: #define __i386__ 1
// CHECK_ATHLON_TBIRD_M32: #define __tune_athlon__ 1
// CHECK_ATHLON_TBIRD_M32: #define i386 1
+// RUN: %clang -march=athlon-tbird -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_TBIRD_M64
+// CHECK_ATHLON_TBIRD_M64: error:
//
// RUN: %clang -march=athlon-4 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_4_M32
@@ -318,6 +444,9 @@
// FIXME: This should be defined!
// CHECK_ATHLON_4_M32-NOT: #define __tune_athlon_sse__ 1
// CHECK_ATHLON_4_M32: #define i386 1
+// RUN: %clang -march=athlon-4 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_4_M64
+// CHECK_ATHLON_4_M64: error:
//
// RUN: %clang -march=athlon-xp -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_XP_M32
@@ -330,6 +459,9 @@
// FIXME: This should be defined!
// CHECK_ATHLON_XP_M32-NOT: #define __tune_athlon_sse__ 1
// CHECK_ATHLON_XP_M32: #define i386 1
+// RUN: %clang -march=athlon-xp -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_XP_M64
+// CHECK_ATHLON_XP_M64: error:
//
// RUN: %clang -march=athlon-mp -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_MP_M32
@@ -342,6 +474,9 @@
// FIXME: This should be defined!
// CHECK_ATHLON_MP_M32-NOT: #define __tune_athlon_sse__ 1
// CHECK_ATHLON_MP_M32: #define i386 1
+// RUN: %clang -march=athlon-mp -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_MP_M64
+// CHECK_ATHLON_MP_M64: error:
//
// RUN: %clang -march=x86-64 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_X86_64_M32
@@ -350,6 +485,14 @@
// CHECK_X86_64_M32: #define __k8 1
// CHECK_X86_64_M32: #define __k8__ 1
// CHECK_X86_64_M32: #define i386 1
+// RUN: %clang -march=x86-64 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_X86_64_M64
+// CHECK_X86_64_M64: #define __amd64 1
+// CHECK_X86_64_M64: #define __amd64__ 1
+// CHECK_X86_64_M64: #define __k8 1
+// CHECK_X86_64_M64: #define __k8__ 1
+// CHECK_X86_64_M64: #define __x86_64 1
+// CHECK_X86_64_M64: #define __x86_64__ 1
//
// RUN: %clang -march=k8 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_K8_M32
@@ -359,6 +502,15 @@
// CHECK_K8_M32: #define __k8__ 1
// CHECK_K8_M32: #define __tune_k8__ 1
// CHECK_K8_M32: #define i386 1
+// RUN: %clang -march=k8 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_K8_M64
+// CHECK_K8_M64: #define __amd64 1
+// CHECK_K8_M64: #define __amd64__ 1
+// CHECK_K8_M64: #define __k8 1
+// CHECK_K8_M64: #define __k8__ 1
+// CHECK_K8_M64: #define __tune_k8__ 1
+// CHECK_K8_M64: #define __x86_64 1
+// CHECK_K8_M64: #define __x86_64__ 1
//
// RUN: %clang -march=k8-sse3 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_K8_SSE3_M32
@@ -368,6 +520,15 @@
// CHECK_K8_SSE3_M32: #define __k8__ 1
// CHECK_K8_SSE3_M32: #define __tune_k8__ 1
// CHECK_K8_SSE3_M32: #define i386 1
+// RUN: %clang -march=k8-sse3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_K8_SSE3_M64
+// CHECK_K8_SSE3_M64: #define __amd64 1
+// CHECK_K8_SSE3_M64: #define __amd64__ 1
+// CHECK_K8_SSE3_M64: #define __k8 1
+// CHECK_K8_SSE3_M64: #define __k8__ 1
+// CHECK_K8_SSE3_M64: #define __tune_k8__ 1
+// CHECK_K8_SSE3_M64: #define __x86_64 1
+// CHECK_K8_SSE3_M64: #define __x86_64__ 1
//
// RUN: %clang -march=opteron -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_M32
@@ -377,6 +538,15 @@
// CHECK_OPTERON_M32: #define __k8__ 1
// CHECK_OPTERON_M32: #define __tune_k8__ 1
// CHECK_OPTERON_M32: #define i386 1
+// RUN: %clang -march=opteron -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_M64
+// CHECK_OPTERON_M64: #define __amd64 1
+// CHECK_OPTERON_M64: #define __amd64__ 1
+// CHECK_OPTERON_M64: #define __k8 1
+// CHECK_OPTERON_M64: #define __k8__ 1
+// CHECK_OPTERON_M64: #define __tune_k8__ 1
+// CHECK_OPTERON_M64: #define __x86_64 1
+// CHECK_OPTERON_M64: #define __x86_64__ 1
//
// RUN: %clang -march=opteron-sse3 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_SSE3_M32
@@ -386,6 +556,15 @@
// CHECK_OPTERON_SSE3_M32: #define __k8__ 1
// CHECK_OPTERON_SSE3_M32: #define __tune_k8__ 1
// CHECK_OPTERON_SSE3_M32: #define i386 1
+// RUN: %clang -march=opteron-sse3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_SSE3_M64
+// CHECK_OPTERON_SSE3_M64: #define __amd64 1
+// CHECK_OPTERON_SSE3_M64: #define __amd64__ 1
+// CHECK_OPTERON_SSE3_M64: #define __k8 1
+// CHECK_OPTERON_SSE3_M64: #define __k8__ 1
+// CHECK_OPTERON_SSE3_M64: #define __tune_k8__ 1
+// CHECK_OPTERON_SSE3_M64: #define __x86_64 1
+// CHECK_OPTERON_SSE3_M64: #define __x86_64__ 1
//
// RUN: %clang -march=athlon64 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_M32
@@ -395,6 +574,15 @@
// CHECK_ATHLON64_M32: #define __k8__ 1
// CHECK_ATHLON64_M32: #define __tune_k8__ 1
// CHECK_ATHLON64_M32: #define i386 1
+// RUN: %clang -march=athlon64 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_M64
+// CHECK_ATHLON64_M64: #define __amd64 1
+// CHECK_ATHLON64_M64: #define __amd64__ 1
+// CHECK_ATHLON64_M64: #define __k8 1
+// CHECK_ATHLON64_M64: #define __k8__ 1
+// CHECK_ATHLON64_M64: #define __tune_k8__ 1
+// CHECK_ATHLON64_M64: #define __x86_64 1
+// CHECK_ATHLON64_M64: #define __x86_64__ 1
//
// RUN: %clang -march=athlon64-sse3 -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_SSE3_M32
@@ -404,6 +592,15 @@
// CHECK_ATHLON64_SSE3_M32: #define __k8__ 1
// CHECK_ATHLON64_SSE3_M32: #define __tune_k8__ 1
// CHECK_ATHLON64_SSE3_M32: #define i386 1
+// RUN: %clang -march=athlon64-sse3 -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_SSE3_M64
+// CHECK_ATHLON64_SSE3_M64: #define __amd64 1
+// CHECK_ATHLON64_SSE3_M64: #define __amd64__ 1
+// CHECK_ATHLON64_SSE3_M64: #define __k8 1
+// CHECK_ATHLON64_SSE3_M64: #define __k8__ 1
+// CHECK_ATHLON64_SSE3_M64: #define __tune_k8__ 1
+// CHECK_ATHLON64_SSE3_M64: #define __x86_64 1
+// CHECK_ATHLON64_SSE3_M64: #define __x86_64__ 1
//
// RUN: %clang -march=athlon-fx -m32 -E -dM %s -o - 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_FX_M32
@@ -413,3 +610,12 @@
// CHECK_ATHLON_FX_M32: #define __k8__ 1
// CHECK_ATHLON_FX_M32: #define __tune_k8__ 1
// CHECK_ATHLON_FX_M32: #define i386 1
+// RUN: %clang -march=athlon-fx -m64 -E -dM %s -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_FX_M64
+// CHECK_ATHLON_FX_M64: #define __amd64 1
+// CHECK_ATHLON_FX_M64: #define __amd64__ 1
+// CHECK_ATHLON_FX_M64: #define __k8 1
+// CHECK_ATHLON_FX_M64: #define __k8__ 1
+// CHECK_ATHLON_FX_M64: #define __tune_k8__ 1
+// CHECK_ATHLON_FX_M64: #define __x86_64 1
+// CHECK_ATHLON_FX_M64: #define __x86_64__ 1
More information about the cfe-commits
mailing list