Chandler Carruth | ba9186c | 2012-01-03 02:46:46 +0000 | [diff] [blame] | 1 | // This test verifies that the correct macros are predefined. |
| 2 | // |
David Majnemer | e71aa18 | 2016-06-28 03:13:16 +0000 | [diff] [blame] | 3 | // RUN: %clang_cc1 %s -x c++ -E -dM -triple i686-pc-win32 -fms-extensions -fms-compatibility \ |
| 4 | // RUN: -fms-compatibility-version=19.00 -std=c++1z -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS |
Chandler Carruth | ba9186c | 2012-01-03 02:46:46 +0000 | [diff] [blame] | 5 | // CHECK-MS: #define _INTEGRAL_MAX_BITS 64 |
| 6 | // CHECK-MS: #define _MSC_EXTENSIONS 1 |
David Majnemer | e71aa18 | 2016-06-28 03:13:16 +0000 | [diff] [blame] | 7 | // CHECK-MS: #define _MSC_VER 1900 |
| 8 | // CHECK-MS: #define _MSVC_LANG 201403L |
Chandler Carruth | ba9186c | 2012-01-03 02:46:46 +0000 | [diff] [blame] | 9 | // CHECK-MS: #define _M_IX86 600 |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 10 | // CHECK-MS: #define _M_IX86_FP 0 |
Chandler Carruth | ba9186c | 2012-01-03 02:46:46 +0000 | [diff] [blame] | 11 | // CHECK-MS: #define _WIN32 1 |
Ehsan Akhgari | 71f885d | 2014-06-30 20:36:33 +0000 | [diff] [blame] | 12 | // CHECK-MS-NOT: #define __STRICT_ANSI__ |
Ehsan Akhgari | 669295c | 2014-07-10 18:44:24 +0000 | [diff] [blame] | 13 | // CHECK-MS-NOT: GCC |
| 14 | // CHECK-MS-NOT: GNU |
| 15 | // CHECK-MS-NOT: GXX |
| 16 | // |
David Majnemer | e71aa18 | 2016-06-28 03:13:16 +0000 | [diff] [blame] | 17 | // RUN: %clang_cc1 %s -x c++ -E -dM -triple x86_64-pc-win32 -fms-extensions -fms-compatibility \ |
| 18 | // RUN: -fms-compatibility-version=19.00 -std=c++14 -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS64 |
Ehsan Akhgari | 669295c | 2014-07-10 18:44:24 +0000 | [diff] [blame] | 19 | // CHECK-MS64: #define _INTEGRAL_MAX_BITS 64 |
| 20 | // CHECK-MS64: #define _MSC_EXTENSIONS 1 |
David Majnemer | e71aa18 | 2016-06-28 03:13:16 +0000 | [diff] [blame] | 21 | // CHECK-MS64: #define _MSC_VER 1900 |
| 22 | // CHECK-MS64: #define _MSVC_LANG 201402L |
David Majnemer | 6a65e26 | 2015-07-26 23:17:29 +0000 | [diff] [blame] | 23 | // CHECK-MS64: #define _M_AMD64 100 |
| 24 | // CHECK-MS64: #define _M_X64 100 |
Ehsan Akhgari | 669295c | 2014-07-10 18:44:24 +0000 | [diff] [blame] | 25 | // CHECK-MS64: #define _WIN64 1 |
| 26 | // CHECK-MS64-NOT: #define __STRICT_ANSI__ |
| 27 | // CHECK-MS64-NOT: GCC |
| 28 | // CHECK-MS64-NOT: GNU |
| 29 | // CHECK-MS64-NOT: GXX |
Chandler Carruth | ba9186c | 2012-01-03 02:46:46 +0000 | [diff] [blame] | 30 | // |
JF Bastien | 41c9813 | 2014-06-25 01:31:33 +0000 | [diff] [blame] | 31 | // RUN: %clang_cc1 %s -E -dM -triple i686-pc-win32 -fms-compatibility \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 32 | // RUN: -o - | FileCheck -match-full-lines %s --check-prefix=CHECK-MS-STDINT |
Aaron Ballman | cd2a846 | 2014-10-21 19:24:06 +0000 | [diff] [blame] | 33 | // CHECK-MS-STDINT:#define __INT16_MAX__ 32767 |
| 34 | // CHECK-MS-STDINT:#define __INT32_MAX__ 2147483647 |
| 35 | // CHECK-MS-STDINT:#define __INT64_MAX__ 9223372036854775807LL |
| 36 | // CHECK-MS-STDINT:#define __INT8_MAX__ 127 |
| 37 | // CHECK-MS-STDINT:#define __INTPTR_MAX__ 2147483647 |
| 38 | // CHECK-MS-STDINT:#define __INT_FAST16_MAX__ 32767 |
| 39 | // CHECK-MS-STDINT:#define __INT_FAST16_TYPE__ short |
| 40 | // CHECK-MS-STDINT:#define __INT_FAST32_MAX__ 2147483647 |
| 41 | // CHECK-MS-STDINT:#define __INT_FAST32_TYPE__ int |
| 42 | // CHECK-MS-STDINT:#define __INT_FAST64_MAX__ 9223372036854775807LL |
| 43 | // CHECK-MS-STDINT:#define __INT_FAST64_TYPE__ long long int |
| 44 | // CHECK-MS-STDINT:#define __INT_FAST8_MAX__ 127 |
| 45 | // CHECK-MS-STDINT:#define __INT_FAST8_TYPE__ signed char |
| 46 | // CHECK-MS-STDINT:#define __INT_LEAST16_MAX__ 32767 |
| 47 | // CHECK-MS-STDINT:#define __INT_LEAST16_TYPE__ short |
| 48 | // CHECK-MS-STDINT:#define __INT_LEAST32_MAX__ 2147483647 |
| 49 | // CHECK-MS-STDINT:#define __INT_LEAST32_TYPE__ int |
| 50 | // CHECK-MS-STDINT:#define __INT_LEAST64_MAX__ 9223372036854775807LL |
| 51 | // CHECK-MS-STDINT:#define __INT_LEAST64_TYPE__ long long int |
| 52 | // CHECK-MS-STDINT:#define __INT_LEAST8_MAX__ 127 |
| 53 | // CHECK-MS-STDINT:#define __INT_LEAST8_TYPE__ signed char |
JF Bastien | 41c9813 | 2014-06-25 01:31:33 +0000 | [diff] [blame] | 54 | // CHECK-MS-STDINT-NOT:#define __UINT16_C_SUFFIX__ U |
Aaron Ballman | cd2a846 | 2014-10-21 19:24:06 +0000 | [diff] [blame] | 55 | // CHECK-MS-STDINT:#define __UINT16_MAX__ 65535 |
| 56 | // CHECK-MS-STDINT:#define __UINT16_TYPE__ unsigned short |
| 57 | // CHECK-MS-STDINT:#define __UINT32_C_SUFFIX__ U |
| 58 | // CHECK-MS-STDINT:#define __UINT32_MAX__ 4294967295U |
| 59 | // CHECK-MS-STDINT:#define __UINT32_TYPE__ unsigned int |
| 60 | // CHECK-MS-STDINT:#define __UINT64_C_SUFFIX__ ULL |
| 61 | // CHECK-MS-STDINT:#define __UINT64_MAX__ 18446744073709551615ULL |
| 62 | // CHECK-MS-STDINT:#define __UINT64_TYPE__ long long unsigned int |
JF Bastien | 41c9813 | 2014-06-25 01:31:33 +0000 | [diff] [blame] | 63 | // CHECK-MS-STDINT-NOT:#define __UINT8_C_SUFFIX__ U |
Aaron Ballman | cd2a846 | 2014-10-21 19:24:06 +0000 | [diff] [blame] | 64 | // CHECK-MS-STDINT:#define __UINT8_MAX__ 255 |
| 65 | // CHECK-MS-STDINT:#define __UINT8_TYPE__ unsigned char |
| 66 | // CHECK-MS-STDINT:#define __UINTMAX_MAX__ 18446744073709551615ULL |
| 67 | // CHECK-MS-STDINT:#define __UINTPTR_MAX__ 4294967295U |
| 68 | // CHECK-MS-STDINT:#define __UINTPTR_TYPE__ unsigned int |
| 69 | // CHECK-MS-STDINT:#define __UINTPTR_WIDTH__ 32 |
| 70 | // CHECK-MS-STDINT:#define __UINT_FAST16_MAX__ 65535 |
| 71 | // CHECK-MS-STDINT:#define __UINT_FAST16_TYPE__ unsigned short |
| 72 | // CHECK-MS-STDINT:#define __UINT_FAST32_MAX__ 4294967295U |
| 73 | // CHECK-MS-STDINT:#define __UINT_FAST32_TYPE__ unsigned int |
| 74 | // CHECK-MS-STDINT:#define __UINT_FAST64_MAX__ 18446744073709551615ULL |
| 75 | // CHECK-MS-STDINT:#define __UINT_FAST64_TYPE__ long long unsigned int |
| 76 | // CHECK-MS-STDINT:#define __UINT_FAST8_MAX__ 255 |
| 77 | // CHECK-MS-STDINT:#define __UINT_FAST8_TYPE__ unsigned char |
| 78 | // CHECK-MS-STDINT:#define __UINT_LEAST16_MAX__ 65535 |
| 79 | // CHECK-MS-STDINT:#define __UINT_LEAST16_TYPE__ unsigned short |
| 80 | // CHECK-MS-STDINT:#define __UINT_LEAST32_MAX__ 4294967295U |
| 81 | // CHECK-MS-STDINT:#define __UINT_LEAST32_TYPE__ unsigned int |
| 82 | // CHECK-MS-STDINT:#define __UINT_LEAST64_MAX__ 18446744073709551615ULL |
| 83 | // CHECK-MS-STDINT:#define __UINT_LEAST64_TYPE__ long long unsigned int |
| 84 | // CHECK-MS-STDINT:#define __UINT_LEAST8_MAX__ 255 |
| 85 | // CHECK-MS-STDINT:#define __UINT_LEAST8_TYPE__ unsigned char |
JF Bastien | 41c9813 | 2014-06-25 01:31:33 +0000 | [diff] [blame] | 86 | // |
Chandler Carruth | ba9186c | 2012-01-03 02:46:46 +0000 | [diff] [blame] | 87 | // RUN: %clang_cc1 %s -E -dM -ffast-math -o - \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 88 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FAST-MATH |
| 89 | // CHECK-FAST-MATH: #define __FAST_MATH__ 1 |
Bob Wilson | 455e72e | 2012-07-19 03:52:53 +0000 | [diff] [blame] | 90 | // CHECK-FAST-MATH: #define __FINITE_MATH_ONLY__ 1 |
| 91 | // |
| 92 | // RUN: %clang_cc1 %s -E -dM -ffinite-math-only -o - \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 93 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FINITE-MATH-ONLY |
Bob Wilson | 455e72e | 2012-07-19 03:52:53 +0000 | [diff] [blame] | 94 | // CHECK-FINITE-MATH-ONLY: #define __FINITE_MATH_ONLY__ 1 |
| 95 | // |
| 96 | // RUN: %clang %s -E -dM -fno-finite-math-only -o - \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 97 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-NO-FINITE-MATH-ONLY |
Bob Wilson | 455e72e | 2012-07-19 03:52:53 +0000 | [diff] [blame] | 98 | // CHECK-NO-FINITE-MATH-ONLY: #define __FINITE_MATH_ONLY__ 0 |
| 99 | // |
| 100 | // RUN: %clang_cc1 %s -E -dM -o - \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 101 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FINITE-MATH-FLAG-UNDEFINED |
Bob Wilson | 455e72e | 2012-07-19 03:52:53 +0000 | [diff] [blame] | 102 | // CHECK-FINITE-MATH-FLAG-UNDEFINED: #define __FINITE_MATH_ONLY__ 0 |
Michael J. Spencer | d1b3394 | 2013-04-04 23:53:43 +0000 | [diff] [blame] | 103 | // |
| 104 | // RUN: %clang_cc1 %s -E -dM -o - -triple i686 -target-cpu i386 \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 105 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_I386 |
Michael J. Spencer | d1b3394 | 2013-04-04 23:53:43 +0000 | [diff] [blame] | 106 | // CHECK-SYNC_CAS_I386-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP |
| 107 | // |
| 108 | // RUN: %clang_cc1 %s -E -dM -o - -triple i686 -target-cpu i486 \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 109 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_I486 |
| 110 | // CHECK-SYNC_CAS_I486: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
| 111 | // CHECK-SYNC_CAS_I486: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 |
| 112 | // CHECK-SYNC_CAS_I486: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 |
Michael J. Spencer | d1b3394 | 2013-04-04 23:53:43 +0000 | [diff] [blame] | 113 | // CHECK-SYNC_CAS_I486-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 |
| 114 | // |
| 115 | // RUN: %clang_cc1 %s -E -dM -o - -triple i686 -target-cpu i586 \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 116 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_I586 |
| 117 | // CHECK-SYNC_CAS_I586: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
| 118 | // CHECK-SYNC_CAS_I586: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 |
| 119 | // CHECK-SYNC_CAS_I586: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 |
| 120 | // CHECK-SYNC_CAS_I586: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 |
Weiming Zhao | 8712ded | 2013-09-30 22:51:32 +0000 | [diff] [blame] | 121 | // |
| 122 | // RUN: %clang_cc1 %s -E -dM -o - -triple armv6 -target-cpu arm1136j-s \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 123 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_ARM |
| 124 | // CHECK-SYNC_CAS_ARM: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
| 125 | // CHECK-SYNC_CAS_ARM: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 |
| 126 | // CHECK-SYNC_CAS_ARM: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 |
| 127 | // CHECK-SYNC_CAS_ARM: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 |
Weiming Zhao | 8712ded | 2013-09-30 22:51:32 +0000 | [diff] [blame] | 128 | // |
| 129 | // RUN: %clang_cc1 %s -E -dM -o - -triple armv7 -target-cpu cortex-a8 \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 130 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_ARMv7 |
| 131 | // CHECK-SYNC_CAS_ARMv7: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
| 132 | // CHECK-SYNC_CAS_ARMv7: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 |
| 133 | // CHECK-SYNC_CAS_ARMv7: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 |
| 134 | // CHECK-SYNC_CAS_ARMv7: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 |
Weiming Zhao | 8712ded | 2013-09-30 22:51:32 +0000 | [diff] [blame] | 135 | // |
| 136 | // RUN: %clang_cc1 %s -E -dM -o - -triple armv6 -target-cpu cortex-m0 \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 137 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_ARMv6 |
Weiming Zhao | 8712ded | 2013-09-30 22:51:32 +0000 | [diff] [blame] | 138 | // CHECK-SYNC_CAS_ARMv6-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP |
Daniel Sanders | 28840c7 | 2015-12-22 12:59:30 +0000 | [diff] [blame] | 139 | // |
| 140 | // RUN: %clang_cc1 %s -E -dM -o - -triple mips -target-cpu mips2 \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 141 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_MIPS \ |
Daniel Sanders | 28840c7 | 2015-12-22 12:59:30 +0000 | [diff] [blame] | 142 | // RUN: --check-prefix=CHECK-SYNC_CAS_MIPS32 |
| 143 | // RUN: %clang_cc1 %s -E -dM -o - -triple mips64 -target-cpu mips3 \ |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 144 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SYNC_CAS_MIPS \ |
Daniel Sanders | 28840c7 | 2015-12-22 12:59:30 +0000 | [diff] [blame] | 145 | // RUN: --check-prefix=CHECK-SYNC_CAS_MIPS64 |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 146 | // CHECK-SYNC_CAS_MIPS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 |
| 147 | // CHECK-SYNC_CAS_MIPS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 |
| 148 | // CHECK-SYNC_CAS_MIPS: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 |
Daniel Sanders | 28840c7 | 2015-12-22 12:59:30 +0000 | [diff] [blame] | 149 | // CHECK-SYNC_CAS_MIPS32-NOT: __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 |
James Y Knight | 2f6140b | 2016-04-01 21:33:20 +0000 | [diff] [blame] | 150 | // CHECK-SYNC_CAS_MIPS64: #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 |
Yaxun Liu | 64029a8 | 2016-04-26 19:25:46 +0000 | [diff] [blame] | 151 | |
| 152 | // RUN: %clang_cc1 %s -E -dM -o - -x cl \ |
| 153 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL10 |
| 154 | // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL1.1 \ |
| 155 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL11 |
| 156 | // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL1.2 \ |
| 157 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL12 |
| 158 | // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-std=CL2.0 \ |
| 159 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-CL20 |
| 160 | // RUN: %clang_cc1 %s -E -dM -o - -x cl -cl-fast-relaxed-math \ |
| 161 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-FRM |
| 162 | // CHECK-CL10: #define CL_VERSION_1_0 100 |
| 163 | // CHECK-CL10: #define CL_VERSION_1_1 110 |
| 164 | // CHECK-CL10: #define CL_VERSION_1_2 120 |
| 165 | // CHECK-CL10: #define CL_VERSION_2_0 200 |
| 166 | // CHECK-CL10: #define __OPENCL_C_VERSION__ 100 |
| 167 | // CHECK-CL10-NOT: #define __FAST_RELAXED_MATH__ 1 |
| 168 | // CHECK-CL11: #define CL_VERSION_1_0 100 |
| 169 | // CHECK-CL11: #define CL_VERSION_1_1 110 |
| 170 | // CHECK-CL11: #define CL_VERSION_1_2 120 |
| 171 | // CHECK-CL11: #define CL_VERSION_2_0 200 |
| 172 | // CHECK-CL11: #define __OPENCL_C_VERSION__ 110 |
| 173 | // CHECK-CL11-NOT: #define __FAST_RELAXED_MATH__ 1 |
| 174 | // CHECK-CL12: #define CL_VERSION_1_0 100 |
| 175 | // CHECK-CL12: #define CL_VERSION_1_1 110 |
| 176 | // CHECK-CL12: #define CL_VERSION_1_2 120 |
| 177 | // CHECK-CL12: #define CL_VERSION_2_0 200 |
| 178 | // CHECK-CL12: #define __OPENCL_C_VERSION__ 120 |
| 179 | // CHECK-CL12-NOT: #define __FAST_RELAXED_MATH__ 1 |
| 180 | // CHECK-CL20: #define CL_VERSION_1_0 100 |
| 181 | // CHECK-CL20: #define CL_VERSION_1_1 110 |
| 182 | // CHECK-CL20: #define CL_VERSION_1_2 120 |
| 183 | // CHECK-CL20: #define CL_VERSION_2_0 200 |
| 184 | // CHECK-CL20: #define __OPENCL_C_VERSION__ 200 |
| 185 | // CHECK-CL20-NOT: #define __FAST_RELAXED_MATH__ 1 |
| 186 | // CHECK-FRM: #define __FAST_RELAXED_MATH__ 1 |
| 187 | |
Yaxun Liu | 84162ac | 2017-08-04 18:16:31 +0000 | [diff] [blame] | 188 | // RUN: %clang_cc1 %s -E -dM -o - -x cl \ |
| 189 | // RUN: | FileCheck %s --check-prefix=MSCOPE |
| 190 | // MSCOPE:#define __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES 3 |
| 191 | // MSCOPE:#define __OPENCL_MEMORY_SCOPE_DEVICE 2 |
| 192 | // MSCOPE:#define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4 |
| 193 | // MSCOPE:#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1 |
| 194 | // MSCOPE:#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0 |
| 195 | |
Martell Malone | 1e94dec | 2017-11-21 11:28:29 +0000 | [diff] [blame] | 196 | // RUN: %clang_cc1 -triple i386-windows %s -E -dM -o - \ |
| 197 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-X86-WIN |
| 198 | |
| 199 | // CHECK-X86-WIN-NOT: #define WIN32 1 |
| 200 | // CHECK-X86-WIN-NOT: #define WIN64 1 |
| 201 | // CHECK-X86-WIN-NOT: #define WINNT 1 |
| 202 | // CHECK-X86-WIN: #define _WIN32 1 |
| 203 | // CHECK-X86-WIN-NOT: #define _WIN64 1 |
| 204 | |
| 205 | // RUN: %clang_cc1 -triple thumbv7-windows %s -E -dM -o - \ |
| 206 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM-WIN |
| 207 | |
| 208 | // CHECK-ARM-WIN-NOT: #define WIN32 1 |
| 209 | // CHECK-ARM-WIN-NOT: #define WIN64 1 |
| 210 | // CHECK-ARM-WIN-NOT: #define WINNT 1 |
| 211 | // CHECK-ARM-WIN: #define _WIN32 1 |
| 212 | // CHECK-ARM-WIN-NOT: #define _WIN64 1 |
| 213 | |
| 214 | // RUN: %clang_cc1 -triple x86_64-windows %s -E -dM -o - \ |
| 215 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-AMD64-WIN |
| 216 | |
| 217 | // CHECK-AMD64-WIN-NOT: #define WIN32 1 |
| 218 | // CHECK-AMD64-WIN-NOT: #define WIN64 1 |
| 219 | // CHECK-AMD64-WIN-NOT: #define WINNT 1 |
| 220 | // CHECK-AMD64-WIN: #define _WIN32 1 |
| 221 | // CHECK-AMD64-WIN: #define _WIN64 1 |
| 222 | |
Martin Storsjo | 017fd0bd | 2017-08-06 19:57:49 +0000 | [diff] [blame] | 223 | // RUN: %clang_cc1 -triple aarch64-windows %s -E -dM -o - \ |
Mandeep Singh Grang | 5b7d7d2 | 2017-06-27 23:56:34 +0000 | [diff] [blame] | 224 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64-WIN |
| 225 | |
Martell Malone | 1e94dec | 2017-11-21 11:28:29 +0000 | [diff] [blame] | 226 | // CHECK-ARM64-WIN-NOT: #define WIN32 1 |
| 227 | // CHECK-ARM64-WIN-NOT: #define WIN64 1 |
| 228 | // CHECK-ARM64-WIN-NOT: #define WINNT 1 |
Mandeep Singh Grang | 5b7d7d2 | 2017-06-27 23:56:34 +0000 | [diff] [blame] | 229 | // CHECK-ARM64-WIN: #define _M_ARM64 1 |
| 230 | // CHECK-ARM64-WIN: #define _WIN32 1 |
| 231 | // CHECK-ARM64-WIN: #define _WIN64 1 |
Martin Storsjo | 4fe40d8 | 2017-08-13 19:42:17 +0000 | [diff] [blame] | 232 | |
Martell Malone | 1e94dec | 2017-11-21 11:28:29 +0000 | [diff] [blame] | 233 | // RUN: %clang_cc1 -triple i686-windows-gnu %s -E -dM -o - \ |
| 234 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-X86-MINGW |
| 235 | |
| 236 | // CHECK-X86-MINGW: #define WIN32 1 |
| 237 | // CHECK-X86-MINGW-NOT: #define WIN64 1 |
| 238 | // CHECK-X86-MINGW: #define WINNT 1 |
| 239 | // CHECK-X86-MINGW: #define _WIN32 1 |
| 240 | // CHECK-X86-MINGW-NOT: #define _WIN64 1 |
| 241 | |
| 242 | // RUN: %clang_cc1 -triple thumbv7-windows-gnu %s -E -dM -o - \ |
| 243 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM-MINGW |
| 244 | |
| 245 | // CHECK-ARM-MINGW: #define WIN32 1 |
| 246 | // CHECK-ARM-MINGW-NOT: #define WIN64 1 |
| 247 | // CHECK-ARM-MINGW: #define WINNT 1 |
| 248 | // CHECK-ARM-MINGW: #define _WIN32 1 |
| 249 | // CHECK-ARM-MINGW-NOT: #define _WIN64 1 |
| 250 | |
| 251 | // RUN: %clang_cc1 -triple x86_64-windows-gnu %s -E -dM -o - \ |
| 252 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-AMD64-MINGW |
| 253 | |
| 254 | // CHECK-AMD64-MINGW: #define WIN32 1 |
| 255 | // CHECK-AMD64-MINGW: #define WIN64 1 |
| 256 | // CHECK-AMD64-MINGW: #define WINNT 1 |
| 257 | // CHECK-AMD64-MINGW: #define _WIN32 1 |
| 258 | // CHECK-AMD64-MINGW: #define _WIN64 1 |
| 259 | |
Martin Storsjo | 4fe40d8 | 2017-08-13 19:42:17 +0000 | [diff] [blame] | 260 | // RUN: %clang_cc1 -triple aarch64-windows-gnu %s -E -dM -o - \ |
| 261 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-ARM64-MINGW |
| 262 | |
| 263 | // CHECK-ARM64-MINGW-NOT: #define _M_ARM64 1 |
| 264 | // CHECK-ARM64-MINGW: #define WIN32 1 |
| 265 | // CHECK-ARM64-MINGW: #define WIN64 1 |
Martell Malone | 1e94dec | 2017-11-21 11:28:29 +0000 | [diff] [blame] | 266 | // CHECK-ARM64-MINGW: #define WINNT 1 |
Martin Storsjo | 4fe40d8 | 2017-08-13 19:42:17 +0000 | [diff] [blame] | 267 | // CHECK-ARM64-MINGW: #define _WIN32 1 |
| 268 | // CHECK-ARM64-MINGW: #define _WIN64 1 |
| 269 | // CHECK-ARM64-MINGW: #define __aarch64__ 1 |
Sven van Haastregt | 7bbe1bb | 2017-12-04 15:01:08 +0000 | [diff] [blame] | 270 | |
| 271 | // RUN: %clang_cc1 %s -E -dM -o - -x cl -triple spir-unknown-unknown \ |
| 272 | // RUN: | FileCheck -match-full-lines %s --check-prefix=CHECK-SPIR |
| 273 | // CHECK-SPIR: #define __IMAGE_SUPPORT__ 1 |