blob: 94671f3335c321184939aeb763c50e3c4289093d [file] [log] [blame]
Chandler Carruthba9186c2012-01-03 02:46:46 +00001// This test verifies that the correct macros are predefined.
2//
Aaron Ballmandc72dc82012-03-10 22:52:10 +00003// RUN: %clang_cc1 %s -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \
Chandler Carruthba9186c2012-01-03 02:46:46 +00004// RUN: -fmsc-version=1300 -o - | FileCheck %s --check-prefix=CHECK-MS
5// CHECK-MS: #define _INTEGRAL_MAX_BITS 64
6// CHECK-MS: #define _MSC_EXTENSIONS 1
7// CHECK-MS: #define _MSC_VER 1300
8// CHECK-MS: #define _M_IX86 600
9// CHECK-MS: #define _M_IX86_FP
10// CHECK-MS: #define _WIN32 1
Aaron Ballman5b31d552012-03-10 22:21:14 +000011// CHECK-MS-NOT: #define __GNUC__
Chandler Carruthba9186c2012-01-03 02:46:46 +000012//
13// RUN: %clang_cc1 %s -E -dM -ffast-math -o - \
14// RUN: | FileCheck %s --check-prefix=CHECK-FAST-MATH
15// CHECK-FAST-MATH: #define __FAST_MATH__
Bob Wilson455e72e2012-07-19 03:52:53 +000016// CHECK-FAST-MATH: #define __FINITE_MATH_ONLY__ 1
17//
18// RUN: %clang_cc1 %s -E -dM -ffinite-math-only -o - \
19// RUN: | FileCheck %s --check-prefix=CHECK-FINITE-MATH-ONLY
20// CHECK-FINITE-MATH-ONLY: #define __FINITE_MATH_ONLY__ 1
21//
22// RUN: %clang %s -E -dM -fno-finite-math-only -o - \
23// RUN: | FileCheck %s --check-prefix=CHECK-NO-FINITE-MATH-ONLY
24// CHECK-NO-FINITE-MATH-ONLY: #define __FINITE_MATH_ONLY__ 0
25//
26// RUN: %clang_cc1 %s -E -dM -o - \
27// RUN: | FileCheck %s --check-prefix=CHECK-FINITE-MATH-FLAG-UNDEFINED
28// CHECK-FINITE-MATH-FLAG-UNDEFINED: #define __FINITE_MATH_ONLY__ 0
Michael J. Spencerd1b33942013-04-04 23:53:43 +000029//
30// RUN: %clang_cc1 %s -E -dM -o - -triple i686 -target-cpu i386 \
31// RUN: | FileCheck %s --check-prefix=CHECK-SYNC_CAS_I386
32// CHECK-SYNC_CAS_I386-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP
33//
34// RUN: %clang_cc1 %s -E -dM -o - -triple i686 -target-cpu i486 \
35// RUN: | FileCheck %s --check-prefix=CHECK-SYNC_CAS_I486
36// CHECK-SYNC_CAS_I486: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
37// CHECK-SYNC_CAS_I486: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
38// CHECK-SYNC_CAS_I486: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
39// CHECK-SYNC_CAS_I486-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
40//
41// RUN: %clang_cc1 %s -E -dM -o - -triple i686 -target-cpu i586 \
42// RUN: | FileCheck %s --check-prefix=CHECK-SYNC_CAS_I586
43// CHECK-SYNC_CAS_I586: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
44// CHECK-SYNC_CAS_I586: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
45// CHECK-SYNC_CAS_I586: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
46// CHECK-SYNC_CAS_I586: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8