summaryrefslogtreecommitdiffstats
path: root/test/Preprocessor
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
committerdim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
commit554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch)
tree9abb1a658a297776086f4e0dfa6ca533de02104e /test/Preprocessor
parentbb67ca86b31f67faee50bd10c3b036d65751745a (diff)
downloadFreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip
FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/Preprocessor')
-rw-r--r--test/Preprocessor/_Pragma-location.c49
-rw-r--r--test/Preprocessor/comment_save.c14
-rw-r--r--test/Preprocessor/disabled-cond-diags2.c27
-rw-r--r--test/Preprocessor/has_attribute.c10
-rw-r--r--test/Preprocessor/has_include.c48
-rw-r--r--test/Preprocessor/init.c440
-rw-r--r--test/Preprocessor/line-directive.c14
-rw-r--r--test/Preprocessor/macro_fn.c18
-rw-r--r--test/Preprocessor/macro_paste_c_block_comment.c4
-rw-r--r--test/Preprocessor/macro_paste_identifier_error.c7
-rw-r--r--test/Preprocessor/mmx.c3
-rw-r--r--test/Preprocessor/non_fragile_feature1.m2
-rw-r--r--test/Preprocessor/pp-record.c11
-rw-r--r--test/Preprocessor/predefined-arch-macros.c205
-rw-r--r--test/Preprocessor/predefined-macros.c13
-rw-r--r--test/Preprocessor/undef-error.c2
-rw-r--r--test/Preprocessor/warning_tests.c8
17 files changed, 812 insertions, 63 deletions
diff --git a/test/Preprocessor/_Pragma-location.c b/test/Preprocessor/_Pragma-location.c
index 8b68d6c..5031ee4 100644
--- a/test/Preprocessor/_Pragma-location.c
+++ b/test/Preprocessor/_Pragma-location.c
@@ -1,4 +1,47 @@
-// RUN: %clang_cc1 %s -E | not grep 'scratch space'
+// RUN: %clang_cc1 %s -fms-extensions -E | FileCheck %s
+// We use -fms-extensions to test both _Pragma and __pragma.
-#define push _Pragma ("pack(push)")
-push
+// A long time ago the pragma lexer's buffer showed through in -E output.
+// CHECK-NOT: scratch space
+
+#define push_p _Pragma ("pack(push)")
+push_p
+// CHECK: #pragma pack(push)
+
+push_p _Pragma("pack(push)") __pragma(pack(push))
+// CHECK: #pragma pack(push)
+// CHECK-NEXT: #line 11 "{{.*}}_Pragma-location.c"
+// CHECK-NEXT: #pragma pack(push)
+// CHECK-NEXT: #line 11 "{{.*}}_Pragma-location.c"
+// CHECK-NEXT: #pragma pack(push)
+
+
+#define __PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS _Pragma("clang diagnostic push") \
+_Pragma("clang diagnostic ignored \"-Wformat-extra-args\"")
+#define __PRAGMA_POP_NO_EXTRA_ARG_WARNINGS _Pragma("clang diagnostic pop")
+
+void test () {
+ 1;_Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wformat-extra-args\"")
+ _Pragma("clang diagnostic pop")
+
+ 2;__PRAGMA_PUSH_NO_EXTRA_ARG_WARNINGS
+ 3;__PRAGMA_POP_NO_EXTRA_ARG_WARNINGS
+}
+
+// CHECK: void test () {
+// CHECK-NEXT: 1;
+// CHECK-NEXT: #line 24 "{{.*}}_Pragma-location.c"
+// CHECK-NEXT: #pragma clang diagnostic push
+// CHECK-NEXT: #pragma clang diagnostic ignored "-Wformat-extra-args"
+// CHECK-NEXT: #pragma clang diagnostic pop
+
+// CHECK: 2;
+// CHECK-NEXT: #line 28 "{{.*}}_Pragma-location.c"
+// CHECK-NEXT: #pragma clang diagnostic push
+// CHECK-NEXT: #line 28 "{{.*}}_Pragma-location.c"
+// CHECK-NEXT: #pragma clang diagnostic ignored "-Wformat-extra-args"
+// CHECK-NEXT: 3;
+// CHECK-NEXT: #line 29 "{{.*}}_Pragma-location.c"
+// CHECK-NEXT: #pragma clang diagnostic pop
+// CHECK-NEXT: }
diff --git a/test/Preprocessor/comment_save.c b/test/Preprocessor/comment_save.c
index b860042..1100ea2 100644
--- a/test/Preprocessor/comment_save.c
+++ b/test/Preprocessor/comment_save.c
@@ -6,3 +6,17 @@
/* bar */
// CHECK: /* bar */
+#if FOO
+#endif
+/* baz */
+// CHECK: /* baz */
+
+_Pragma("unknown") // after unknown pragma
+// CHECK: #pragma unknown
+// CHECK-NEXT: #
+// CHECK-NEXT: // after unknown pragma
+
+_Pragma("comment(\"abc\")") // after known pragma
+// CHECK: #pragma comment("abc")
+// CHECK-NEXT: #
+// CHECK-NEXT: // after known pragma
diff --git a/test/Preprocessor/disabled-cond-diags2.c b/test/Preprocessor/disabled-cond-diags2.c
new file mode 100644
index 0000000..d0629ae
--- /dev/null
+++ b/test/Preprocessor/disabled-cond-diags2.c
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -Eonly -verify %s
+
+#if 0
+#if 1
+#endif junk // shouldn't produce diagnostics
+#endif
+
+#if 0
+#endif junk // expected-warning{{extra tokens at end of #endif directive}}
+
+#if 1 junk // expected-error{{token is not a valid binary operator in a preprocessor subexpression}}
+#X // shouldn't produce diagnostics (block #if condition not valid, so skipped)
+#else
+#X // expected-error{{invalid preprocessing directive}}
+#endif
+
+#if 0
+// diagnostics should not be produced until final #endif
+#X
+#include
+#if 1 junk
+#else junk
+#endif junk
+#line -2
+#error
+#warning
+#endif junk // expected-warning{{extra tokens at end of #endif directive}}
diff --git a/test/Preprocessor/has_attribute.c b/test/Preprocessor/has_attribute.c
index 80f53a5..711cf67 100644
--- a/test/Preprocessor/has_attribute.c
+++ b/test/Preprocessor/has_attribute.c
@@ -24,3 +24,13 @@ int has_has_attribute();
#if !__has_attribute(something_we_dont_have)
int has_something_we_dont_have();
#endif
+
+// rdar://10253857
+#if __has_attribute(__const)
+ int fn3() __attribute__ ((__const));
+#endif
+
+#if __has_attribute(const)
+ static int constFunction() __attribute__((const));
+#endif
+
diff --git a/test/Preprocessor/has_include.c b/test/Preprocessor/has_include.c
index fdcae78..13c8d56 100644
--- a/test/Preprocessor/has_include.c
+++ b/test/Preprocessor/has_include.c
@@ -65,19 +65,45 @@
#endif
// Try badly formed expressions.
-// FIXME: I don't quite know how to avoid preprocessor side effects.
-// Use FileCheck?
-// It also assert due to unterminated #if's.
+// FIXME: We can recover better in almost all of these cases. (PR13335)
+
+// expected-error@+1 {{missing '(' after '__has_include'}} expected-error@+1 {{expected end of line}}
+#if __has_include "stdint.h")
+#endif
+
+// expected-error@+1 {{expected "FILENAME" or <FILENAME>}} expected-error@+1 {{token is not a valid binary operator in a preprocessor subexpression}}
+#if __has_include(stdint.h)
+#endif
+
+// expected-error@+1 {{expected "FILENAME" or <FILENAME>}}
+#if __has_include()
+#endif
+
+// expected-error@+1 {{missing '(' after '__has_include'}}
+#if __has_include)
+#endif
+
+// expected-error@+1 {{missing '(' after '__has_include'}} expected-error@+1 {{token is not a valid binary operator in a preprocessor subexpression}}
+#if __has_include<stdint.h>)
+#endif
+
+// expected-error@+1 {{expected "FILENAME" or <FILENAME>}} expected-warning@+1 {{missing terminating '"' character}}
+#if __has_include("stdint.h)
+#endif
+
+// expected-error@+1 {{expected "FILENAME" or <FILENAME>}} expected-warning@+1 {{missing terminating '"' character}} expected-error@+1 {{token is not a valid binary operator in a preprocessor subexpression}}
+#if __has_include(stdint.h")
+#endif
+
+// expected-error@+1 {{expected "FILENAME" or <FILENAME>}} expected-error@+1 {{token is not a valid binary operator in a preprocessor subexpression}}
+#if __has_include(stdint.h>)
+#endif
+
+
+// FIXME: These test cases cause the compiler to crash. (PR13334)
//#if __has_include("stdint.h"
-//#if __has_include "stdint.h")
-//#if __has_include(stdint.h)
-//#if __has_include()
//#if __has_include(
-//#if __has_include)
//#if __has_include
//#if __has_include(<stdint.h>
-//#if __has_include<stdint.h>)
-//#if __has_include("stdint.h)
-//#if __has_include(stdint.h")
//#if __has_include(<stdint.h)
-//#if __has_include(stdint.h>)
+
diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c
index e0f45f1..e7321e0 100644
--- a/test/Preprocessor/init.c
+++ b/test/Preprocessor/init.c
@@ -48,6 +48,9 @@
// COMMON:#define __GNUC_STDC_INLINE__ 1
// COMMON:#define __GNUC__
// COMMON:#define __GXX_ABI_VERSION
+// COMMON:#define __ORDER_BIG_ENDIAN__ 4321
+// COMMON:#define __ORDER_LITTLE_ENDIAN__ 1234
+// COMMON:#define __ORDER_PDP_ENDIAN__ 3412
// COMMON:#define __STDC_HOSTED__ 1
// COMMON:#define __STDC_VERSION__
// COMMON:#define __STDC__ 1
@@ -62,12 +65,21 @@
//
// RUN: %clang_cc1 -ffreestanding -E -dM < /dev/null | FileCheck -check-prefix FREESTANDING %s
// FREESTANDING:#define __STDC_HOSTED__ 0
-//
+//
+//
+// RUN: %clang_cc1 -x c++ -std=gnu++11 -E -dM < /dev/null | FileCheck -check-prefix GXX11 %s
+//
+// GXX11:#define __GNUG__
+// GXX11:#define __GXX_WEAK__ 1
+// GXX11:#define __cplusplus 201103L
+// GXX11:#define __private_extern__ extern
+//
+//
// RUN: %clang_cc1 -x c++ -std=gnu++98 -E -dM < /dev/null | FileCheck -check-prefix GXX98 %s
//
// GXX98:#define __GNUG__
// GXX98:#define __GXX_WEAK__ 1
-// GXX98:#define __cplusplus 1
+// GXX98:#define __cplusplus 199711L
// GXX98:#define __private_extern__ extern
//
//
@@ -76,7 +88,7 @@
// C94:#define __STDC_VERSION__ 199409L
//
//
-// RUN: %clang_cc1 -fms-extensions -triple i686-pc-win32 -fobjc-fragile-abi -E -dM < /dev/null | FileCheck -check-prefix MSEXT %s
+// RUN: %clang_cc1 -fms-extensions -triple i686-pc-win32 -fobjc-runtime=gcc -E -dM < /dev/null | FileCheck -check-prefix MSEXT %s
//
// MSEXT-NOT:#define __STDC__
// MSEXT:#define _INTEGRAL_MAX_BITS 64
@@ -99,12 +111,39 @@
// NONFRAGILE:#define OBJC_ZEROCOST_EXCEPTIONS 1
// NONFRAGILE:#define __OBJC2__ 1
//
-//
+//
+// RUN: %clang_cc1 -O0 -E -dM < /dev/null | FileCheck -check-prefix O0 %s
+//
+// O0:#define __NO_INLINE__ 1
+// O0-NOT:#define __OPTIMIZE_SIZE__
+// O0-NOT:#define __OPTIMIZE__
+//
+//
+// RUN: %clang_cc1 -fno-inline -O3 -E -dM < /dev/null | FileCheck -check-prefix NO_INLINE %s
+//
+// NO_INLINE:#define __NO_INLINE__ 1
+// NO_INLINE-NOT:#define __OPTIMIZE_SIZE__
+// NO_INLINE:#define __OPTIMIZE__
+//
+//
// RUN: %clang_cc1 -O1 -E -dM < /dev/null | FileCheck -check-prefix O1 %s
//
+// O1-NOT:#define __OPTIMIZE_SIZE__
// O1:#define __OPTIMIZE__ 1
//
-//
+//
+// RUN: %clang_cc1 -Os -E -dM < /dev/null | FileCheck -check-prefix Os %s
+//
+// Os:#define __OPTIMIZE_SIZE__ 1
+// Os:#define __OPTIMIZE__ 1
+//
+//
+// RUN: %clang_cc1 -Oz -E -dM < /dev/null | FileCheck -check-prefix Oz %s
+//
+// Oz:#define __OPTIMIZE_SIZE__ 1
+// Oz:#define __OPTIMIZE__ 1
+//
+//
// RUN: %clang_cc1 -fpascal-strings -E -dM < /dev/null | FileCheck -check-prefix PASCAL %s
//
// PASCAL:#define __PASCAL_STRINGS__ 1
@@ -125,9 +164,11 @@
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-none-none < /dev/null | FileCheck -check-prefix ARM %s
//
+// ARM-NOT:#define _LP64
// ARM:#define __APCS_32__ 1
// ARM:#define __ARMEL__ 1
// ARM:#define __ARM_ARCH_6J__ 1
+// ARM:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// ARM:#define __CHAR16_TYPE__ unsigned short
// ARM:#define __CHAR32_TYPE__ unsigned int
// ARM:#define __CHAR_BIT__ 8
@@ -187,7 +228,7 @@
// ARM:#define __LITTLE_ENDIAN__ 1
// ARM:#define __LONG_LONG_MAX__ 9223372036854775807LL
// ARM:#define __LONG_MAX__ 2147483647L
-// ARM:#define __NO_INLINE__ 1
+// ARM-NOT:#define __LP64__
// ARM:#define __POINTER_WIDTH__ 32
// ARM:#define __PTRDIFF_TYPE__ int
// ARM:#define __PTRDIFF_WIDTH__ 32
@@ -222,6 +263,8 @@
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-none-none < /dev/null | FileCheck -check-prefix I386 %s
//
+// I386-NOT:#define _LP64
+// I386:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// I386:#define __CHAR16_TYPE__ unsigned short
// I386:#define __CHAR32_TYPE__ unsigned int
// I386:#define __CHAR_BIT__ 8
@@ -281,7 +324,7 @@
// I386:#define __LITTLE_ENDIAN__ 1
// I386:#define __LONG_LONG_MAX__ 9223372036854775807LL
// I386:#define __LONG_MAX__ 2147483647L
-// I386:#define __NO_INLINE__ 1
+// I386-NOT:#define __LP64__
// I386:#define __NO_MATH_INLINES 1
// I386:#define __POINTER_WIDTH__ 32
// I386:#define __PTRDIFF_TYPE__ int
@@ -317,6 +360,8 @@
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-pc-linux-gnu -target-cpu pentium4 < /dev/null | FileCheck -check-prefix I386-LINUX %s
//
+// I386-LINUX-NOT:#define _LP64
+// I386-LINUX:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// I386-LINUX:#define __CHAR16_TYPE__ unsigned short
// I386-LINUX:#define __CHAR32_TYPE__ unsigned int
// I386-LINUX:#define __CHAR_BIT__ 8
@@ -376,7 +421,7 @@
// I386-LINUX:#define __LITTLE_ENDIAN__ 1
// I386-LINUX:#define __LONG_LONG_MAX__ 9223372036854775807LL
// I386-LINUX:#define __LONG_MAX__ 2147483647L
-// I386-LINUX:#define __NO_INLINE__ 1
+// I386-LINUX-NOT:#define __LP64__
// I386-LINUX:#define __NO_MATH_INLINES 1
// I386-LINUX:#define __POINTER_WIDTH__ 32
// I386-LINUX:#define __PTRDIFF_TYPE__ int
@@ -414,11 +459,13 @@
//
// MIPS32BE:#define MIPSEB 1
// MIPS32BE:#define _ABIO32 1
+// MIPS32BE-NOT:#define _LP64
// MIPS32BE:#define _MIPSEB 1
// MIPS32BE:#define _MIPS_SIM _ABIO32
// MIPS32BE:#define _MIPS_SZINT 32
// MIPS32BE:#define _MIPS_SZLONG 32
// MIPS32BE:#define _MIPS_SZPTR 32
+// MIPS32BE:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// MIPS32BE:#define __CHAR16_TYPE__ unsigned short
// MIPS32BE:#define __CHAR32_TYPE__ unsigned int
// MIPS32BE:#define __CHAR_BIT__ 8
@@ -478,9 +525,9 @@
// MIPS32BE:#define __LDBL_MIN__ 2.2250738585072014e-308
// MIPS32BE:#define __LONG_LONG_MAX__ 9223372036854775807LL
// MIPS32BE:#define __LONG_MAX__ 2147483647L
+// MIPS32BE-NOT:#define __LP64__
// MIPS32BE:#define __MIPSEB 1
// MIPS32BE:#define __MIPSEB__ 1
-// MIPS32BE:#define __NO_INLINE__ 1
// MIPS32BE:#define __POINTER_WIDTH__ 32
// MIPS32BE:#define __PRAGMA_REDEFINE_EXTNAME 1
// MIPS32BE:#define __PTRDIFF_TYPE__ int
@@ -526,11 +573,13 @@
//
// MIPS32EL:#define MIPSEL 1
// MIPS32EL:#define _ABIO32 1
+// MIPS32EL-NOT:#define _LP64
// MIPS32EL:#define _MIPSEL 1
// MIPS32EL:#define _MIPS_SIM _ABIO32
// MIPS32EL:#define _MIPS_SZINT 32
// MIPS32EL:#define _MIPS_SZLONG 32
// MIPS32EL:#define _MIPS_SZPTR 32
+// MIPS32EL:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// MIPS32EL:#define __CHAR16_TYPE__ unsigned short
// MIPS32EL:#define __CHAR32_TYPE__ unsigned int
// MIPS32EL:#define __CHAR_BIT__ 8
@@ -590,9 +639,9 @@
// MIPS32EL:#define __LDBL_MIN__ 2.2250738585072014e-308
// MIPS32EL:#define __LONG_LONG_MAX__ 9223372036854775807LL
// MIPS32EL:#define __LONG_MAX__ 2147483647L
+// MIPS32EL-NOT:#define __LP64__
// MIPS32EL:#define __MIPSEL 1
// MIPS32EL:#define __MIPSEL__ 1
-// MIPS32EL:#define __NO_INLINE__ 1
// MIPS32EL:#define __POINTER_WIDTH__ 32
// MIPS32EL:#define __PRAGMA_REDEFINE_EXTNAME 1
// MIPS32EL:#define __PTRDIFF_TYPE__ int
@@ -635,11 +684,13 @@
//
// MIPS64BE:#define MIPSEB 1
// MIPS64BE:#define _ABI64 3
+// MIPS64BE:#define _LP64 1
// MIPS64BE:#define _MIPSEB 1
// MIPS64BE:#define _MIPS_SIM _ABI64
// MIPS64BE:#define _MIPS_SZINT 32
// MIPS64BE:#define _MIPS_SZLONG 64
// MIPS64BE:#define _MIPS_SZPTR 64
+// MIPS64BE:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// MIPS64BE:#define __CHAR16_TYPE__ unsigned short
// MIPS64BE:#define __CHAR32_TYPE__ unsigned int
// MIPS64BE:#define __CHAR_BIT__ 8
@@ -699,9 +750,9 @@
// MIPS64BE:#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
// MIPS64BE:#define __LONG_LONG_MAX__ 9223372036854775807LL
// MIPS64BE:#define __LONG_MAX__ 9223372036854775807L
+// MIPS64BE:#define __LP64__ 1
// MIPS64BE:#define __MIPSEB 1
// MIPS64BE:#define __MIPSEB__ 1
-// MIPS64BE:#define __NO_INLINE__ 1
// MIPS64BE:#define __POINTER_WIDTH__ 64
// MIPS64BE:#define __PRAGMA_REDEFINE_EXTNAME 1
// MIPS64BE:#define __PTRDIFF_TYPE__ long int
@@ -744,11 +795,13 @@
//
// MIPS64EL:#define MIPSEL 1
// MIPS64EL:#define _ABI64 3
+// MIPS64EL:#define _LP64 1
// MIPS64EL:#define _MIPSEL 1
// MIPS64EL:#define _MIPS_SIM _ABI64
// MIPS64EL:#define _MIPS_SZINT 32
// MIPS64EL:#define _MIPS_SZLONG 64
// MIPS64EL:#define _MIPS_SZPTR 64
+// MIPS64EL:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// MIPS64EL:#define __CHAR16_TYPE__ unsigned short
// MIPS64EL:#define __CHAR32_TYPE__ unsigned int
// MIPS64EL:#define __CHAR_BIT__ 8
@@ -808,9 +861,9 @@
// MIPS64EL:#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
// MIPS64EL:#define __LONG_LONG_MAX__ 9223372036854775807LL
// MIPS64EL:#define __LONG_MAX__ 9223372036854775807L
+// MIPS64EL:#define __LP64__ 1
// MIPS64EL:#define __MIPSEL 1
// MIPS64EL:#define __MIPSEL__ 1
-// MIPS64EL:#define __NO_INLINE__ 1
// MIPS64EL:#define __POINTER_WIDTH__ 64
// MIPS64EL:#define __PRAGMA_REDEFINE_EXTNAME 1
// MIPS64EL:#define __PTRDIFF_TYPE__ long int
@@ -864,11 +917,40 @@
// RUN: %clang_cc1 -target-feature +single-float -E -dM -ffreestanding \
// RUN: -triple=mips-none-none < /dev/null \
// RUN: | FileCheck -check-prefix MIPS-FABI-SINGLE %s
+// MIPS-FABI-SINGLE:#define __mips_hard_float 1
// MIPS-FABI-SINGLE:#define __mips_single_float 1
//
+// Check MIPS features macros
+//
+// RUN: %clang_cc1 -target-feature +mips16 \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS16 %s
+// MIPS16:#define __mips16 1
+//
+// RUN: %clang_cc1 -target-feature -mips16 \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix NOMIPS16 %s
+// NOMIPS16-NOT:#define __mips16 1
+//
+// RUN: %clang_cc1 -target-feature +dsp \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS-DSP %s
+// MIPS-DSP:#define __mips_dsp 1
+// MIPS-DSP:#define __mips_dsp_rev 1
+// MIPS-DSP-NOT:#define __mips_dspr2 1
+//
+// RUN: %clang_cc1 -target-feature +dspr2 \
+// RUN: -E -dM -triple=mips-none-none < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS-DSPR2 %s
+// MIPS-DSPR2:#define __mips_dsp 1
+// MIPS-DSPR2:#define __mips_dsp_rev 2
+// MIPS-DSPR2:#define __mips_dspr2 1
+//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=msp430-none-none < /dev/null | FileCheck -check-prefix MSP430 %s
//
// MSP430:#define MSP430 1
+// MSP430-NOT:#define _LP64
+// MSP430:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// MSP430:#define __CHAR16_TYPE__ unsigned short
// MSP430:#define __CHAR32_TYPE__ unsigned int
// MSP430:#define __CHAR_BIT__ 8
@@ -926,8 +1008,8 @@
// MSP430:#define __LDBL_MIN__ 2.2250738585072014e-308
// MSP430:#define __LONG_LONG_MAX__ 9223372036854775807LL
// MSP430:#define __LONG_MAX__ 2147483647L
+// MSP430-NOT:#define __LP64__
// MSP430:#define __MSP430__ 1
-// MSP430:#define __NO_INLINE__ 1
// MSP430:#define __POINTER_WIDTH__ 16
// MSP430:#define __PTRDIFF_TYPE__ int
// MSP430:#define __PTRDIFF_WIDTH__ 16
@@ -957,13 +1039,315 @@
// MSP430:#define __WINT_WIDTH__ 16
// MSP430:#define __clang__ 1
//
-// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -fno-signed-char < /dev/null | FileCheck -check-prefix PPC64 %s
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=nvptx-none-none < /dev/null | FileCheck -check-prefix NVPTX32 %s
+//
+// NVPTX32-NOT:#define _LP64
+// NVPTX32:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+// NVPTX32:#define __CHAR16_TYPE__ unsigned short
+// NVPTX32:#define __CHAR32_TYPE__ unsigned int
+// NVPTX32:#define __CHAR_BIT__ 8
+// NVPTX32:#define __CONSTANT_CFSTRINGS__ 1
+// NVPTX32:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// NVPTX32:#define __DBL_DIG__ 15
+// NVPTX32:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// NVPTX32:#define __DBL_HAS_DENORM__ 1
+// NVPTX32:#define __DBL_HAS_INFINITY__ 1
+// NVPTX32:#define __DBL_HAS_QUIET_NAN__ 1
+// NVPTX32:#define __DBL_MANT_DIG__ 53
+// NVPTX32:#define __DBL_MAX_10_EXP__ 308
+// NVPTX32:#define __DBL_MAX_EXP__ 1024
+// NVPTX32:#define __DBL_MAX__ 1.7976931348623157e+308
+// NVPTX32:#define __DBL_MIN_10_EXP__ (-307)
+// NVPTX32:#define __DBL_MIN_EXP__ (-1021)
+// NVPTX32:#define __DBL_MIN__ 2.2250738585072014e-308
+// NVPTX32:#define __DECIMAL_DIG__ 17
+// NVPTX32:#define __FINITE_MATH_ONLY__ 0
+// NVPTX32:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// NVPTX32:#define __FLT_DIG__ 6
+// NVPTX32:#define __FLT_EPSILON__ 1.19209290e-7F
+// NVPTX32:#define __FLT_EVAL_METHOD__ 0
+// NVPTX32:#define __FLT_HAS_DENORM__ 1
+// NVPTX32:#define __FLT_HAS_INFINITY__ 1
+// NVPTX32:#define __FLT_HAS_QUIET_NAN__ 1
+// NVPTX32:#define __FLT_MANT_DIG__ 24
+// NVPTX32:#define __FLT_MAX_10_EXP__ 38
+// NVPTX32:#define __FLT_MAX_EXP__ 128
+// NVPTX32:#define __FLT_MAX__ 3.40282347e+38F
+// NVPTX32:#define __FLT_MIN_10_EXP__ (-37)
+// NVPTX32:#define __FLT_MIN_EXP__ (-125)
+// NVPTX32:#define __FLT_MIN__ 1.17549435e-38F
+// NVPTX32:#define __FLT_RADIX__ 2
+// NVPTX32:#define __INT16_TYPE__ short
+// NVPTX32:#define __INT32_TYPE__ int
+// NVPTX32:#define __INT64_C_SUFFIX__ LL
+// NVPTX32:#define __INT64_TYPE__ long long int
+// NVPTX32:#define __INT8_TYPE__ char
+// NVPTX32:#define __INTMAX_MAX__ 9223372036854775807LL
+// NVPTX32:#define __INTMAX_TYPE__ long long int
+// NVPTX32:#define __INTMAX_WIDTH__ 64
+// NVPTX32:#define __INTPTR_TYPE__ unsigned int
+// NVPTX32:#define __INTPTR_WIDTH__ 32
+// NVPTX32:#define __INT_MAX__ 2147483647
+// NVPTX32:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324
+// NVPTX32:#define __LDBL_DIG__ 15
+// NVPTX32:#define __LDBL_EPSILON__ 2.2204460492503131e-16
+// NVPTX32:#define __LDBL_HAS_DENORM__ 1
+// NVPTX32:#define __LDBL_HAS_INFINITY__ 1
+// NVPTX32:#define __LDBL_HAS_QUIET_NAN__ 1
+// NVPTX32:#define __LDBL_MANT_DIG__ 53
+// NVPTX32:#define __LDBL_MAX_10_EXP__ 308
+// NVPTX32:#define __LDBL_MAX_EXP__ 1024
+// NVPTX32:#define __LDBL_MAX__ 1.7976931348623157e+308
+// NVPTX32:#define __LDBL_MIN_10_EXP__ (-307)
+// NVPTX32:#define __LDBL_MIN_EXP__ (-1021)
+// NVPTX32:#define __LDBL_MIN__ 2.2250738585072014e-308
+// NVPTX32:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// NVPTX32:#define __LONG_MAX__ 9223372036854775807L
+// NVPTX32-NOT:#define __LP64__
+// NVPTX32:#define __NVPTX__ 1
+// NVPTX32:#define __POINTER_WIDTH__ 32
+// NVPTX32:#define __PRAGMA_REDEFINE_EXTNAME 1
+// NVPTX32:#define __PTRDIFF_TYPE__ unsigned int
+// NVPTX32:#define __PTRDIFF_WIDTH__ 32
+// NVPTX32:#define __PTX__ 1
+// NVPTX32:#define __SCHAR_MAX__ 127
+// NVPTX32:#define __SHRT_MAX__ 32767
+// NVPTX32:#define __SIG_ATOMIC_WIDTH__ 32
+// NVPTX32:#define __SIZEOF_DOUBLE__ 8
+// NVPTX32:#define __SIZEOF_FLOAT__ 4
+// NVPTX32:#define __SIZEOF_INT__ 4
+// NVPTX32:#define __SIZEOF_LONG_DOUBLE__ 8
+// NVPTX32:#define __SIZEOF_LONG_LONG__ 8
+// NVPTX32:#define __SIZEOF_LONG__ 8
+// NVPTX32:#define __SIZEOF_POINTER__ 4
+// NVPTX32:#define __SIZEOF_PTRDIFF_T__ 4
+// NVPTX32:#define __SIZEOF_SHORT__ 2
+// NVPTX32:#define __SIZEOF_SIZE_T__ 4
+// NVPTX32:#define __SIZEOF_WCHAR_T__ 4
+// NVPTX32:#define __SIZEOF_WINT_T__ 4
+// NVPTX32:#define __SIZE_TYPE__ unsigned int
+// NVPTX32:#define __SIZE_WIDTH__ 32
+// NVPTX32:#define __UINTMAX_TYPE__ long long unsigned int
+// NVPTX32:#define __USER_LABEL_PREFIX__ _
+// NVPTX32:#define __WCHAR_MAX__ 2147483647
+// NVPTX32:#define __WCHAR_TYPE__ int
+// NVPTX32:#define __WCHAR_WIDTH__ 32
+// NVPTX32:#define __WINT_TYPE__ int
+// NVPTX32:#define __WINT_WIDTH__ 32
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=nvptx64-none-none < /dev/null | FileCheck -check-prefix NVPTX64 %s
+//
+// NVPTX64:#define _LP64 1
+// NVPTX64:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+// NVPTX64:#define __CHAR16_TYPE__ unsigned short
+// NVPTX64:#define __CHAR32_TYPE__ unsigned int
+// NVPTX64:#define __CHAR_BIT__ 8
+// NVPTX64:#define __CONSTANT_CFSTRINGS__ 1
+// NVPTX64:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// NVPTX64:#define __DBL_DIG__ 15
+// NVPTX64:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// NVPTX64:#define __DBL_HAS_DENORM__ 1
+// NVPTX64:#define __DBL_HAS_INFINITY__ 1
+// NVPTX64:#define __DBL_HAS_QUIET_NAN__ 1
+// NVPTX64:#define __DBL_MANT_DIG__ 53
+// NVPTX64:#define __DBL_MAX_10_EXP__ 308
+// NVPTX64:#define __DBL_MAX_EXP__ 1024
+// NVPTX64:#define __DBL_MAX__ 1.7976931348623157e+308
+// NVPTX64:#define __DBL_MIN_10_EXP__ (-307)
+// NVPTX64:#define __DBL_MIN_EXP__ (-1021)
+// NVPTX64:#define __DBL_MIN__ 2.2250738585072014e-308
+// NVPTX64:#define __DECIMAL_DIG__ 17
+// NVPTX64:#define __FINITE_MATH_ONLY__ 0
+// NVPTX64:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// NVPTX64:#define __FLT_DIG__ 6
+// NVPTX64:#define __FLT_EPSILON__ 1.19209290e-7F
+// NVPTX64:#define __FLT_EVAL_METHOD__ 0
+// NVPTX64:#define __FLT_HAS_DENORM__ 1
+// NVPTX64:#define __FLT_HAS_INFINITY__ 1
+// NVPTX64:#define __FLT_HAS_QUIET_NAN__ 1
+// NVPTX64:#define __FLT_MANT_DIG__ 24
+// NVPTX64:#define __FLT_MAX_10_EXP__ 38
+// NVPTX64:#define __FLT_MAX_EXP__ 128
+// NVPTX64:#define __FLT_MAX__ 3.40282347e+38F
+// NVPTX64:#define __FLT_MIN_10_EXP__ (-37)
+// NVPTX64:#define __FLT_MIN_EXP__ (-125)
+// NVPTX64:#define __FLT_MIN__ 1.17549435e-38F
+// NVPTX64:#define __FLT_RADIX__ 2
+// NVPTX64:#define __INT16_TYPE__ short
+// NVPTX64:#define __INT32_TYPE__ int
+// NVPTX64:#define __INT64_C_SUFFIX__ LL
+// NVPTX64:#define __INT64_TYPE__ long long int
+// NVPTX64:#define __INT8_TYPE__ char
+// NVPTX64:#define __INTMAX_MAX__ 9223372036854775807LL
+// NVPTX64:#define __INTMAX_TYPE__ long long int
+// NVPTX64:#define __INTMAX_WIDTH__ 64
+// NVPTX64:#define __INTPTR_TYPE__ long long unsigned int
+// NVPTX64:#define __INTPTR_WIDTH__ 64
+// NVPTX64:#define __INT_MAX__ 2147483647
+// NVPTX64:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324
+// NVPTX64:#define __LDBL_DIG__ 15
+// NVPTX64:#define __LDBL_EPSILON__ 2.2204460492503131e-16
+// NVPTX64:#define __LDBL_HAS_DENORM__ 1
+// NVPTX64:#define __LDBL_HAS_INFINITY__ 1
+// NVPTX64:#define __LDBL_HAS_QUIET_NAN__ 1
+// NVPTX64:#define __LDBL_MANT_DIG__ 53
+// NVPTX64:#define __LDBL_MAX_10_EXP__ 308
+// NVPTX64:#define __LDBL_MAX_EXP__ 1024
+// NVPTX64:#define __LDBL_MAX__ 1.7976931348623157e+308
+// NVPTX64:#define __LDBL_MIN_10_EXP__ (-307)
+// NVPTX64:#define __LDBL_MIN_EXP__ (-1021)
+// NVPTX64:#define __LDBL_MIN__ 2.2250738585072014e-308
+// NVPTX64:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// NVPTX64:#define __LONG_MAX__ 9223372036854775807L
+// NVPTX64:#define __LP64__ 1
+// NVPTX64:#define __NVPTX__ 1
+// NVPTX64:#define __POINTER_WIDTH__ 64
+// NVPTX64:#define __PRAGMA_REDEFINE_EXTNAME 1
+// NVPTX64:#define __PTRDIFF_TYPE__ long long unsigned int
+// NVPTX64:#define __PTRDIFF_WIDTH__ 64
+// NVPTX64:#define __PTX__ 1
+// NVPTX64:#define __SCHAR_MAX__ 127
+// NVPTX64:#define __SHRT_MAX__ 32767
+// NVPTX64:#define __SIG_ATOMIC_WIDTH__ 32
+// NVPTX64:#define __SIZEOF_DOUBLE__ 8
+// NVPTX64:#define __SIZEOF_FLOAT__ 4
+// NVPTX64:#define __SIZEOF_INT__ 4
+// NVPTX64:#define __SIZEOF_LONG_DOUBLE__ 8
+// NVPTX64:#define __SIZEOF_LONG_LONG__ 8
+// NVPTX64:#define __SIZEOF_LONG__ 8
+// NVPTX64:#define __SIZEOF_POINTER__ 8
+// NVPTX64:#define __SIZEOF_PTRDIFF_T__ 8
+// NVPTX64:#define __SIZEOF_SHORT__ 2
+// NVPTX64:#define __SIZEOF_SIZE_T__ 8
+// NVPTX64:#define __SIZEOF_WCHAR_T__ 4
+// NVPTX64:#define __SIZEOF_WINT_T__ 4
+// NVPTX64:#define __SIZE_TYPE__ long long unsigned int
+// NVPTX64:#define __SIZE_WIDTH__ 64
+// NVPTX64:#define __UINTMAX_TYPE__ long long unsigned int
+// NVPTX64:#define __USER_LABEL_PREFIX__ _
+// NVPTX64:#define __WCHAR_MAX__ 2147483647
+// NVPTX64:#define __WCHAR_TYPE__ int
+// NVPTX64:#define __WCHAR_WIDTH__ 32
+// NVPTX64:#define __WINT_TYPE__ int
+// NVPTX64:#define __WINT_WIDTH__ 32
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc-none-none -target-cpu 603e < /dev/null | FileCheck -check-prefix PPC603E %s
+//
+// PPC603E:#define _ARCH_603 1
+// PPC603E:#define _ARCH_603E 1
+// PPC603E:#define _ARCH_PPC 1
+// PPC603E:#define _ARCH_PPCGR 1
+// PPC603E:#define _BIG_ENDIAN 1
+// PPC603E-NOT:#define _LP64
+// PPC603E:#define __BIG_ENDIAN__ 1
+// PPC603E:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
+// PPC603E:#define __CHAR16_TYPE__ unsigned short
+// PPC603E:#define __CHAR32_TYPE__ unsigned int
+// PPC603E:#define __CHAR_BIT__ 8
+// PPC603E:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// PPC603E:#define __DBL_DIG__ 15
+// PPC603E:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// PPC603E:#define __DBL_HAS_DENORM__ 1
+// PPC603E:#define __DBL_HAS_INFINITY__ 1
+// PPC603E:#define __DBL_HAS_QUIET_NAN__ 1
+// PPC603E:#define __DBL_MANT_DIG__ 53
+// PPC603E:#define __DBL_MAX_10_EXP__ 308
+// PPC603E:#define __DBL_MAX_EXP__ 1024
+// PPC603E:#define __DBL_MAX__ 1.7976931348623157e+308
+// PPC603E:#define __DBL_MIN_10_EXP__ (-307)
+// PPC603E:#define __DBL_MIN_EXP__ (-1021)
+// PPC603E:#define __DBL_MIN__ 2.2250738585072014e-308
+// PPC603E:#define __DECIMAL_DIG__ 33
+// PPC603E:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// PPC603E:#define __FLT_DIG__ 6
+// PPC603E:#define __FLT_EPSILON__ 1.19209290e-7F
+// PPC603E:#define __FLT_EVAL_METHOD__ 0
+// PPC603E:#define __FLT_HAS_DENORM__ 1
+// PPC603E:#define __FLT_HAS_INFINITY__ 1
+// PPC603E:#define __FLT_HAS_QUIET_NAN__ 1
+// PPC603E:#define __FLT_MANT_DIG__ 24
+// PPC603E:#define __FLT_MAX_10_EXP__ 38
+// PPC603E:#define __FLT_MAX_EXP__ 128
+// PPC603E:#define __FLT_MAX__ 3.40282347e+38F
+// PPC603E:#define __FLT_MIN_10_EXP__ (-37)
+// PPC603E:#define __FLT_MIN_EXP__ (-125)
+// PPC603E:#define __FLT_MIN__ 1.17549435e-38F
+// PPC603E:#define __FLT_RADIX__ 2
+// PPC603E:#define __INT16_TYPE__ short
+// PPC603E:#define __INT32_TYPE__ int
+// PPC603E:#define __INT64_C_SUFFIX__ LL
+// PPC603E:#define __INT64_TYPE__ long long int
+// PPC603E:#define __INT8_TYPE__ char
+// PPC603E:#define __INTMAX_MAX__ 9223372036854775807LL
+// PPC603E:#define __INTMAX_TYPE__ long long int
+// PPC603E:#define __INTMAX_WIDTH__ 64
+// PPC603E:#define __INTPTR_TYPE__ long int
+// PPC603E:#define __INTPTR_WIDTH__ 32
+// PPC603E:#define __INT_MAX__ 2147483647
+// PPC603E:#define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
+// PPC603E:#define __LDBL_DIG__ 31
+// PPC603E:#define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
+// PPC603E:#define __LDBL_HAS_DENORM__ 1
+// PPC603E:#define __LDBL_HAS_INFINITY__ 1
+// PPC603E:#define __LDBL_HAS_QUIET_NAN__ 1
+// PPC603E:#define __LDBL_MANT_DIG__ 106
+// PPC603E:#define __LDBL_MAX_10_EXP__ 308
+// PPC603E:#define __LDBL_MAX_EXP__ 1024
+// PPC603E:#define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
+// PPC603E:#define __LDBL_MIN_10_EXP__ (-291)
+// PPC603E:#define __LDBL_MIN_EXP__ (-968)
+// PPC603E:#define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
+// PPC603E:#define __LONG_DOUBLE_128__ 1
+// PPC603E:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// PPC603E:#define __LONG_MAX__ 2147483647L
+// PPC603E-NOT:#define __LP64__
+// PPC603E:#define __NATURAL_ALIGNMENT__ 1
+// PPC603E:#define __POINTER_WIDTH__ 32
+// PPC603E:#define __POWERPC__ 1
+// PPC603E:#define __PTRDIFF_TYPE__ long int
+// PPC603E:#define __PTRDIFF_WIDTH__ 32
+// PPC603E:#define __REGISTER_PREFIX__
+// PPC603E:#define __SCHAR_MAX__ 127
+// PPC603E:#define __SHRT_MAX__ 32767
+// PPC603E:#define __SIG_ATOMIC_WIDTH__ 32
+// PPC603E:#define __SIZEOF_DOUBLE__ 8
+// PPC603E:#define __SIZEOF_FLOAT__ 4
+// PPC603E:#define __SIZEOF_INT__ 4
+// PPC603E:#define __SIZEOF_LONG_DOUBLE__ 16
+// PPC603E:#define __SIZEOF_LONG_LONG__ 8
+// PPC603E:#define __SIZEOF_LONG__ 4
+// PPC603E:#define __SIZEOF_POINTER__ 4
+// PPC603E:#define __SIZEOF_PTRDIFF_T__ 4
+// PPC603E:#define __SIZEOF_SHORT__ 2
+// PPC603E:#define __SIZEOF_SIZE_T__ 4
+// PPC603E:#define __SIZEOF_WCHAR_T__ 4
+// PPC603E:#define __SIZEOF_WINT_T__ 4
+// PPC603E:#define __SIZE_TYPE__ long unsigned int
+// PPC603E:#define __SIZE_WIDTH__ 32
+// PPC603E:#define __UINTMAX_TYPE__ long long unsigned int
+// PPC603E:#define __USER_LABEL_PREFIX__ _
+// PPC603E:#define __WCHAR_MAX__ 2147483647
+// PPC603E:#define __WCHAR_TYPE__ int
+// PPC603E:#define __WCHAR_WIDTH__ 32
+// PPC603E:#define __WINT_TYPE__ int
+// PPC603E:#define __WINT_WIDTH__ 32
+// PPC603E:#define __powerpc__ 1
+// PPC603E:#define __ppc__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr7 -fno-signed-char < /dev/null | FileCheck -check-prefix PPC64 %s
//
// PPC64:#define _ARCH_PPC 1
// PPC64:#define _ARCH_PPC64 1
+// PPC64:#define _ARCH_PPCGR 1
+// PPC64:#define _ARCH_PPCSQ 1
+// PPC64:#define _ARCH_PWR4 1
+// PPC64:#define _ARCH_PWR5 1
+// PPC64:#define _ARCH_PWR6 1
+// PPC64:#define _ARCH_PWR7 1
// PPC64:#define _BIG_ENDIAN 1
// PPC64:#define _LP64 1
// PPC64:#define __BIG_ENDIAN__ 1
+// PPC64:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// PPC64:#define __CHAR16_TYPE__ unsigned short
// PPC64:#define __CHAR32_TYPE__ unsigned int
// PPC64:#define __CHAR_BIT__ 8
@@ -1026,7 +1410,6 @@
// PPC64:#define __LONG_MAX__ 9223372036854775807L
// PPC64:#define __LP64__ 1
// PPC64:#define __NATURAL_ALIGNMENT__ 1
-// PPC64:#define __NO_INLINE__ 1
// PPC64:#define __POINTER_WIDTH__ 64
// PPC64:#define __POWERPC__ 1
// PPC64:#define __PTRDIFF_TYPE__ long int
@@ -1066,6 +1449,7 @@
// PPC64-LINUX:#define _BIG_ENDIAN 1
// PPC64-LINUX:#define _LP64 1
// PPC64-LINUX:#define __BIG_ENDIAN__ 1
+// PPC64-LINUX:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// PPC64-LINUX:#define __CHAR16_TYPE__ unsigned short
// PPC64-LINUX:#define __CHAR32_TYPE__ unsigned int
// PPC64-LINUX:#define __CHAR_BIT__ 8
@@ -1128,7 +1512,6 @@
// PPC64-LINUX:#define __LONG_MAX__ 9223372036854775807L
// PPC64-LINUX:#define __LP64__ 1
// PPC64-LINUX:#define __NATURAL_ALIGNMENT__ 1
-// PPC64-LINUX:#define __NO_INLINE__ 1
// PPC64-LINUX:#define __POINTER_WIDTH__ 64
// PPC64-LINUX:#define __POWERPC__ 1
// PPC64-LINUX:#define __PTRDIFF_TYPE__ long int
@@ -1168,7 +1551,9 @@
//
// PPC:#define _ARCH_PPC 1
// PPC:#define _BIG_ENDIAN 1
+// PPC-NOT:#define _LP64
// PPC:#define __BIG_ENDIAN__ 1
+// PPC:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// PPC:#define __CHAR16_TYPE__ unsigned short
// PPC:#define __CHAR32_TYPE__ unsigned int
// PPC:#define __CHAR_BIT__ 8
@@ -1229,8 +1614,8 @@
// PPC:#define __LONG_DOUBLE_128__ 1
// PPC:#define __LONG_LONG_MAX__ 9223372036854775807LL
// PPC:#define __LONG_MAX__ 2147483647L
+// PPC-NOT:#define __LP64__
// PPC:#define __NATURAL_ALIGNMENT__ 1
-// PPC:#define __NO_INLINE__ 1
// PPC:#define __POINTER_WIDTH__ 32
// PPC:#define __POWERPC__ 1
// PPC:#define __PTRDIFF_TYPE__ long int
@@ -1266,7 +1651,9 @@
//
// PPC-LINUX:#define _ARCH_PPC 1
// PPC-LINUX:#define _BIG_ENDIAN 1
+// PPC-LINUX-NOT:#define _LP64
// PPC-LINUX:#define __BIG_ENDIAN__ 1
+// PPC-LINUX:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// PPC-LINUX:#define __CHAR16_TYPE__ unsigned short
// PPC-LINUX:#define __CHAR32_TYPE__ unsigned int
// PPC-LINUX:#define __CHAR_BIT__ 8
@@ -1327,8 +1714,8 @@
// PPC-LINUX:#define __LONG_DOUBLE_128__ 1
// PPC-LINUX:#define __LONG_LONG_MAX__ 9223372036854775807LL
// PPC-LINUX:#define __LONG_MAX__ 2147483647L
+// PPC-LINUX-NOT:#define __LP64__
// PPC-LINUX:#define __NATURAL_ALIGNMENT__ 1
-// PPC-LINUX:#define __NO_INLINE__ 1
// PPC-LINUX:#define __POINTER_WIDTH__ 32
// PPC-LINUX:#define __POWERPC__ 1
// PPC-LINUX:#define __PTRDIFF_TYPE__ int
@@ -1364,6 +1751,8 @@
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc-none-none < /dev/null | FileCheck -check-prefix SPARC %s
//
+// SPARC-NOT:#define _LP64
+// SPARC:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// SPARC:#define __CHAR16_TYPE__ unsigned short
// SPARC:#define __CHAR32_TYPE__ unsigned int
// SPARC:#define __CHAR_BIT__ 8
@@ -1422,7 +1811,7 @@
// SPARC:#define __LDBL_MIN__ 2.2250738585072014e-308
// SPARC:#define __LONG_LONG_MAX__ 9223372036854775807LL
// SPARC:#define __LONG_MAX__ 2147483647L
-// SPARC:#define __NO_INLINE__ 1
+// SPARC-NOT:#define __LP64__
// SPARC:#define __POINTER_WIDTH__ 32
// SPARC:#define __PTRDIFF_TYPE__ long int
// SPARC:#define __PTRDIFF_WIDTH__ 32
@@ -1459,6 +1848,8 @@
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=tce-none-none < /dev/null | FileCheck -check-prefix TCE %s
//
+// TCE-NOT:#define _LP64
+// TCE:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// TCE:#define __CHAR16_TYPE__ unsigned short
// TCE:#define __CHAR32_TYPE__ unsigned int
// TCE:#define __CHAR_BIT__ 8
@@ -1515,7 +1906,7 @@
// TCE:#define __LDBL_MIN__ 1.17549435e-38F
// TCE:#define __LONG_LONG_MAX__ 2147483647LL
// TCE:#define __LONG_MAX__ 2147483647L
-// TCE:#define __NO_INLINE__ 1
+// TCE-NOT:#define __LP64__
// TCE:#define __POINTER_WIDTH__ 32
// TCE:#define __PTRDIFF_TYPE__ int
// TCE:#define __PTRDIFF_WIDTH__ 32
@@ -1552,6 +1943,7 @@
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-none-none < /dev/null | FileCheck -check-prefix X86_64 %s
//
// X86_64:#define _LP64 1
+// X86_64:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// X86_64:#define __CHAR16_TYPE__ unsigned short
// X86_64:#define __CHAR32_TYPE__ unsigned int
// X86_64:#define __CHAR_BIT__ 8
@@ -1613,7 +2005,6 @@
// X86_64:#define __LONG_MAX__ 9223372036854775807L
// X86_64:#define __LP64__ 1
// X86_64:#define __MMX__ 1
-// X86_64:#define __NO_INLINE__ 1
// X86_64:#define __NO_MATH_INLINES 1
// X86_64:#define __POINTER_WIDTH__ 64
// X86_64:#define __PTRDIFF_TYPE__ long int
@@ -1655,6 +2046,7 @@
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-pc-linux-gnu < /dev/null | FileCheck -check-prefix X86_64-LINUX %s
//
// X86_64-LINUX:#define _LP64 1
+// X86_64-LINUX:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// X86_64-LINUX:#define __CHAR16_TYPE__ unsigned short
// X86_64-LINUX:#define __CHAR32_TYPE__ unsigned int
// X86_64-LINUX:#define __CHAR_BIT__ 8
@@ -1716,7 +2108,6 @@
// X86_64-LINUX:#define __LONG_MAX__ 9223372036854775807L
// X86_64-LINUX:#define __LP64__ 1
// X86_64-LINUX:#define __MMX__ 1
-// X86_64-LINUX:#define __NO_INLINE__ 1
// X86_64-LINUX:#define __NO_MATH_INLINES 1
// X86_64-LINUX:#define __POINTER_WIDTH__ 64
// X86_64-LINUX:#define __PTRDIFF_TYPE__ long int
@@ -1755,10 +2146,13 @@
// X86_64-LINUX:#define __x86_64 1
// X86_64-LINUX:#define __x86_64__ 1
//
-// RUN: %clang_cc1 -x c++ -triple i686-pc-linux-gnu -fobjc-fragile-abi -E -dM < /dev/null | FileCheck -check-prefix GNUSOURCE %s
+// RUN: %clang_cc1 -x c++ -triple i686-pc-linux-gnu -fobjc-runtime=gcc -E -dM < /dev/null | FileCheck -check-prefix GNUSOURCE %s
// GNUSOURCE:#define _GNU_SOURCE 1
//
// RUN: %clang_cc1 -x c++ -std=c++98 -fno-rtti -E -dM < /dev/null | FileCheck -check-prefix NORTTI %s
// NORTTI: __GXX_ABI_VERSION
// NORTTI-NOT:#define __GXX_RTTI
// NORTTI: __STDC__
+//
+// RUN: %clang_cc1 -triple arm-linux-androideabi -E -dM < /dev/null | FileCheck -check-prefix ANDROID %s
+// ANDROID: __ANDROID__ 1
diff --git a/test/Preprocessor/line-directive.c b/test/Preprocessor/line-directive.c
index 28e9302..ffa7c5a 100644
--- a/test/Preprocessor/line-directive.c
+++ b/test/Preprocessor/line-directive.c
@@ -3,8 +3,8 @@
// RUN: %clang_cc1 -E %s 2>&1 | grep 'blonk.c:93:2: error: DEF'
#line 'a' // expected-error {{#line directive requires a positive integer argument}}
-#line 0 // expected-error {{#line directive requires a positive integer argument}}
-#line 00 // expected-error {{#line directive requires a positive integer argument}}
+#line 0 // expected-warning {{#line directive with zero argument is a GNU extension}}
+#line 00 // expected-warning {{#line directive with zero argument is a GNU extension}}
#line 2147483648 // expected-warning {{C requires #line number to be less than 2147483648, allowed as extension}}
#line 42 // ok
#line 42 'a' // expected-error {{invalid filename for #line directive}}
@@ -33,8 +33,11 @@
// These are checked by the RUN line.
#line 92 "blonk.c"
-#error ABC // expected-error {{#error ABC}}
-#error DEF // expected-error {{#error DEF}}
+#error ABC
+#error DEF
+// expected-error@-2 {{ABC}}
+#line 150
+// expected-error@-3 {{DEF}}
// Verify that linemarker diddling of the system header flag works.
@@ -88,5 +91,8 @@ extern char array2[\
_\
_LINE__ == 42 ? 1: -1]; /* line marker is location of first _ */
+// rdar://11550996
+#line 0 "line-directive.c" // expected-warning {{#line directive with zero argument is a GNU extension}}
+undefined t; // expected-error {{unknown type name 'undefined'}}
diff --git a/test/Preprocessor/macro_fn.c b/test/Preprocessor/macro_fn.c
index 85733b4..f93d52c 100644
--- a/test/Preprocessor/macro_fn.c
+++ b/test/Preprocessor/macro_fn.c
@@ -4,8 +4,8 @@
#define zero() 0
#define one(x) 0
#define two(x, y) 0
-#define zero_dot(...) 0 /* expected-warning {{variadic macros were introduced in C99}} */
-#define one_dot(x, ...) 0 /* expected-warning {{variadic macros were introduced in C99}} */
+#define zero_dot(...) 0 /* expected-warning {{variadic macros are a C99 feature}} */
+#define one_dot(x, ...) 0 /* expected-warning {{variadic macros are a C99 feature}} expected-note 2{{macro 'one_dot' defined here}} */
zero()
zero(1); /* expected-error {{too many arguments provided to function-like macro invocation}} */
@@ -19,25 +19,25 @@ one(a, b) /* expected-error {{too many arguments provided to function-li
two() /* expected-error {{too few arguments provided to function-like macro invocation}} */
two(a) /* expected-error {{too few arguments provided to function-like macro invocation}} */
two(a,b)
-two(a, ) /* expected-warning {{empty macro arguments were standardized in C99}} */
+two(a, ) /* expected-warning {{empty macro arguments are a C99 feature}} */
two(a,b,c) /* expected-error {{too many arguments provided to function-like macro invocation}} */
two(
- , /* expected-warning {{empty macro arguments were standardized in C99}} */
- , /* expected-warning {{empty macro arguments were standardized in C99}} \
+ , /* expected-warning {{empty macro arguments are a C99 feature}} */
+ , /* expected-warning {{empty macro arguments are a C99 feature}} \
expected-error {{too many arguments provided to function-like macro invocation}} */
)
-two(,) /* expected-warning 2 {{empty macro arguments were standardized in C99}} */
+two(,) /* expected-warning 2 {{empty macro arguments are a C99 feature}} */
/* PR4006 & rdar://6807000 */
-#define e(...) __VA_ARGS__ /* expected-warning {{variadic macros were introduced in C99}} */
+#define e(...) __VA_ARGS__ /* expected-warning {{variadic macros are a C99 feature}} */
e(x)
e()
zero_dot()
-one_dot(x) /* empty ... argument: expected-warning {{varargs argument missing, but tolerated as an extension}} */
-one_dot() /* empty first argument, elided ...: expected-warning {{varargs argument missing, but tolerated as an extension}} */
+one_dot(x) /* empty ... argument: expected-warning {{must specify at least one argument for '...' parameter of variadic macro}} */
+one_dot() /* empty first argument, elided ...: expected-warning {{must specify at least one argument for '...' parameter of variadic macro}} */
/* rdar://6816766 - Crash with function-like macro test at end of directive. */
diff --git a/test/Preprocessor/macro_paste_c_block_comment.c b/test/Preprocessor/macro_paste_c_block_comment.c
index c690a4c..c558be5 100644
--- a/test/Preprocessor/macro_paste_c_block_comment.c
+++ b/test/Preprocessor/macro_paste_c_block_comment.c
@@ -1,5 +1,9 @@
// RUN: %clang_cc1 %s -Eonly -verify
+// expected-error@9 {{EOF}}
#define COMM / ## *
COMM // expected-error {{pasting formed '/*', an invalid preprocessing token}}
+// Demonstrate that an invalid preprocessing token
+// doesn't swallow the rest of the file...
+#error EOF
diff --git a/test/Preprocessor/macro_paste_identifier_error.c b/test/Preprocessor/macro_paste_identifier_error.c
new file mode 100644
index 0000000..457e6f7
--- /dev/null
+++ b/test/Preprocessor/macro_paste_identifier_error.c
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -fms-extensions -Wno-invalid-token-paste %s -verify
+// RUN: %clang_cc1 -E -fms-extensions -Wno-invalid-token-paste %s | FileCheck %s
+// RUN: %clang_cc1 -E -fms-extensions -Wno-invalid-token-paste -x assembler-with-cpp %s | FileCheck %s
+
+#define foo a ## b ## = 0
+int foo;
+// CHECK: int ab = 0;
diff --git a/test/Preprocessor/mmx.c b/test/Preprocessor/mmx.c
index 2613cb6..59e715e 100644
--- a/test/Preprocessor/mmx.c
+++ b/test/Preprocessor/mmx.c
@@ -1,8 +1,11 @@
// RUN: %clang -march=i386 -m32 -E -dM %s -msse -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=SSE_AND_MMX
// RUN: %clang -march=i386 -m32 -E -dM %s -msse -mno-mmx -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=SSE_NO_MMX
// RUN: %clang -march=i386 -m32 -E -dM %s -mno-mmx -msse -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=SSE_NO_MMX
// SSE_AND_MMX: #define __MMX__
diff --git a/test/Preprocessor/non_fragile_feature1.m b/test/Preprocessor/non_fragile_feature1.m
index 79cc488..6ea7fa8 100644
--- a/test/Preprocessor/non_fragile_feature1.m
+++ b/test/Preprocessor/non_fragile_feature1.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-fragile-abi %s
+// RUN: %clang_cc1 -triple i386-unknown-unknown -fobjc-runtime=gcc %s
#ifndef __has_feature
#error Should have __has_feature
#endif
diff --git a/test/Preprocessor/pp-record.c b/test/Preprocessor/pp-record.c
index f098683..dd958d0 100644
--- a/test/Preprocessor/pp-record.c
+++ b/test/Preprocessor/pp-record.c
@@ -10,3 +10,14 @@
#include STRINGIZE(INC)
CAKE;
+
+#define DIR 1
+#define FNM(x) x
+
+FNM(
+#if DIR
+ int a;
+#else
+ int b;
+#endif
+)
diff --git a/test/Preprocessor/predefined-arch-macros.c b/test/Preprocessor/predefined-arch-macros.c
index b063f7f..2361abe 100644
--- a/test/Preprocessor/predefined-arch-macros.c
+++ b/test/Preprocessor/predefined-arch-macros.c
@@ -4,16 +4,19 @@
// Begin X86/GCC/Linux tests ----------------
//
// RUN: %clang -march=i386 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I386_M32
// CHECK_I386_M32: #define __i386 1
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I386_M64
// CHECK_I386_M64: error:
//
// RUN: %clang -march=i486 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I486_M32
// CHECK_I486_M32: #define __i386 1
// CHECK_I486_M32: #define __i386__ 1
@@ -22,10 +25,12 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I486_M64
// CHECK_I486_M64: error:
//
// RUN: %clang -march=i586 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I586_M32
// CHECK_I586_M32: #define __i386 1
// CHECK_I586_M32: #define __i386__ 1
@@ -37,10 +42,12 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I586_M64
// CHECK_I586_M64: error:
//
// RUN: %clang -march=pentium -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M32
// CHECK_PENTIUM_M32: #define __i386 1
// CHECK_PENTIUM_M32: #define __i386__ 1
@@ -52,10 +59,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_MMX_M32
// CHECK_PENTIUM_MMX_M32: #define __MMX__ 1
// CHECK_PENTIUM_MMX_M32: #define __i386 1
@@ -70,10 +79,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP_C6_M32
// CHECK_WINCHIP_C6_M32: #define __MMX__ 1
// CHECK_WINCHIP_C6_M32: #define __i386 1
@@ -83,10 +94,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP2_M32
// CHECK_WINCHIP2_M32: #define __3dNOW__ 1
// CHECK_WINCHIP2_M32: #define __MMX__ 1
@@ -97,10 +110,12 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_WINCHIP2_M64
// CHECK_WINCHIP2_M64: error:
//
// RUN: %clang -march=c3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_C3_M32
// CHECK_C3_M32: #define __3dNOW__ 1
// CHECK_C3_M32: #define __MMX__ 1
@@ -111,10 +126,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_C3_2_M32
// CHECK_C3_2_M32: #define __MMX__ 1
// CHECK_C3_2_M32: #define __SSE__ 1
@@ -129,10 +146,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I686_M32
// CHECK_I686_M32: #define __i386 1
// CHECK_I686_M32: #define __i386__ 1
@@ -142,10 +161,12 @@
// CHECK_I686_M32: #define __pentiumpro__ 1
// CHECK_I686_M32: #define i386 1
// RUN: %clang -march=i686 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_I686_M64
// CHECK_I686_M64: error:
//
// RUN: %clang -march=pentiumpro -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUMPRO_M32
// CHECK_PENTIUMPRO_M32: #define __i386 1
// CHECK_PENTIUMPRO_M32: #define __i386__ 1
@@ -157,10 +178,12 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUMPRO_M64
// CHECK_PENTIUMPRO_M64: error:
//
// RUN: %clang -march=pentium2 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM2_M32
// CHECK_PENTIUM2_M32: #define __MMX__ 1
// CHECK_PENTIUM2_M32: #define __i386 1
@@ -174,10 +197,12 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM2_M64
// CHECK_PENTIUM2_M64: error:
//
// RUN: %clang -march=pentium3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3_M32
// CHECK_PENTIUM3_M32: #define __MMX__ 1
// CHECK_PENTIUM3_M32: #define __SSE__ 1
@@ -193,10 +218,12 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3_M64
// CHECK_PENTIUM3_M64: error:
//
// RUN: %clang -march=pentium3m -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM3M_M32
// CHECK_PENTIUM3M_M32: #define __MMX__ 1
// CHECK_PENTIUM3M_M32: #define __SSE__ 1
@@ -210,10 +237,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM_M_M32
// CHECK_PENTIUM_M_M32: #define __MMX__ 1
// CHECK_PENTIUM_M_M32: #define __SSE2__ 1
@@ -228,10 +257,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4_M32
// CHECK_PENTIUM4_M32: #define __MMX__ 1
// CHECK_PENTIUM4_M32: #define __SSE2__ 1
@@ -243,10 +274,12 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4_M64
// CHECK_PENTIUM4_M64: error:
//
// RUN: %clang -march=pentium4m -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4M_M32
// CHECK_PENTIUM4M_M32: #define __MMX__ 1
// CHECK_PENTIUM4M_M32: #define __SSE2__ 1
@@ -258,10 +291,12 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PENTIUM4M_M64
// CHECK_PENTIUM4M_M64: error:
//
// RUN: %clang -march=prescott -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PRESCOTT_M32
// CHECK_PRESCOTT_M32: #define __MMX__ 1
// CHECK_PRESCOTT_M32: #define __SSE2__ 1
@@ -274,10 +309,12 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_PRESCOTT_M64
// CHECK_PRESCOTT_M64: error:
//
// RUN: %clang -march=nocona -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_NOCONA_M32
// CHECK_NOCONA_M32: #define __MMX__ 1
// CHECK_NOCONA_M32: #define __SSE2__ 1
@@ -290,6 +327,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_NOCONA_M64
// CHECK_NOCONA_M64: #define __MMX__ 1
// CHECK_NOCONA_M64: #define __SSE2_MATH__ 1
@@ -306,6 +344,7 @@
// CHECK_NOCONA_M64: #define __x86_64__ 1
//
// RUN: %clang -march=core2 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE2_M32
// CHECK_CORE2_M32: #define __MMX__ 1
// CHECK_CORE2_M32: #define __SSE2__ 1
@@ -319,6 +358,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE2_M64
// CHECK_CORE2_M64: #define __MMX__ 1
// CHECK_CORE2_M64: #define __SSE2_MATH__ 1
@@ -336,8 +376,10 @@
// CHECK_CORE2_M64: #define __x86_64__ 1
//
// RUN: %clang -march=corei7 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_M32
// CHECK_COREI7_M32: #define __MMX__ 1
+// CHECK_COREI7_M32: #define __POPCNT__ 1
// CHECK_COREI7_M32: #define __SSE2__ 1
// CHECK_COREI7_M32: #define __SSE3__ 1
// CHECK_COREI7_M32: #define __SSE4_1__ 1
@@ -351,8 +393,10 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_M64
// CHECK_COREI7_M64: #define __MMX__ 1
+// CHECK_COREI7_M64: #define __POPCNT__ 1
// CHECK_COREI7_M64: #define __SSE2_MATH__ 1
// CHECK_COREI7_M64: #define __SSE2__ 1
// CHECK_COREI7_M64: #define __SSE3__ 1
@@ -370,11 +414,14 @@
// CHECK_COREI7_M64: #define __x86_64__ 1
//
// RUN: %clang -march=corei7-avx -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_AVX_M32
// CHECK_COREI7_AVX_M32: #define __AES__ 1
-// FIXME: AVX is not yet enabled with Clang.
-// CHECK_COREI7_AVX_M32-NOT: #define __AVX__ 1
+// CHECK_COREI7_AVX_M32: #define __AVX__ 1
// CHECK_COREI7_AVX_M32: #define __MMX__ 1
+// CHECK_COREI7_AVX_M32: #define __PCLMUL__ 1
+// CHECK_COREI7_AVX_M32-NOT: __RDRND__
+// CHECK_COREI7_AVX_M32: #define __POPCNT__ 1
// CHECK_COREI7_AVX_M32: #define __SSE2__ 1
// CHECK_COREI7_AVX_M32: #define __SSE3__ 1
// CHECK_COREI7_AVX_M32: #define __SSE4_1__ 1
@@ -388,11 +435,14 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_COREI7_AVX_M64
// CHECK_COREI7_AVX_M64: #define __AES__ 1
-// FIXME: AVX is not yet enabled with Clang.
-// CHECK_COREI7_AVX_M64-NOT: #define __AVX__ 1
+// CHECK_COREI7_AVX_M64: #define __AVX__ 1
// CHECK_COREI7_AVX_M64: #define __MMX__ 1
+// CHECK_COREI7_AVX_M64: #define __PCLMUL__ 1
+// CHECK_COREI7_AVX_M64-NOT: __RDRND__
+// CHECK_COREI7_AVX_M64: #define __POPCNT__ 1
// CHECK_COREI7_AVX_M64: #define __SSE2_MATH__ 1
// CHECK_COREI7_AVX_M64: #define __SSE2__ 1
// CHECK_COREI7_AVX_M64: #define __SSE3__ 1
@@ -410,11 +460,13 @@
// CHECK_COREI7_AVX_M64: #define __x86_64__ 1
//
// RUN: %clang -march=core-avx-i -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE_AVX_I_M32
// CHECK_CORE_AVX_I_M32: #define __AES__ 1
-// FIXME: AVX is not yet enabled with Clang.
-// CHECK_CORE_AVX_I_M32-NOT: #define __AVX__ 1
+// CHECK_CORE_AVX_I_M32: #define __AVX__ 1
// CHECK_CORE_AVX_I_M32: #define __MMX__ 1
+// CHECK_CORE_AVX_I_M32: #define __PCLMUL__ 1
+// CHECK_CORE_AVX_I_M32: #define __RDRND__ 1
// CHECK_CORE_AVX_I_M32: #define __SSE2__ 1
// CHECK_CORE_AVX_I_M32: #define __SSE3__ 1
// CHECK_CORE_AVX_I_M32: #define __SSE4_1__ 1
@@ -428,11 +480,13 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_CORE_AVX_I_M64
// CHECK_CORE_AVX_I_M64: #define __AES__ 1
-// FIXME: AVX is not yet enabled with Clang.
-// CHECK_CORE_AVX_I_M64-NOT: #define __AVX__ 1
+// CHECK_CORE_AVX_I_M64: #define __AVX__ 1
// CHECK_CORE_AVX_I_M64: #define __MMX__ 1
+// CHECK_CORE_AVX_I_M64: #define __PCLMUL__ 1
+// CHECK_CORE_AVX_I_M64: #define __RDRND__ 1
// CHECK_CORE_AVX_I_M64: #define __SSE2_MATH__ 1
// CHECK_CORE_AVX_I_M64: #define __SSE2__ 1
// CHECK_CORE_AVX_I_M64: #define __SSE3__ 1
@@ -449,7 +503,62 @@
// CHECK_CORE_AVX_I_M64: #define __x86_64 1
// CHECK_CORE_AVX_I_M64: #define __x86_64__ 1
//
+// RUN: %clang -march=core-avx2 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_CORE_AVX2_M32
+// CHECK_CORE_AVX2_M32: #define __AES__ 1
+// CHECK_CORE_AVX2_M32: #define __AVX__ 1
+// CHECK_CORE_AVX2_M32: #define __BMI2__ 1
+// CHECK_CORE_AVX2_M32: #define __BMI__ 1
+// CHECK_CORE_AVX2_M32: #define __FMA__ 1
+// CHECK_CORE_AVX2_M32: #define __LZCNT__ 1
+// CHECK_CORE_AVX2_M32: #define __MMX__ 1
+// CHECK_CORE_AVX2_M32: #define __PCLMUL__ 1
+// CHECK_CORE_AVX2_M32: #define __POPCNT__ 1
+// CHECK_CORE_AVX2_M32: #define __RDRND__ 1
+// CHECK_CORE_AVX2_M32: #define __SSE2__ 1
+// CHECK_CORE_AVX2_M32: #define __SSE3__ 1
+// CHECK_CORE_AVX2_M32: #define __SSE4_1__ 1
+// CHECK_CORE_AVX2_M32: #define __SSE4_2__ 1
+// CHECK_CORE_AVX2_M32: #define __SSE__ 1
+// CHECK_CORE_AVX2_M32: #define __SSSE3__ 1
+// CHECK_CORE_AVX2_M32: #define __corei7 1
+// CHECK_CORE_AVX2_M32: #define __corei7__ 1
+// CHECK_CORE_AVX2_M32: #define __i386 1
+// CHECK_CORE_AVX2_M32: #define __i386__ 1
+// CHECK_CORE_AVX2_M32: #define __tune_corei7__ 1
+// CHECK_CORE_AVX2_M32: #define i386 1
+// RUN: %clang -march=core-avx2 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_CORE_AVX2_M64
+// CHECK_CORE_AVX2_M64: #define __AES__ 1
+// CHECK_CORE_AVX2_M64: #define __AVX__ 1
+// CHECK_CORE_AVX2_M64: #define __BMI2__ 1
+// CHECK_CORE_AVX2_M64: #define __BMI__ 1
+// CHECK_CORE_AVX2_M64: #define __FMA__ 1
+// CHECK_CORE_AVX2_M64: #define __LZCNT__ 1
+// CHECK_CORE_AVX2_M64: #define __MMX__ 1
+// CHECK_CORE_AVX2_M64: #define __PCLMUL__ 1
+// CHECK_CORE_AVX2_M64: #define __POPCNT__ 1
+// CHECK_CORE_AVX2_M64: #define __RDRND__ 1
+// CHECK_CORE_AVX2_M64: #define __SSE2_MATH__ 1
+// CHECK_CORE_AVX2_M64: #define __SSE2__ 1
+// CHECK_CORE_AVX2_M64: #define __SSE3__ 1
+// CHECK_CORE_AVX2_M64: #define __SSE4_1__ 1
+// CHECK_CORE_AVX2_M64: #define __SSE4_2__ 1
+// CHECK_CORE_AVX2_M64: #define __SSE_MATH__ 1
+// CHECK_CORE_AVX2_M64: #define __SSE__ 1
+// CHECK_CORE_AVX2_M64: #define __SSSE3__ 1
+// CHECK_CORE_AVX2_M64: #define __amd64 1
+// CHECK_CORE_AVX2_M64: #define __amd64__ 1
+// CHECK_CORE_AVX2_M64: #define __corei7 1
+// CHECK_CORE_AVX2_M64: #define __corei7__ 1
+// CHECK_CORE_AVX2_M64: #define __tune_corei7__ 1
+// CHECK_CORE_AVX2_M64: #define __x86_64 1
+// CHECK_CORE_AVX2_M64: #define __x86_64__ 1
+//
// RUN: %clang -march=atom -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATOM_M32
// CHECK_ATOM_M32: #define __MMX__ 1
// CHECK_ATOM_M32: #define __SSE2__ 1
@@ -463,6 +572,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATOM_M64
// CHECK_ATOM_M64: #define __MMX__ 1
// CHECK_ATOM_M64: #define __SSE2_MATH__ 1
@@ -480,6 +590,7 @@
// CHECK_ATOM_M64: #define __x86_64__ 1
//
// RUN: %clang -march=geode -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_GEODE_M32
// CHECK_GEODE_M32: #define __3dNOW_A__ 1
// CHECK_GEODE_M32: #define __3dNOW__ 1
@@ -491,10 +602,12 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_GEODE_M64
// CHECK_GEODE_M64: error:
//
// RUN: %clang -march=k6 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_M32
// CHECK_K6_M32: #define __MMX__ 1
// CHECK_K6_M32: #define __i386 1
@@ -504,10 +617,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_2_M32
// CHECK_K6_2_M32: #define __3dNOW__ 1
// CHECK_K6_2_M32: #define __MMX__ 1
@@ -520,10 +635,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K6_3_M32
// CHECK_K6_3_M32: #define __3dNOW__ 1
// CHECK_K6_3_M32: #define __MMX__ 1
@@ -536,10 +653,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_M32
// CHECK_ATHLON_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_M32: #define __3dNOW__ 1
@@ -551,10 +670,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_TBIRD_M32
// CHECK_ATHLON_TBIRD_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_TBIRD_M32: #define __3dNOW__ 1
@@ -566,10 +687,12 @@
// 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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_4_M32
// CHECK_ATHLON_4_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_4_M32: #define __3dNOW__ 1
@@ -584,10 +707,12 @@
// CHECK_ATHLON_4_M32: #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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_XP_M32
// CHECK_ATHLON_XP_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_XP_M32: #define __3dNOW__ 1
@@ -602,10 +727,12 @@
// CHECK_ATHLON_XP_M32: #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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_MP_M32
// CHECK_ATHLON_MP_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_MP_M32: #define __3dNOW__ 1
@@ -620,10 +747,12 @@
// CHECK_ATHLON_MP_M32: #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: -target i386-unknown-linux \
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_X86_64_M32
// CHECK_X86_64_M32: #define __MMX__ 1
// CHECK_X86_64_M32: #define __SSE2__ 1
@@ -634,6 +763,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_X86_64_M64
// CHECK_X86_64_M64: #define __MMX__ 1
// CHECK_X86_64_M64: #define __SSE2_MATH__ 1
@@ -648,6 +778,7 @@
// CHECK_X86_64_M64: #define __x86_64__ 1
//
// RUN: %clang -march=k8 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K8_M32
// CHECK_K8_M32: #define __3dNOW_A__ 1
// CHECK_K8_M32: #define __3dNOW__ 1
@@ -661,6 +792,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K8_M64
// CHECK_K8_M64: #define __3dNOW_A__ 1
// CHECK_K8_M64: #define __3dNOW__ 1
@@ -678,6 +810,7 @@
// CHECK_K8_M64: #define __x86_64__ 1
//
// RUN: %clang -march=k8-sse3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K8_SSE3_M32
// CHECK_K8_SSE3_M32: #define __3dNOW_A__ 1
// CHECK_K8_SSE3_M32: #define __3dNOW__ 1
@@ -692,6 +825,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_K8_SSE3_M64
// CHECK_K8_SSE3_M64: #define __3dNOW_A__ 1
// CHECK_K8_SSE3_M64: #define __3dNOW__ 1
@@ -710,6 +844,7 @@
// CHECK_K8_SSE3_M64: #define __x86_64__ 1
//
// RUN: %clang -march=opteron -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_M32
// CHECK_OPTERON_M32: #define __3dNOW_A__ 1
// CHECK_OPTERON_M32: #define __3dNOW__ 1
@@ -723,6 +858,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_M64
// CHECK_OPTERON_M64: #define __3dNOW_A__ 1
// CHECK_OPTERON_M64: #define __3dNOW__ 1
@@ -740,6 +876,7 @@
// CHECK_OPTERON_M64: #define __x86_64__ 1
//
// RUN: %clang -march=opteron-sse3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_SSE3_M32
// CHECK_OPTERON_SSE3_M32: #define __3dNOW_A__ 1
// CHECK_OPTERON_SSE3_M32: #define __3dNOW__ 1
@@ -754,6 +891,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_OPTERON_SSE3_M64
// CHECK_OPTERON_SSE3_M64: #define __3dNOW_A__ 1
// CHECK_OPTERON_SSE3_M64: #define __3dNOW__ 1
@@ -772,6 +910,7 @@
// CHECK_OPTERON_SSE3_M64: #define __x86_64__ 1
//
// RUN: %clang -march=athlon64 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_M32
// CHECK_ATHLON64_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON64_M32: #define __3dNOW__ 1
@@ -785,6 +924,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_M64
// CHECK_ATHLON64_M64: #define __3dNOW_A__ 1
// CHECK_ATHLON64_M64: #define __3dNOW__ 1
@@ -802,6 +942,7 @@
// CHECK_ATHLON64_M64: #define __x86_64__ 1
//
// RUN: %clang -march=athlon64-sse3 -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_SSE3_M32
// CHECK_ATHLON64_SSE3_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON64_SSE3_M32: #define __3dNOW__ 1
@@ -816,6 +957,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON64_SSE3_M64
// CHECK_ATHLON64_SSE3_M64: #define __3dNOW_A__ 1
// CHECK_ATHLON64_SSE3_M64: #define __3dNOW__ 1
@@ -834,6 +976,7 @@
// CHECK_ATHLON64_SSE3_M64: #define __x86_64__ 1
//
// RUN: %clang -march=athlon-fx -m32 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_FX_M32
// CHECK_ATHLON_FX_M32: #define __3dNOW_A__ 1
// CHECK_ATHLON_FX_M32: #define __3dNOW__ 1
@@ -847,6 +990,7 @@
// 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: -target i386-unknown-linux \
// RUN: | FileCheck %s -check-prefix=CHECK_ATHLON_FX_M64
// CHECK_ATHLON_FX_M64: #define __3dNOW_A__ 1
// CHECK_ATHLON_FX_M64: #define __3dNOW__ 1
@@ -862,5 +1006,50 @@
// CHECK_ATHLON_FX_M64: #define __tune_k8__ 1
// CHECK_ATHLON_FX_M64: #define __x86_64 1
// CHECK_ATHLON_FX_M64: #define __x86_64__ 1
+// RUN: %clang -march=amdfam10 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_AMDFAM10_M64
+// CHECK_AMDFAM10_M64: #define __3dNOW_A__ 1
+// CHECK_AMDFAM10_M64: #define __3dNOW__ 1
+// CHECK_AMDFAM10_M64: #define __MMX__ 1
+// CHECK_AMDFAM10_M64: #define __SSE2_MATH__ 1
+// CHECK_AMDFAM10_M64: #define __SSE2__ 1
+// CHECK_AMDFAM10_M64: #define __SSE3__ 1
+// CHECK_AMDFAM10_M64: #define __SSE4A__ 1
+// CHECK_AMDFAM10_M64: #define __SSE_MATH__ 1
+// CHECK_AMDFAM10_M64: #define __SSE__ 1
+// CHECK_AMDFAM10_M64: #define __amd64 1
+// CHECK_AMDFAM10_M64: #define __amd64__ 1
+// CHECK_AMDFAM10_M64: #define __amdfam10 1
+// CHECK_AMDFAM10_M64: #define __amdfam10__ 1
+// CHECK_AMDFAM10_M64: #define __tune_amdfam10__ 1
+// CHECK_AMDFAM10_M64: #define __x86_64 1
+// CHECK_AMDFAM10_M64: #define __x86_64__ 1
+// RUN: %clang -march=bdver1 -m64 -E -dM %s -o - 2>&1 \
+// RUN: -target i386-unknown-linux \
+// RUN: | FileCheck %s -check-prefix=CHECK_BDVER1_M64
+// CHECK_BDVER1_M64: #define __AVX__ 1
+// CHECK_BDVER1_M64-NOT: #define __3dNOW_A__ 1
+// CHECK_BDVER1_M64-NOT: #define __3dNOW__ 1
+// CHECK_BDVER1_M64: #define __FMA4__ 1
+// CHECK_BDVER1_M64: #define __MMX__ 1
+// CHECK_BDVER1_M64: #define __PCLMUL__ 1
+// CHECK_BDVER1_M64: #define __SSE2_MATH__ 1
+// CHECK_BDVER1_M64: #define __SSE2__ 1
+// CHECK_BDVER1_M64: #define __SSE3__ 1
+// CHECK_BDVER1_M64: #define __SSE4A__ 1
+// CHECK_BDVER1_M64: #define __SSE4_1__ 1
+// CHECK_BDVER1_M64: #define __SSE4_2__ 1
+// CHECK_BDVER1_M64: #define __SSE_MATH__ 1
+// CHECK_BDVER1_M64: #define __SSE__ 1
+// CHECK_BDVER1_M64: #define __SSSE3__ 1
+// CHECK_BDVER1_M64: #define __XOP__ 1
+// CHECK_BDVER1_M64: #define __amd64 1
+// CHECK_BDVER1_M64: #define __amd64__ 1
+// CHECK_BDVER1_M64: #define __bdver1 1
+// CHECK_BDVER1_M64: #define __bdver1__ 1
+// CHECK_BDVER1_M64: #define __tune_bdver1__ 1
+// CHECK_BDVER1_M64: #define __x86_64 1
+// CHECK_BDVER1_M64: #define __x86_64__ 1
//
// End X86/GCC/Linux tests ------------------
diff --git a/test/Preprocessor/predefined-macros.c b/test/Preprocessor/predefined-macros.c
index 5c11c3b..2c19301 100644
--- a/test/Preprocessor/predefined-macros.c
+++ b/test/Preprocessor/predefined-macros.c
@@ -13,3 +13,16 @@
// RUN: %clang_cc1 %s -E -dM -ffast-math -o - \
// RUN: | FileCheck %s --check-prefix=CHECK-FAST-MATH
// CHECK-FAST-MATH: #define __FAST_MATH__
+// CHECK-FAST-MATH: #define __FINITE_MATH_ONLY__ 1
+//
+// RUN: %clang_cc1 %s -E -dM -ffinite-math-only -o - \
+// RUN: | FileCheck %s --check-prefix=CHECK-FINITE-MATH-ONLY
+// CHECK-FINITE-MATH-ONLY: #define __FINITE_MATH_ONLY__ 1
+//
+// RUN: %clang %s -E -dM -fno-finite-math-only -o - \
+// RUN: | FileCheck %s --check-prefix=CHECK-NO-FINITE-MATH-ONLY
+// CHECK-NO-FINITE-MATH-ONLY: #define __FINITE_MATH_ONLY__ 0
+//
+// RUN: %clang_cc1 %s -E -dM -o - \
+// RUN: | FileCheck %s --check-prefix=CHECK-FINITE-MATH-FLAG-UNDEFINED
+// CHECK-FINITE-MATH-FLAG-UNDEFINED: #define __FINITE_MATH_ONLY__ 0
diff --git a/test/Preprocessor/undef-error.c b/test/Preprocessor/undef-error.c
index ad611de..959c163 100644
--- a/test/Preprocessor/undef-error.c
+++ b/test/Preprocessor/undef-error.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -pedantic-errors -verify
+// RUN: %clang_cc1 %s -pedantic-errors -Wno-empty-translation-unit -verify
// PR2045
#define b
diff --git a/test/Preprocessor/warning_tests.c b/test/Preprocessor/warning_tests.c
index 96b96ef..3f2865c 100644
--- a/test/Preprocessor/warning_tests.c
+++ b/test/Preprocessor/warning_tests.c
@@ -6,14 +6,16 @@
#if __has_warning("not valid") // expected-warning {{__has_warning expected option name}}
#endif
+// expected-warning@+2 {{Should have -Wparentheses}}
#if __has_warning("-Wparentheses")
-#warning Should have -Wparentheses // expected-warning {{Should have -Wparentheses}}
+#warning Should have -Wparentheses
#endif
#if __has_warning(-Wfoo) // expected-error {{builtin warning check macro requires a parenthesized string}}
#endif
+// expected-warning@+3 {{Not a valid warning flag}}
#if __has_warning("-Wnot-a-valid-warning-flag-at-all")
#else
-#warning Not a valid warning flag // expected-warning {{Not a valid warning flag}}
-#endif \ No newline at end of file
+#warning Not a valid warning flag
+#endif
OpenPOWER on IntegriCloud