Updated to Clang 3.5a.
Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
diff --git a/test/Preprocessor/Inputs/headermap-rel/Foo.framework/Headers/Foo.h b/test/Preprocessor/Inputs/headermap-rel/Foo.framework/Headers/Foo.h
new file mode 100644
index 0000000..04ffb5a
--- /dev/null
+++ b/test/Preprocessor/Inputs/headermap-rel/Foo.framework/Headers/Foo.h
@@ -0,0 +1,2 @@
+
+Foo.h is parsed
diff --git a/test/Preprocessor/Inputs/headermap-rel/foo.hmap b/test/Preprocessor/Inputs/headermap-rel/foo.hmap
new file mode 100644
index 0000000..783c64e
--- /dev/null
+++ b/test/Preprocessor/Inputs/headermap-rel/foo.hmap
Binary files differ
diff --git a/test/Preprocessor/Inputs/headermap-rel2/Product/someheader.h b/test/Preprocessor/Inputs/headermap-rel2/Product/someheader.h
new file mode 100644
index 0000000..ca2e521
--- /dev/null
+++ b/test/Preprocessor/Inputs/headermap-rel2/Product/someheader.h
@@ -0,0 +1 @@
+#define A 2
diff --git a/test/Preprocessor/Inputs/headermap-rel2/project-headers.hmap b/test/Preprocessor/Inputs/headermap-rel2/project-headers.hmap
new file mode 100644
index 0000000..a0770fb
--- /dev/null
+++ b/test/Preprocessor/Inputs/headermap-rel2/project-headers.hmap
Binary files differ
diff --git a/test/Preprocessor/Inputs/headermap-rel2/system/usr/include/someheader.h b/test/Preprocessor/Inputs/headermap-rel2/system/usr/include/someheader.h
new file mode 100644
index 0000000..ab2a05d
--- /dev/null
+++ b/test/Preprocessor/Inputs/headermap-rel2/system/usr/include/someheader.h
@@ -0,0 +1 @@
+#define A 1
diff --git a/test/Preprocessor/Inputs/microsoft-header-search/a/b/include3.h b/test/Preprocessor/Inputs/microsoft-header-search/a/b/include3.h
new file mode 100644
index 0000000..3f477e7
--- /dev/null
+++ b/test/Preprocessor/Inputs/microsoft-header-search/a/b/include3.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include "findme.h"
+
+#include "falsepos.h"
diff --git a/test/Preprocessor/Inputs/microsoft-header-search/a/findme.h b/test/Preprocessor/Inputs/microsoft-header-search/a/findme.h
new file mode 100644
index 0000000..b809c90
--- /dev/null
+++ b/test/Preprocessor/Inputs/microsoft-header-search/a/findme.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#warning findme.h successfully included using MS search rules
\ No newline at end of file
diff --git a/test/Preprocessor/Inputs/microsoft-header-search/a/include2.h b/test/Preprocessor/Inputs/microsoft-header-search/a/include2.h
new file mode 100644
index 0000000..99640ae
--- /dev/null
+++ b/test/Preprocessor/Inputs/microsoft-header-search/a/include2.h
@@ -0,0 +1,6 @@
+#pragma once
+
+#include "b/include3.h"
+#pragma once
+
+#include "b/include3.h"
\ No newline at end of file
diff --git a/test/Preprocessor/Inputs/microsoft-header-search/falsepos.h b/test/Preprocessor/Inputs/microsoft-header-search/falsepos.h
new file mode 100644
index 0000000..cb85969
--- /dev/null
+++ b/test/Preprocessor/Inputs/microsoft-header-search/falsepos.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#warning successfully resolved the falsepos.h header
diff --git a/test/Preprocessor/Inputs/microsoft-header-search/findme.h b/test/Preprocessor/Inputs/microsoft-header-search/findme.h
new file mode 100644
index 0000000..aeaf795
--- /dev/null
+++ b/test/Preprocessor/Inputs/microsoft-header-search/findme.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#error Wrong findme.h included, MSVC header search incorrect
\ No newline at end of file
diff --git a/test/Preprocessor/Inputs/microsoft-header-search/include1.h b/test/Preprocessor/Inputs/microsoft-header-search/include1.h
new file mode 100644
index 0000000..f00fac7
--- /dev/null
+++ b/test/Preprocessor/Inputs/microsoft-header-search/include1.h
@@ -0,0 +1,6 @@
+#pragma once
+
+#include "a/include2.h"
+#pragma once
+
+#include "a/include2.h"
\ No newline at end of file
diff --git a/test/Preprocessor/aarch64-target-features.c b/test/Preprocessor/aarch64-target-features.c
index 9978f91..e487667 100644
--- a/test/Preprocessor/aarch64-target-features.c
+++ b/test/Preprocessor/aarch64-target-features.c
@@ -17,8 +17,8 @@
// CHECK: __ARM_FP16_FORMAT_IEEE 1
// CHECK-NOT: __ARM_FP_FAST 1
// CHECK: __ARM_FP_FENV_ROUNDING 1
-// CHECK-NOT: __ARM_NEON 1
-// CHECK-NOT: __ARM_NEON_FP 7
+// CHECK: __ARM_NEON 1
+// CHECK: __ARM_NEON_FP 7
// CHECK: __ARM_PCS_AAPCS64 1
// CHECK-NOT: __ARM_SIZEOF_MINIMAL_ENUM 1
// CHECK-NOT: __ARM_SIZEOF_WCHAR_T 2
diff --git a/test/Preprocessor/arm-target-features.c b/test/Preprocessor/arm-target-features.c
index ae93a3d..9db29a6 100644
--- a/test/Preprocessor/arm-target-features.c
+++ b/test/Preprocessor/arm-target-features.c
@@ -8,7 +8,7 @@
// CHECK-V7: __ARMEL__ 1
// CHECK-V7: __ARM_ARCH 7
// CHECK-V7: __ARM_ARCH_7A__ 1
-// CHECK-NOT-V7: __ARM_FEATURE_CRC32
+// CHECK-V7-NOT: __ARM_FEATURE_CRC32
// RUN: %clang -target armv8a -mfloat-abi=hard -x c -E -dM %s | FileCheck --check-prefix=CHECK-V8-BAREHF %s
// CHECK-V8-BAREHF: __ARMEL__ 1
@@ -68,6 +68,15 @@
// RUN: %clang -target armv8a-eabi -x c -E -dM %s -o - | FileCheck --check-prefix=THUMBV8A-EABI %s
// THUMBV8A-EABI:#define __ARM_ARCH_EXT_IDIV__ 1
+// RUN: %clang -target arm-none-linux-gnu -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-DEFS %s
+// CHECK-DEFS:#define __ARM_SIZEOF_MINIMAL_ENUM 4
+// CHECK-DEFS:#define __ARM_SIZEOF_WCHAR_T 4
+
+// RUN: %clang -target arm-none-linux-gnu -fshort-wchar -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTWCHAR %s
+// CHECK-SHORTWCHAR:#define __ARM_SIZEOF_WCHAR_T 2
+
+// RUN: %clang -target arm-none-linux-gnu -fshort-enums -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SHORTENUMS %s
+// CHECK-SHORTENUMS:#define __ARM_SIZEOF_MINIMAL_ENUM 1
// Test that -mhwdiv has the right effect for a target CPU which has hwdiv enabled by default.
// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-ARM %s
@@ -94,6 +103,39 @@
// RUN: %clang -target arm -mthumb -mcpu=cortex-a15 -mhwdiv=none -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTHWDIV-NONEHWDIV-THUMB %s
// DEFAULTHWDIV-NONEHWDIV-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// Check that -mfpu works properly for Cortex-A7 (enabled by default).
+// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A7 %s
+// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A7 %s
+// DEFAULTFPU-A7:#define __ARM_NEON__ 1
+// DEFAULTFPU-A7:#define __ARM_VFPV4__ 1
+
+// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A7 %s
+// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A7 %s
+// FPUNONE-A7-NOT:#define __ARM_NEON__ 1
+// FPUNONE-A7-NOT:#define __ARM_VFPV4__ 1
+
+// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A7 %s
+// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a7 -mfpu=vfp4 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A7 %s
+// NONEON-A7-NOT:#define __ARM_NEON__ 1
+// NONEON-A7:#define __ARM_VFPV4__ 1
+
+// Check that -mfpu works properly for Cortex-A5 (enabled by default).
+// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A5 %s
+// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A5 %s
+// DEFAULTFPU-A5:#define __ARM_NEON__ 1
+// DEFAULTFPU-A5:#define __ARM_VFPV4__ 1
+
+// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A5 %s
+// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A5 %s
+// FPUNONE-A5-NOT:#define __ARM_NEON__ 1
+// FPUNONE-A5-NOT:#define __ARM_VFPV4__ 1
+
+// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a5 -mfpu=vfp3-d16 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A5 %s
+// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a5 -mfpu=vfp3-d16 -x c -E -dM %s -o - | FileCheck --check-prefix=NONEON-A5 %s
+// NONEON-A5-NOT:#define __ARM_NEON__ 1
+// NONEON-A5:#define __ARM_VFPV4__ 1
+
// FIXME: add check for further predefines
// Test whether predefines are as expected when targeting cortex-a5.
// RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5-ARM %s
@@ -102,6 +144,20 @@
// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5-THUMB %s
// A5-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
+// RUN: %clang -target armv7 -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5 %s
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a5 -x c -E -dM %s -o - | FileCheck --check-prefix=A5 %s
+// A5:#define __ARM_ARCH 7
+// A5:#define __ARM_ARCH_7A__ 1
+// A5:#define __ARM_ARCH_PROFILE A
+
+// Test whether predefines are as expected when targeting cortex-a7.
+// RUN: %clang -target armv7 -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=A7 %s
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a7 -x c -E -dM %s -o - | FileCheck --check-prefix=A7 %s
+// A7:#define __ARM_ARCH 7
+// A7:#define __ARM_ARCH_7A__ 1
+// A7:#define __ARM_ARCH_EXT_IDIV__ 1
+// A7:#define __ARM_ARCH_PROFILE A
+
// Test whether predefines are as expected when targeting cortex-a8.
// RUN: %clang -target armv7 -mcpu=cortex-a8 -x c -E -dM %s -o - | FileCheck --check-prefix=A8-ARM %s
// A8-ARM-NOT:#define __ARM_ARCH_EXT_IDIV__
@@ -116,6 +172,26 @@
// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a9 -x c -E -dM %s -o - | FileCheck --check-prefix=A9-THUMB %s
// A9-THUMB-NOT:#define __ARM_ARCH_EXT_IDIV__
+
+// Check that -mfpu works properly for Cortex-A12 (enabled by default).
+// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A12 %s
+// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=DEFAULTFPU-A12 %s
+// DEFAULTFPU-A12:#define __ARM_NEON__ 1
+// DEFAULTFPU-A12:#define __ARM_VFPV4__ 1
+
+// RUN: %clang -target armv7-none-linux-gnueabi -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A12 %s
+// RUN: %clang -target armv7-none-linux-gnueabi -mthumb -mcpu=cortex-a12 -mfpu=none -x c -E -dM %s -o - | FileCheck --check-prefix=FPUNONE-A12 %s
+// FPUNONE-A12-NOT:#define __ARM_NEON__ 1
+// FPUNONE-A12-NOT:#define __ARM_VFPV4__ 1
+
+// Test whether predefines are as expected when targeting cortex-a12.
+// RUN: %clang -target armv7 -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=A12 %s
+// RUN: %clang -target armv7 -mthumb -mcpu=cortex-a12 -x c -E -dM %s -o - | FileCheck --check-prefix=A12 %s
+// A12:#define __ARM_ARCH 7
+// A12:#define __ARM_ARCH_7A__ 1
+// A12:#define __ARM_ARCH_EXT_IDIV__ 1
+// A12:#define __ARM_ARCH_PROFILE A
+
// Test whether predefines are as expected when targeting cortex-a15.
// RUN: %clang -target armv7 -mcpu=cortex-a15 -x c -E -dM %s -o - | FileCheck --check-prefix=A15-ARM %s
// A15-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
@@ -155,3 +231,13 @@
// Test whether predefines are as expected when targeting cortex-m4.
// RUN: %clang -target armv7 -mthumb -mcpu=cortex-m4 -x c -E -dM %s -o - | FileCheck --check-prefix=M4-THUMB %s
// M4-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
+
+// Test whether predefines are as expected when targeting krait.
+// RUN: %clang -target armv7 -mcpu=krait -x c -E -dM %s -o - | FileCheck --check-prefix=KRAIT-ARM %s
+// KRAIT-ARM:#define __ARM_ARCH_EXT_IDIV__ 1
+// KRAIT-ARM:#define __ARM_VFPV4__ 1
+
+// RUN: %clang -target armv7 -mthumb -mcpu=krait -x c -E -dM %s -o - | FileCheck --check-prefix=KRAIT-THUMB %s
+// KRAIT-THUMB:#define __ARM_ARCH_EXT_IDIV__ 1
+// KRAIT-THUMB:#define __ARM_VFPV4__ 1
+
diff --git a/test/Preprocessor/has_attribute.c b/test/Preprocessor/has_attribute.c
index 555c2b3..5fe060e 100644
--- a/test/Preprocessor/has_attribute.c
+++ b/test/Preprocessor/has_attribute.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -E %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple arm-unknown-linux -E %s -o - | FileCheck %s
// CHECK: always_inline
#if __has_attribute(always_inline)
@@ -38,3 +38,13 @@
#if !__has_attribute(volatile)
int has_no_volatile_attribute();
#endif
+
+// CHECK: has_arm_interrupt
+#if __has_attribute(interrupt)
+ int has_arm_interrupt();
+#endif
+
+// CHECK: does_not_have_dllexport
+#if !__has_attribute(dllexport)
+ int does_not_have_dllexport();
+#endif
diff --git a/test/Preprocessor/header_lookup1.c b/test/Preprocessor/header_lookup1.c
index d090936..336aba6 100644
--- a/test/Preprocessor/header_lookup1.c
+++ b/test/Preprocessor/header_lookup1.c
@@ -1,2 +1,2 @@
-// RUN: %clang -fno-ms-extensions %s -E | grep 'stddef.h.*3'
+// RUN: %clang_cc1 %s -E | grep 'stddef.h.*3'
#include <stddef.h>
diff --git a/test/Preprocessor/headermap-rel.c b/test/Preprocessor/headermap-rel.c
new file mode 100644
index 0000000..38500a7
--- /dev/null
+++ b/test/Preprocessor/headermap-rel.c
@@ -0,0 +1,12 @@
+
+// This uses a headermap with this entry:
+// Foo.h -> Foo/Foo.h
+
+// RUN: %clang_cc1 -E %s -o %t.i -I %S/Inputs/headermap-rel/foo.hmap -F %S/Inputs/headermap-rel
+// RUN: FileCheck %s -input-file %t.i
+
+// CHECK: Foo.h is parsed
+// CHECK: Foo.h is parsed
+
+#include "Foo.h"
+#include "Foo.h"
diff --git a/test/Preprocessor/headermap-rel2.c b/test/Preprocessor/headermap-rel2.c
new file mode 100644
index 0000000..430854d
--- /dev/null
+++ b/test/Preprocessor/headermap-rel2.c
@@ -0,0 +1,14 @@
+// This uses a headermap with this entry:
+// someheader.h -> Product/someheader.h
+
+// RUN: %clang_cc1 -triple x86_64-apple-darwin13 -v -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H
+// RUN: %clang_cc1 -triple x86_64-apple-darwin13 -fsyntax-only %s -iquote %S/Inputs/headermap-rel2/project-headers.hmap -isysroot %S/Inputs/headermap-rel2/system -I %S/Inputs/headermap-rel2 -H 2> %t.out
+// RUN: FileCheck %s -input-file %t.out
+
+// CHECK: Product/someheader.h
+// CHECK: system/usr/include{{[/\\]+}}someheader.h
+// CHECK: system/usr/include{{[/\\]+}}someheader.h
+
+#include "someheader.h"
+#include <someheader.h>
+#include <someheader.h>
diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c
index 8486e94..8f57d29 100644
--- a/test/Preprocessor/init.c
+++ b/test/Preprocessor/init.c
@@ -15,7 +15,7 @@
// CXX1Y:#define __GXX_EXPERIMENTAL_CXX0X__ 1
// CXX1Y:#define __GXX_RTTI 1
// CXX1Y:#define __GXX_WEAK__ 1
-// CXX1Y:#define __cplusplus 201305L
+// CXX1Y:#define __cplusplus 201402L
// CXX1Y:#define __private_extern__ extern
//
//
@@ -89,7 +89,7 @@
//
// GXX1Y:#define __GNUG__
// GXX1Y:#define __GXX_WEAK__ 1
-// GXX1Y:#define __cplusplus 201305L
+// GXX1Y:#define __cplusplus 201402L
// GXX1Y:#define __private_extern__ extern
//
//
@@ -196,18 +196,337 @@
// SCHAR:#define __clang__ 1
//
// RUN: %clang_cc1 -E -dM -fshort-wchar < /dev/null | FileCheck -check-prefix SHORTWCHAR %s
+// wchar_t is u16 for targeting Win32.
+// FIXME: Implement and check x86_64-cygwin.
+// RUN: %clang_cc1 -E -dM -fno-short-wchar -triple=x86_64-w64-mingw32 < /dev/null | FileCheck -check-prefix SHORTWCHAR %s
//
// SHORTWCHAR: #define __SIZEOF_WCHAR_T__ 2
// SHORTWCHAR: #define __WCHAR_MAX__ 65535U
// SHORTWCHAR: #define __WCHAR_TYPE__ unsigned short
// SHORTWCHAR: #define __WCHAR_WIDTH__ 16
//
+// RUN: %clang_cc1 -E -dM -fno-short-wchar -triple=i686-unknown-unknown < /dev/null | FileCheck -check-prefix SHORTWCHAR2 %s
+// RUN: %clang_cc1 -E -dM -fno-short-wchar -triple=x86_64-unknown-unknown < /dev/null | FileCheck -check-prefix SHORTWCHAR2 %s
+//
+// SHORTWCHAR2: #define __SIZEOF_WCHAR_T__ 4
+// SHORTWCHAR2: #define __WCHAR_WIDTH__ 32
+// Other definitions vary from platform to platform
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=aarch64-none-none < /dev/null | FileCheck -check-prefix AARCH64 %s
+//
+// AARCH64:#define _LP64 1
+// AARCH64-NOT:#define __AARCH64EB__ 1
+// AARCH64:#define __AARCH64EL__ 1
+// AARCH64-NOT:#define __AARCH_BIG_ENDIAN 1
+// AARCH64:#define __ARM_64BIT_STATE 1
+// AARCH64:#define __ARM_ARCH 8
+// AARCH64:#define __ARM_ARCH_ISA_A64 1
+// AARCH64-NOT:#define __ARM_BIG_ENDIAN 1
+// AARCH64:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+// AARCH64:#define __CHAR16_TYPE__ unsigned short
+// AARCH64:#define __CHAR32_TYPE__ unsigned int
+// AARCH64:#define __CHAR_BIT__ 8
+// AARCH64:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// AARCH64:#define __DBL_DIG__ 15
+// AARCH64:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// AARCH64:#define __DBL_HAS_DENORM__ 1
+// AARCH64:#define __DBL_HAS_INFINITY__ 1
+// AARCH64:#define __DBL_HAS_QUIET_NAN__ 1
+// AARCH64:#define __DBL_MANT_DIG__ 53
+// AARCH64:#define __DBL_MAX_10_EXP__ 308
+// AARCH64:#define __DBL_MAX_EXP__ 1024
+// AARCH64:#define __DBL_MAX__ 1.7976931348623157e+308
+// AARCH64:#define __DBL_MIN_10_EXP__ (-307)
+// AARCH64:#define __DBL_MIN_EXP__ (-1021)
+// AARCH64:#define __DBL_MIN__ 2.2250738585072014e-308
+// AARCH64:#define __DECIMAL_DIG__ 36
+// AARCH64:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// AARCH64:#define __FLT_DIG__ 6
+// AARCH64:#define __FLT_EPSILON__ 1.19209290e-7F
+// AARCH64:#define __FLT_EVAL_METHOD__ 0
+// AARCH64:#define __FLT_HAS_DENORM__ 1
+// AARCH64:#define __FLT_HAS_INFINITY__ 1
+// AARCH64:#define __FLT_HAS_QUIET_NAN__ 1
+// AARCH64:#define __FLT_MANT_DIG__ 24
+// AARCH64:#define __FLT_MAX_10_EXP__ 38
+// AARCH64:#define __FLT_MAX_EXP__ 128
+// AARCH64:#define __FLT_MAX__ 3.40282347e+38F
+// AARCH64:#define __FLT_MIN_10_EXP__ (-37)
+// AARCH64:#define __FLT_MIN_EXP__ (-125)
+// AARCH64:#define __FLT_MIN__ 1.17549435e-38F
+// AARCH64:#define __FLT_RADIX__ 2
+// AARCH64:#define __INT16_TYPE__ short
+// AARCH64:#define __INT32_TYPE__ int
+// AARCH64:#define __INT64_C_SUFFIX__ L
+// AARCH64:#define __INT64_TYPE__ long int
+// AARCH64:#define __INT8_TYPE__ char
+// AARCH64:#define __INTMAX_MAX__ 9223372036854775807L
+// AARCH64:#define __INTMAX_TYPE__ long int
+// AARCH64:#define __INTMAX_WIDTH__ 64
+// AARCH64:#define __INTPTR_TYPE__ long int
+// AARCH64:#define __INTPTR_WIDTH__ 64
+// AARCH64:#define __INT_MAX__ 2147483647
+// AARCH64:#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
+// AARCH64:#define __LDBL_DIG__ 33
+// AARCH64:#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L
+// AARCH64:#define __LDBL_HAS_DENORM__ 1
+// AARCH64:#define __LDBL_HAS_INFINITY__ 1
+// AARCH64:#define __LDBL_HAS_QUIET_NAN__ 1
+// AARCH64:#define __LDBL_MANT_DIG__ 113
+// AARCH64:#define __LDBL_MAX_10_EXP__ 4932
+// AARCH64:#define __LDBL_MAX_EXP__ 16384
+// AARCH64:#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L
+// AARCH64:#define __LDBL_MIN_10_EXP__ (-4931)
+// AARCH64:#define __LDBL_MIN_EXP__ (-16381)
+// AARCH64:#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
+// AARCH64:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// AARCH64:#define __LONG_MAX__ 9223372036854775807L
+// AARCH64:#define __LP64__ 1
+// AARCH64:#define __POINTER_WIDTH__ 64
+// AARCH64:#define __PTRDIFF_TYPE__ long int
+// AARCH64:#define __PTRDIFF_WIDTH__ 64
+// AARCH64:#define __SCHAR_MAX__ 127
+// AARCH64:#define __SHRT_MAX__ 32767
+// AARCH64:#define __SIG_ATOMIC_WIDTH__ 32
+// AARCH64:#define __SIZEOF_DOUBLE__ 8
+// AARCH64:#define __SIZEOF_FLOAT__ 4
+// AARCH64:#define __SIZEOF_INT128__ 16
+// AARCH64:#define __SIZEOF_INT__ 4
+// AARCH64:#define __SIZEOF_LONG_DOUBLE__ 16
+// AARCH64:#define __SIZEOF_LONG_LONG__ 8
+// AARCH64:#define __SIZEOF_LONG__ 8
+// AARCH64:#define __SIZEOF_POINTER__ 8
+// AARCH64:#define __SIZEOF_PTRDIFF_T__ 8
+// AARCH64:#define __SIZEOF_SHORT__ 2
+// AARCH64:#define __SIZEOF_SIZE_T__ 8
+// AARCH64:#define __SIZEOF_WCHAR_T__ 4
+// AARCH64:#define __SIZEOF_WINT_T__ 4
+// AARCH64:#define __SIZE_MAX__ 18446744073709551615UL
+// AARCH64:#define __SIZE_TYPE__ long unsigned int
+// AARCH64:#define __SIZE_WIDTH__ 64
+// AARCH64:#define __UINTMAX_TYPE__ long unsigned int
+// AARCH64:#define __USER_LABEL_PREFIX__ _
+// AARCH64:#define __WCHAR_MAX__ 4294967295U
+// AARCH64:#define __WCHAR_TYPE__ unsigned int
+// AARCH64:#define __WCHAR_UNSIGNED__ 1
+// AARCH64:#define __WCHAR_WIDTH__ 32
+// AARCH64:#define __WINT_TYPE__ int
+// AARCH64:#define __WINT_WIDTH__ 32
+// AARCH64:#define __aarch64__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=aarch64_be-none-none < /dev/null | FileCheck -check-prefix AARCH64-BE %s
+//
+// AARCH64-BE:#define _LP64 1
+// AARCH64-BE:#define __AARCH64EB__ 1
+// AARCH64-BE-NOT:#define __AARCH64EL__ 1
+// AARCH64-BE:#define __AARCH_BIG_ENDIAN 1
+// AARCH64-BE:#define __ARM_64BIT_STATE 1
+// AARCH64-BE:#define __ARM_ARCH 8
+// AARCH64-BE:#define __ARM_ARCH_ISA_A64 1
+// AARCH64-BE:#define __ARM_BIG_ENDIAN 1
+// AARCH64-BE:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
+// AARCH64-BE:#define __CHAR16_TYPE__ unsigned short
+// AARCH64-BE:#define __CHAR32_TYPE__ unsigned int
+// AARCH64-BE:#define __CHAR_BIT__ 8
+// AARCH64-BE:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// AARCH64-BE:#define __DBL_DIG__ 15
+// AARCH64-BE:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// AARCH64-BE:#define __DBL_HAS_DENORM__ 1
+// AARCH64-BE:#define __DBL_HAS_INFINITY__ 1
+// AARCH64-BE:#define __DBL_HAS_QUIET_NAN__ 1
+// AARCH64-BE:#define __DBL_MANT_DIG__ 53
+// AARCH64-BE:#define __DBL_MAX_10_EXP__ 308
+// AARCH64-BE:#define __DBL_MAX_EXP__ 1024
+// AARCH64-BE:#define __DBL_MAX__ 1.7976931348623157e+308
+// AARCH64-BE:#define __DBL_MIN_10_EXP__ (-307)
+// AARCH64-BE:#define __DBL_MIN_EXP__ (-1021)
+// AARCH64-BE:#define __DBL_MIN__ 2.2250738585072014e-308
+// AARCH64-BE:#define __DECIMAL_DIG__ 36
+// AARCH64-BE:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// AARCH64-BE:#define __FLT_DIG__ 6
+// AARCH64-BE:#define __FLT_EPSILON__ 1.19209290e-7F
+// AARCH64-BE:#define __FLT_EVAL_METHOD__ 0
+// AARCH64-BE:#define __FLT_HAS_DENORM__ 1
+// AARCH64-BE:#define __FLT_HAS_INFINITY__ 1
+// AARCH64-BE:#define __FLT_HAS_QUIET_NAN__ 1
+// AARCH64-BE:#define __FLT_MANT_DIG__ 24
+// AARCH64-BE:#define __FLT_MAX_10_EXP__ 38
+// AARCH64-BE:#define __FLT_MAX_EXP__ 128
+// AARCH64-BE:#define __FLT_MAX__ 3.40282347e+38F
+// AARCH64-BE:#define __FLT_MIN_10_EXP__ (-37)
+// AARCH64-BE:#define __FLT_MIN_EXP__ (-125)
+// AARCH64-BE:#define __FLT_MIN__ 1.17549435e-38F
+// AARCH64-BE:#define __FLT_RADIX__ 2
+// AARCH64-BE:#define __INT16_TYPE__ short
+// AARCH64-BE:#define __INT32_TYPE__ int
+// AARCH64-BE:#define __INT64_C_SUFFIX__ L
+// AARCH64-BE:#define __INT64_TYPE__ long int
+// AARCH64-BE:#define __INT8_TYPE__ char
+// AARCH64-BE:#define __INTMAX_MAX__ 9223372036854775807L
+// AARCH64-BE:#define __INTMAX_TYPE__ long int
+// AARCH64-BE:#define __INTMAX_WIDTH__ 64
+// AARCH64-BE:#define __INTPTR_TYPE__ long int
+// AARCH64-BE:#define __INTPTR_WIDTH__ 64
+// AARCH64-BE:#define __INT_MAX__ 2147483647
+// AARCH64-BE:#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
+// AARCH64-BE:#define __LDBL_DIG__ 33
+// AARCH64-BE:#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L
+// AARCH64-BE:#define __LDBL_HAS_DENORM__ 1
+// AARCH64-BE:#define __LDBL_HAS_INFINITY__ 1
+// AARCH64-BE:#define __LDBL_HAS_QUIET_NAN__ 1
+// AARCH64-BE:#define __LDBL_MANT_DIG__ 113
+// AARCH64-BE:#define __LDBL_MAX_10_EXP__ 4932
+// AARCH64-BE:#define __LDBL_MAX_EXP__ 16384
+// AARCH64-BE:#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L
+// AARCH64-BE:#define __LDBL_MIN_10_EXP__ (-4931)
+// AARCH64-BE:#define __LDBL_MIN_EXP__ (-16381)
+// AARCH64-BE:#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
+// AARCH64-BE:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// AARCH64-BE:#define __LONG_MAX__ 9223372036854775807L
+// AARCH64-BE:#define __LP64__ 1
+// AARCH64-BE:#define __POINTER_WIDTH__ 64
+// AARCH64-BE:#define __PTRDIFF_TYPE__ long int
+// AARCH64-BE:#define __PTRDIFF_WIDTH__ 64
+// AARCH64-BE:#define __SCHAR_MAX__ 127
+// AARCH64-BE:#define __SHRT_MAX__ 32767
+// AARCH64-BE:#define __SIG_ATOMIC_WIDTH__ 32
+// AARCH64-BE:#define __SIZEOF_DOUBLE__ 8
+// AARCH64-BE:#define __SIZEOF_FLOAT__ 4
+// AARCH64-BE:#define __SIZEOF_INT128__ 16
+// AARCH64-BE:#define __SIZEOF_INT__ 4
+// AARCH64-BE:#define __SIZEOF_LONG_DOUBLE__ 16
+// AARCH64-BE:#define __SIZEOF_LONG_LONG__ 8
+// AARCH64-BE:#define __SIZEOF_LONG__ 8
+// AARCH64-BE:#define __SIZEOF_POINTER__ 8
+// AARCH64-BE:#define __SIZEOF_PTRDIFF_T__ 8
+// AARCH64-BE:#define __SIZEOF_SHORT__ 2
+// AARCH64-BE:#define __SIZEOF_SIZE_T__ 8
+// AARCH64-BE:#define __SIZEOF_WCHAR_T__ 4
+// AARCH64-BE:#define __SIZEOF_WINT_T__ 4
+// AARCH64-BE:#define __SIZE_MAX__ 18446744073709551615UL
+// AARCH64-BE:#define __SIZE_TYPE__ long unsigned int
+// AARCH64-BE:#define __SIZE_WIDTH__ 64
+// AARCH64-BE:#define __UINTMAX_TYPE__ long unsigned int
+// AARCH64-BE:#define __USER_LABEL_PREFIX__ _
+// AARCH64-BE:#define __WCHAR_MAX__ 4294967295U
+// AARCH64-BE:#define __WCHAR_TYPE__ unsigned int
+// AARCH64-BE:#define __WCHAR_UNSIGNED__ 1
+// AARCH64-BE:#define __WCHAR_WIDTH__ 32
+// AARCH64-BE:#define __WINT_TYPE__ int
+// AARCH64-BE:#define __WINT_WIDTH__ 32
+// AARCH64-BE:#define __aarch64__ 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=aarch64-netbsd < /dev/null | FileCheck -check-prefix AARCH64-NETBSD %s
+//
+// AARCH64-NETBSD:#define _LP64 1
+// AARCH64-NETBSD-NOT:#define __AARCH64EB__ 1
+// AARCH64-NETBSD:#define __AARCH64EL__ 1
+// AARCH64-NETBSD-NOT:#define __AARCH_BIG_ENDIAN 1
+// AARCH64-NETBSD:#define __ARM_64BIT_STATE 1
+// AARCH64-NETBSD:#define __ARM_ARCH 8
+// AARCH64-NETBSD:#define __ARM_ARCH_ISA_A64 1
+// AARCH64-NETBSD-NOT:#define __ARM_BIG_ENDIAN 1
+// AARCH64-NETBSD:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+// AARCH64-NETBSD:#define __CHAR16_TYPE__ unsigned short
+// AARCH64-NETBSD:#define __CHAR32_TYPE__ unsigned int
+// AARCH64-NETBSD:#define __CHAR_BIT__ 8
+// AARCH64-NETBSD:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// AARCH64-NETBSD:#define __DBL_DIG__ 15
+// AARCH64-NETBSD:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// AARCH64-NETBSD:#define __DBL_HAS_DENORM__ 1
+// AARCH64-NETBSD:#define __DBL_HAS_INFINITY__ 1
+// AARCH64-NETBSD:#define __DBL_HAS_QUIET_NAN__ 1
+// AARCH64-NETBSD:#define __DBL_MANT_DIG__ 53
+// AARCH64-NETBSD:#define __DBL_MAX_10_EXP__ 308
+// AARCH64-NETBSD:#define __DBL_MAX_EXP__ 1024
+// AARCH64-NETBSD:#define __DBL_MAX__ 1.7976931348623157e+308
+// AARCH64-NETBSD:#define __DBL_MIN_10_EXP__ (-307)
+// AARCH64-NETBSD:#define __DBL_MIN_EXP__ (-1021)
+// AARCH64-NETBSD:#define __DBL_MIN__ 2.2250738585072014e-308
+// AARCH64-NETBSD:#define __DECIMAL_DIG__ 36
+// AARCH64-NETBSD:#define __ELF__ 1
+// AARCH64-NETBSD:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// AARCH64-NETBSD:#define __FLT_DIG__ 6
+// AARCH64-NETBSD:#define __FLT_EPSILON__ 1.19209290e-7F
+// AARCH64-NETBSD:#define __FLT_EVAL_METHOD__ 0
+// AARCH64-NETBSD:#define __FLT_HAS_DENORM__ 1
+// AARCH64-NETBSD:#define __FLT_HAS_INFINITY__ 1
+// AARCH64-NETBSD:#define __FLT_HAS_QUIET_NAN__ 1
+// AARCH64-NETBSD:#define __FLT_MANT_DIG__ 24
+// AARCH64-NETBSD:#define __FLT_MAX_10_EXP__ 38
+// AARCH64-NETBSD:#define __FLT_MAX_EXP__ 128
+// AARCH64-NETBSD:#define __FLT_MAX__ 3.40282347e+38F
+// AARCH64-NETBSD:#define __FLT_MIN_10_EXP__ (-37)
+// AARCH64-NETBSD:#define __FLT_MIN_EXP__ (-125)
+// AARCH64-NETBSD:#define __FLT_MIN__ 1.17549435e-38F
+// AARCH64-NETBSD:#define __FLT_RADIX__ 2
+// AARCH64-NETBSD:#define __INT16_TYPE__ short
+// AARCH64-NETBSD:#define __INT32_TYPE__ int
+// AARCH64-NETBSD:#define __INT64_C_SUFFIX__ LL
+// AARCH64-NETBSD:#define __INT64_TYPE__ long long int
+// AARCH64-NETBSD:#define __INT8_TYPE__ char
+// AARCH64-NETBSD:#define __INTMAX_MAX__ 9223372036854775807LL
+// AARCH64-NETBSD:#define __INTMAX_TYPE__ long long int
+// AARCH64-NETBSD:#define __INTMAX_WIDTH__ 64
+// AARCH64-NETBSD:#define __INTPTR_TYPE__ long int
+// AARCH64-NETBSD:#define __INTPTR_WIDTH__ 64
+// AARCH64-NETBSD:#define __INT_MAX__ 2147483647
+// AARCH64-NETBSD:#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
+// AARCH64-NETBSD:#define __LDBL_DIG__ 33
+// AARCH64-NETBSD:#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L
+// AARCH64-NETBSD:#define __LDBL_HAS_DENORM__ 1
+// AARCH64-NETBSD:#define __LDBL_HAS_INFINITY__ 1
+// AARCH64-NETBSD:#define __LDBL_HAS_QUIET_NAN__ 1
+// AARCH64-NETBSD:#define __LDBL_MANT_DIG__ 113
+// AARCH64-NETBSD:#define __LDBL_MAX_10_EXP__ 4932
+// AARCH64-NETBSD:#define __LDBL_MAX_EXP__ 16384
+// AARCH64-NETBSD:#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L
+// AARCH64-NETBSD:#define __LDBL_MIN_10_EXP__ (-4931)
+// AARCH64-NETBSD:#define __LDBL_MIN_EXP__ (-16381)
+// AARCH64-NETBSD:#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
+// AARCH64-NETBSD:#define __LITTLE_ENDIAN__ 1
+// AARCH64-NETBSD:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// AARCH64-NETBSD:#define __LONG_MAX__ 9223372036854775807L
+// AARCH64-NETBSD:#define __LP64__ 1
+// AARCH64-NETBSD:#define __NetBSD__ 1
+// AARCH64-NETBSD:#define __POINTER_WIDTH__ 64
+// AARCH64-NETBSD:#define __PTRDIFF_TYPE__ long int
+// AARCH64-NETBSD:#define __PTRDIFF_WIDTH__ 64
+// AARCH64-NETBSD:#define __SCHAR_MAX__ 127
+// AARCH64-NETBSD:#define __SHRT_MAX__ 32767
+// AARCH64-NETBSD:#define __SIG_ATOMIC_WIDTH__ 32
+// AARCH64-NETBSD:#define __SIZEOF_DOUBLE__ 8
+// AARCH64-NETBSD:#define __SIZEOF_FLOAT__ 4
+// AARCH64-NETBSD:#define __SIZEOF_INT__ 4
+// AARCH64-NETBSD:#define __SIZEOF_LONG_DOUBLE__ 16
+// AARCH64-NETBSD:#define __SIZEOF_LONG_LONG__ 8
+// AARCH64-NETBSD:#define __SIZEOF_LONG__ 8
+// AARCH64-NETBSD:#define __SIZEOF_POINTER__ 8
+// AARCH64-NETBSD:#define __SIZEOF_PTRDIFF_T__ 8
+// AARCH64-NETBSD:#define __SIZEOF_SHORT__ 2
+// AARCH64-NETBSD:#define __SIZEOF_SIZE_T__ 8
+// AARCH64-NETBSD:#define __SIZEOF_WCHAR_T__ 4
+// AARCH64-NETBSD:#define __SIZEOF_WINT_T__ 4
+// AARCH64-NETBSD:#define __SIZE_MAX__ 18446744073709551615UL
+// AARCH64-NETBSD:#define __SIZE_TYPE__ long unsigned int
+// AARCH64-NETBSD:#define __SIZE_WIDTH__ 64
+// AARCH64-NETBSD:#define __UINTMAX_TYPE__ long long unsigned int
+// AARCH64-NETBSD:#define __USER_LABEL_PREFIX__
+// AARCH64-NETBSD:#define __WCHAR_MAX__ 2147483647
+// AARCH64-NETBSD:#define __WCHAR_TYPE__ int
+// AARCH64-NETBSD:#define __WCHAR_WIDTH__ 32
+// AARCH64-NETBSD:#define __WINT_TYPE__ int
+// AARCH64-NETBSD:#define __WINT_WIDTH__ 32
+// AARCH64-NETBSD:#define __aarch64__ 1
+
// 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-NOT:#define __ARMEB__ 1
// ARM:#define __ARMEL__ 1
// ARM:#define __ARM_ARCH_6J__ 1
+// ARM-NOT:#define __ARM_BIG_ENDIAN 1
// ARM:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
// ARM:#define __CHAR16_TYPE__ unsigned short
// ARM:#define __CHAR32_TYPE__ unsigned int
@@ -302,13 +621,117 @@
// ARM:#define __arm 1
// ARM:#define __arm__ 1
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=armeb-none-none < /dev/null | FileCheck -check-prefix ARM-BE %s
+//
+// ARM-BE-NOT:#define _LP64
+// ARM-BE:#define __APCS_32__ 1
+// ARM-BE:#define __ARMEB__ 1
+// ARM-BE-NOT:#define __ARMEL__ 1
+// ARM-BE:#define __ARM_ARCH_6J__ 1
+// ARM-BE:#define __ARM_BIG_ENDIAN 1
+// ARM-BE:#define __BIG_ENDIAN__ 1
+// ARM-BE:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
+// ARM-BE:#define __CHAR16_TYPE__ unsigned short
+// ARM-BE:#define __CHAR32_TYPE__ unsigned int
+// ARM-BE:#define __CHAR_BIT__ 8
+// ARM-BE:#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
+// ARM-BE:#define __DBL_DIG__ 15
+// ARM-BE:#define __DBL_EPSILON__ 2.2204460492503131e-16
+// ARM-BE:#define __DBL_HAS_DENORM__ 1
+// ARM-BE:#define __DBL_HAS_INFINITY__ 1
+// ARM-BE:#define __DBL_HAS_QUIET_NAN__ 1
+// ARM-BE:#define __DBL_MANT_DIG__ 53
+// ARM-BE:#define __DBL_MAX_10_EXP__ 308
+// ARM-BE:#define __DBL_MAX_EXP__ 1024
+// ARM-BE:#define __DBL_MAX__ 1.7976931348623157e+308
+// ARM-BE:#define __DBL_MIN_10_EXP__ (-307)
+// ARM-BE:#define __DBL_MIN_EXP__ (-1021)
+// ARM-BE:#define __DBL_MIN__ 2.2250738585072014e-308
+// ARM-BE:#define __DECIMAL_DIG__ 17
+// ARM-BE:#define __FLT_DENORM_MIN__ 1.40129846e-45F
+// ARM-BE:#define __FLT_DIG__ 6
+// ARM-BE:#define __FLT_EPSILON__ 1.19209290e-7F
+// ARM-BE:#define __FLT_EVAL_METHOD__ 0
+// ARM-BE:#define __FLT_HAS_DENORM__ 1
+// ARM-BE:#define __FLT_HAS_INFINITY__ 1
+// ARM-BE:#define __FLT_HAS_QUIET_NAN__ 1
+// ARM-BE:#define __FLT_MANT_DIG__ 24
+// ARM-BE:#define __FLT_MAX_10_EXP__ 38
+// ARM-BE:#define __FLT_MAX_EXP__ 128
+// ARM-BE:#define __FLT_MAX__ 3.40282347e+38F
+// ARM-BE:#define __FLT_MIN_10_EXP__ (-37)
+// ARM-BE:#define __FLT_MIN_EXP__ (-125)
+// ARM-BE:#define __FLT_MIN__ 1.17549435e-38F
+// ARM-BE:#define __FLT_RADIX__ 2
+// ARM-BE:#define __INT16_TYPE__ short
+// ARM-BE:#define __INT32_TYPE__ int
+// ARM-BE:#define __INT64_C_SUFFIX__ LL
+// ARM-BE:#define __INT64_TYPE__ long long int
+// ARM-BE:#define __INT8_TYPE__ char
+// ARM-BE:#define __INTMAX_MAX__ 9223372036854775807LL
+// ARM-BE:#define __INTMAX_TYPE__ long long int
+// ARM-BE:#define __INTMAX_WIDTH__ 64
+// ARM-BE:#define __INTPTR_TYPE__ long int
+// ARM-BE:#define __INTPTR_WIDTH__ 32
+// ARM-BE:#define __INT_MAX__ 2147483647
+// ARM-BE:#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
+// ARM-BE:#define __LDBL_DIG__ 15
+// ARM-BE:#define __LDBL_EPSILON__ 2.2204460492503131e-16L
+// ARM-BE:#define __LDBL_HAS_DENORM__ 1
+// ARM-BE:#define __LDBL_HAS_INFINITY__ 1
+// ARM-BE:#define __LDBL_HAS_QUIET_NAN__ 1
+// ARM-BE:#define __LDBL_MANT_DIG__ 53
+// ARM-BE:#define __LDBL_MAX_10_EXP__ 308
+// ARM-BE:#define __LDBL_MAX_EXP__ 1024
+// ARM-BE:#define __LDBL_MAX__ 1.7976931348623157e+308L
+// ARM-BE:#define __LDBL_MIN_10_EXP__ (-307)
+// ARM-BE:#define __LDBL_MIN_EXP__ (-1021)
+// ARM-BE:#define __LDBL_MIN__ 2.2250738585072014e-308L
+// ARM-BE:#define __LONG_LONG_MAX__ 9223372036854775807LL
+// ARM-BE:#define __LONG_MAX__ 2147483647L
+// ARM-BE-NOT:#define __LP64__
+// ARM-BE:#define __POINTER_WIDTH__ 32
+// ARM-BE:#define __PTRDIFF_TYPE__ int
+// ARM-BE:#define __PTRDIFF_WIDTH__ 32
+// ARM-BE:#define __REGISTER_PREFIX__
+// ARM-BE:#define __SCHAR_MAX__ 127
+// ARM-BE:#define __SHRT_MAX__ 32767
+// ARM-BE:#define __SIG_ATOMIC_WIDTH__ 32
+// ARM-BE:#define __SIZEOF_DOUBLE__ 8
+// ARM-BE:#define __SIZEOF_FLOAT__ 4
+// ARM-BE:#define __SIZEOF_INT__ 4
+// ARM-BE:#define __SIZEOF_LONG_DOUBLE__ 8
+// ARM-BE:#define __SIZEOF_LONG_LONG__ 8
+// ARM-BE:#define __SIZEOF_LONG__ 4
+// ARM-BE:#define __SIZEOF_POINTER__ 4
+// ARM-BE:#define __SIZEOF_PTRDIFF_T__ 4
+// ARM-BE:#define __SIZEOF_SHORT__ 2
+// ARM-BE:#define __SIZEOF_SIZE_T__ 4
+// ARM-BE:#define __SIZEOF_WCHAR_T__ 4
+// ARM-BE:#define __SIZEOF_WINT_T__ 4
+// ARM-BE:#define __SIZE_MAX__ 4294967295U
+// ARM-BE:#define __SIZE_TYPE__ unsigned int
+// ARM-BE:#define __SIZE_WIDTH__ 32
+// ARM-BE:#define __THUMB_INTERWORK__ 1
+// ARM-BE:#define __UINTMAX_TYPE__ long long unsigned int
+// ARM-BE:#define __USER_LABEL_PREFIX__ _
+// ARM-BE:#define __WCHAR_MAX__ 4294967295U
+// ARM-BE:#define __WCHAR_TYPE__ unsigned int
+// ARM-BE:#define __WCHAR_WIDTH__ 32
+// ARM-BE:#define __WINT_TYPE__ int
+// ARM-BE:#define __WINT_WIDTH__ 32
+// ARM-BE:#define __arm 1
+// ARM-BE:#define __arm__ 1
+
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-none-linux-gnueabi -target-feature +soft-float -target-feature +soft-float-abi < /dev/null | FileCheck -check-prefix ARMEABISOFTFP %s
//
-// ARM-NOT:#define _LP64
+// ARMEABISOFTFP-NOT:#define _LP64
// ARMEABISOFTFP:#define __APCS_32__ 1
+// ARMEABISOFTFP-NOT:#define __ARMEB__ 1
// ARMEABISOFTFP:#define __ARMEL__ 1
// ARMEABISOFTFP:#define __ARM_ARCH 6
// ARMEABISOFTFP:#define __ARM_ARCH_6J__ 1
+// ARMEABISOFTFP-NOT:#define __ARM_BIG_ENDIAN 1
// ARMEABISOFTFP:#define __ARM_EABI__ 1
// ARMEABISOFTFP:#define __ARM_PCS 1
// ARMEABISOFTFP-NOT:#define __ARM_PCS_VFP 1
@@ -409,11 +832,13 @@
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=arm-none-linux-gnueabi < /dev/null | FileCheck -check-prefix ARMEABIHARDFP %s
//
-// ARM-NOT:#define _LP64
+// ARMEABIHARDFP-NOT:#define _LP64
// ARMEABIHARDFP:#define __APCS_32__ 1
+// ARMEABIHARDFP-NOT:#define __ARMEB__ 1
// ARMEABIHARDFP:#define __ARMEL__ 1
// ARMEABIHARDFP:#define __ARM_ARCH 6
// ARMEABIHARDFP:#define __ARM_ARCH_6J__ 1
+// ARMEABIHARDFP-NOT:#define __ARM_BIG_ENDIAN 1
// ARMEABIHARDFP:#define __ARM_EABI__ 1
// ARMEABIHARDFP:#define __ARM_PCS 1
// ARMEABIHARDFP:#define __ARM_PCS_VFP 1
@@ -539,6 +964,38 @@
// RUN: %clang -target arm -mthumb -mhwdiv=arm -x c -E -dM %s -o - | FileCheck --check-prefix=ARMHWDIV-THUMB-FALSE %s
// ARMHWDIV-THUMB-FALSE-NOT:#define __ARM_ARCH_EXT_IDIV__
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=armv8-none-none < /dev/null | FileCheck -check-prefix ARMv8 %s
+// ARMv8: #define __THUMB_INTERWORK__ 1
+// ARMv8-NOT: #define __thumb2__
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=armebv8-none-none < /dev/null | FileCheck -check-prefix ARMebv8 %s
+// ARMebv8: #define __THUMB_INTERWORK__ 1
+// ARMebv8-NOT: #define __thumb2__
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbv8 < /dev/null | FileCheck -check-prefix Thumbv8 %s
+// Thumbv8: #define __THUMB_INTERWORK__ 1
+// Thumbv8: #define __thumb2__
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbebv8 < /dev/null | FileCheck -check-prefix Thumbebv8 %s
+// Thumbebv8: #define __THUMB_INTERWORK__ 1
+// Thumbebv8: #define __thumb2__
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbv5 < /dev/null | FileCheck -check-prefix Thumbv5 %s
+// Thumbv5: #define __THUMB_INTERWORK__ 1
+// Thumbv5-NOT: #define __thumb2__
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbv6t2 < /dev/null | FileCheck -check-prefix Thumbv6t2 %s
+// Thumbv6t2: #define __THUMB_INTERWORK__ 1
+// Thumbv6t2: #define __thumb2__
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbv7 < /dev/null | FileCheck -check-prefix Thumbv7 %s
+// Thumbv7: #define __THUMB_INTERWORK__ 1
+// Thumbv7: #define __thumb2__
+
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=thumbebv7 < /dev/null | FileCheck -check-prefix Thumbebv7 %s
+// Thumbebv7: #define __THUMB_INTERWORK__ 1
+// Thumbebv7: #define __thumb2__
+
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=i386-none-none < /dev/null | FileCheck -check-prefix I386 %s
//
@@ -848,13 +1305,14 @@
// MIPS32BE:#define _ABIO32 1
// MIPS32BE-NOT:#define _LP64
// MIPS32BE:#define _MIPSEB 1
-// MIPS32BE:#define _MIPS_ARCH "mips32"
-// MIPS32BE:#define _MIPS_ARCH_MIPS32 1
+// MIPS32BE:#define _MIPS_ARCH "mips32r2"
+// MIPS32BE:#define _MIPS_ARCH_MIPS32R2 1
// MIPS32BE:#define _MIPS_FPSET 16
// MIPS32BE:#define _MIPS_SIM _ABIO32
// MIPS32BE:#define _MIPS_SZINT 32
// MIPS32BE:#define _MIPS_SZLONG 32
// MIPS32BE:#define _MIPS_SZPTR 32
+// MIPS32BE:#define __BIG_ENDIAN__ 1
// MIPS32BE:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// MIPS32BE:#define __CHAR16_TYPE__ unsigned short
// MIPS32BE:#define __CHAR32_TYPE__ unsigned int
@@ -953,7 +1411,7 @@
// MIPS32BE:#define __WINT_WIDTH__ 32
// MIPS32BE:#define __clang__ 1
// MIPS32BE:#define __llvm__ 1
-// MIPS32BE:#define __mips 1
+// MIPS32BE:#define __mips 32
// MIPS32BE:#define __mips__ 1
// MIPS32BE:#define __mips_fpr 32
// MIPS32BE:#define __mips_hard_float 1
@@ -967,8 +1425,8 @@
// MIPS32EL:#define _ABIO32 1
// MIPS32EL-NOT:#define _LP64
// MIPS32EL:#define _MIPSEL 1
-// MIPS32EL:#define _MIPS_ARCH "mips32"
-// MIPS32EL:#define _MIPS_ARCH_MIPS32 1
+// MIPS32EL:#define _MIPS_ARCH "mips32r2"
+// MIPS32EL:#define _MIPS_ARCH_MIPS32R2 1
// MIPS32EL:#define _MIPS_FPSET 16
// MIPS32EL:#define _MIPS_SIM _ABIO32
// MIPS32EL:#define _MIPS_SZINT 32
@@ -1032,6 +1490,7 @@
// MIPS32EL:#define __LDBL_MIN_10_EXP__ (-307)
// MIPS32EL:#define __LDBL_MIN_EXP__ (-1021)
// MIPS32EL:#define __LDBL_MIN__ 2.2250738585072014e-308L
+// MIPS32EL:#define __LITTLE_ENDIAN__ 1
// MIPS32EL:#define __LONG_LONG_MAX__ 9223372036854775807LL
// MIPS32EL:#define __LONG_MAX__ 2147483647L
// MIPS32EL-NOT:#define __LP64__
@@ -1069,7 +1528,7 @@
// MIPS32EL:#define __WINT_WIDTH__ 32
// MIPS32EL:#define __clang__ 1
// MIPS32EL:#define __llvm__ 1
-// MIPS32EL:#define __mips 1
+// MIPS32EL:#define __mips 32
// MIPS32EL:#define __mips__ 1
// MIPS32EL:#define __mips_fpr 32
// MIPS32EL:#define __mips_hard_float 1
@@ -1083,13 +1542,14 @@
// MIPS64BE:#define _ABI64 3
// MIPS64BE:#define _LP64 1
// MIPS64BE:#define _MIPSEB 1
-// MIPS64BE:#define _MIPS_ARCH "mips64"
-// MIPS64BE:#define _MIPS_ARCH_MIPS64 1
+// MIPS64BE:#define _MIPS_ARCH "mips64r2"
+// MIPS64BE:#define _MIPS_ARCH_MIPS64R2 1
// MIPS64BE:#define _MIPS_FPSET 32
// MIPS64BE:#define _MIPS_SIM _ABI64
// MIPS64BE:#define _MIPS_SZINT 32
// MIPS64BE:#define _MIPS_SZLONG 64
// MIPS64BE:#define _MIPS_SZPTR 64
+// MIPS64BE:#define __BIG_ENDIAN__ 1
// MIPS64BE:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// MIPS64BE:#define __CHAR16_TYPE__ unsigned short
// MIPS64BE:#define __CHAR32_TYPE__ unsigned int
@@ -1185,7 +1645,7 @@
// MIPS64BE:#define __WINT_WIDTH__ 32
// MIPS64BE:#define __clang__ 1
// MIPS64BE:#define __llvm__ 1
-// MIPS64BE:#define __mips 1
+// MIPS64BE:#define __mips 64
// MIPS64BE:#define __mips64 1
// MIPS64BE:#define __mips64__ 1
// MIPS64BE:#define __mips__ 1
@@ -1201,8 +1661,8 @@
// MIPS64EL:#define _ABI64 3
// MIPS64EL:#define _LP64 1
// MIPS64EL:#define _MIPSEL 1
-// MIPS64EL:#define _MIPS_ARCH "mips64"
-// MIPS64EL:#define _MIPS_ARCH_MIPS64 1
+// MIPS64EL:#define _MIPS_ARCH "mips64r2"
+// MIPS64EL:#define _MIPS_ARCH_MIPS64R2 1
// MIPS64EL:#define _MIPS_FPSET 32
// MIPS64EL:#define _MIPS_SIM _ABI64
// MIPS64EL:#define _MIPS_SZINT 32
@@ -1266,6 +1726,7 @@
// MIPS64EL:#define __LDBL_MIN_10_EXP__ (-4931)
// MIPS64EL:#define __LDBL_MIN_EXP__ (-16381)
// MIPS64EL:#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
+// MIPS64EL:#define __LITTLE_ENDIAN__ 1
// MIPS64EL:#define __LONG_LONG_MAX__ 9223372036854775807LL
// MIPS64EL:#define __LONG_MAX__ 9223372036854775807L
// MIPS64EL:#define __LP64__ 1
@@ -1303,7 +1764,7 @@
// MIPS64EL:#define __WINT_WIDTH__ 32
// MIPS64EL:#define __clang__ 1
// MIPS64EL:#define __llvm__ 1
-// MIPS64EL:#define __mips 1
+// MIPS64EL:#define __mips 64
// MIPS64EL:#define __mips64 1
// MIPS64EL:#define __mips64__ 1
// MIPS64EL:#define __mips__ 1
@@ -1313,6 +1774,50 @@
// MIPS64EL:#define _mips 1
// MIPS64EL:#define mips 1
//
+// Check MIPS arch macros
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips-none-none \
+// RUN: < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS-ARCH-DEF32 %s
+//
+// MIPS-ARCH-DEF32:#define _MIPS_ARCH "mips32r2"
+// MIPS-ARCH-DEF32:#define _MIPS_ARCH_MIPS32R2 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips-none-nones \
+// RUN: -target-cpu mips32 < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS-ARCH-32 %s
+//
+// MIPS-ARCH-32:#define _MIPS_ARCH "mips32"
+// MIPS-ARCH-32:#define _MIPS_ARCH_MIPS32 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips-none-none \
+// RUN: -target-cpu mips32r2 < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS-ARCH-32R2 %s
+//
+// MIPS-ARCH-32R2:#define _MIPS_ARCH "mips32r2"
+// MIPS-ARCH-32R2:#define _MIPS_ARCH_MIPS32R2 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none \
+// RUN: < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS-ARCH-DEF64 %s
+//
+// MIPS-ARCH-DEF64:#define _MIPS_ARCH "mips64r2"
+// MIPS-ARCH-DEF64:#define _MIPS_ARCH_MIPS64R2 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none \
+// RUN: -target-cpu mips64 < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS-ARCH-64 %s
+//
+// MIPS-ARCH-64:#define _MIPS_ARCH "mips64"
+// MIPS-ARCH-64:#define _MIPS_ARCH_MIPS64 1
+//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none \
+// RUN: -target-cpu mips64r2 < /dev/null \
+// RUN: | FileCheck -check-prefix MIPS-ARCH-64R2 %s
+//
+// MIPS-ARCH-64R2:#define _MIPS_ARCH "mips64r2"
+// MIPS-ARCH-64R2:#define _MIPS_ARCH_MIPS64R2 1
+//
// Check MIPS float ABI macros
//
// RUN: %clang_cc1 -E -dM -ffreestanding \
@@ -1473,6 +1978,7 @@
// MSP430:#define __LDBL_MIN_10_EXP__ (-307)
// MSP430:#define __LDBL_MIN_EXP__ (-1021)
// MSP430:#define __LDBL_MIN__ 2.2250738585072014e-308L
+// MSP430:#define __LITTLE_ENDIAN__ 1
// MSP430:#define __LONG_LONG_MAX__ 9223372036854775807LL
// MSP430:#define __LONG_MAX__ 2147483647L
// MSP430-NOT:#define __LP64__
@@ -1569,6 +2075,7 @@
// NVPTX32:#define __LDBL_MIN_10_EXP__ (-307)
// NVPTX32:#define __LDBL_MIN_EXP__ (-1021)
// NVPTX32:#define __LDBL_MIN__ 2.2250738585072014e-308L
+// NVPTX32:#define __LITTLE_ENDIAN__ 1
// NVPTX32:#define __LONG_LONG_MAX__ 9223372036854775807LL
// NVPTX32:#define __LONG_MAX__ 9223372036854775807L
// NVPTX32-NOT:#define __LP64__
@@ -1666,6 +2173,7 @@
// NVPTX64:#define __LDBL_MIN_10_EXP__ (-307)
// NVPTX64:#define __LDBL_MIN_EXP__ (-1021)
// NVPTX64:#define __LDBL_MIN__ 2.2250738585072014e-308L
+// NVPTX64:#define __LITTLE_ENDIAN__ 1
// NVPTX64:#define __LONG_LONG_MAX__ 9223372036854775807LL
// NVPTX64:#define __LONG_MAX__ 9223372036854775807L
// NVPTX64:#define __LP64__ 1
@@ -1929,6 +2437,7 @@
// PPC64LE:#define _ARCH_PWR6 1
// PPC64LE:#define _ARCH_PWR6X 1
// PPC64LE:#define _ARCH_PWR7 1
+// PPC64LE:#define _CALL_ELF 2
// PPC64LE:#define _LITTLE_ENDIAN 1
// PPC64LE:#define _LP64 1
// PPC64LE:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
@@ -2706,6 +3215,7 @@
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc-none-none < /dev/null | FileCheck -check-prefix SPARC %s
//
// SPARC-NOT:#define _LP64
+// SPARC:#define __BIG_ENDIAN__ 1
// SPARC:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// SPARC:#define __CHAR16_TYPE__ unsigned short
// SPARC:#define __CHAR32_TYPE__ unsigned int
@@ -2804,6 +3314,7 @@
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=tce-none-none < /dev/null | FileCheck -check-prefix TCE %s
//
// TCE-NOT:#define _LP64
+// TCE:#define __BIG_ENDIAN__ 1
// TCE:#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
// TCE:#define __CHAR16_TYPE__ unsigned short
// TCE:#define __CHAR32_TYPE__ unsigned int
@@ -3251,4 +3762,6 @@
// PPC64-FREEBSD-NOT: #define __LONG_DOUBLE_128__ 1
//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=xcore-none-none < /dev/null | FileCheck -check-prefix XCORE %s
+// XCORE:#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+// XCORE:#define __LITTLE_ENDIAN__ 1
// XCORE:#define __XS1B__ 1
diff --git a/test/Preprocessor/macho-embedded-predefines.c b/test/Preprocessor/macho-embedded-predefines.c
new file mode 100644
index 0000000..8356bc9
--- /dev/null
+++ b/test/Preprocessor/macho-embedded-predefines.c
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -E -dM -triple thumbv7m-apple-unknown-macho %s | FileCheck %s
+
+// CHECK: #define __APPLE_CC__
+// CHECK: #define __APPLE__
+// CHECK-NOT: #define __MACH__
diff --git a/test/Preprocessor/macro_arg_empty.c b/test/Preprocessor/macro_arg_empty.c
new file mode 100644
index 0000000..b5ecaa2
--- /dev/null
+++ b/test/Preprocessor/macro_arg_empty.c
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
+
+#define FOO(x) x
+#define BAR(x) x x
+#define BAZ(x) [x] [ x] [x ]
+[FOO()] [ FOO()] [FOO() ] [BAR()] [ BAR()] [BAR() ] BAZ()
+// CHECK: [] [ ] [ ] [ ] [ ] [ ] [] [ ] [ ]
diff --git a/test/Preprocessor/macro_expand_empty.c b/test/Preprocessor/macro_expand_empty.c
index 3fb6394..5507728 100644
--- a/test/Preprocessor/macro_expand_empty.c
+++ b/test/Preprocessor/macro_expand_empty.c
@@ -1,4 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only %s
+// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
+
// Check that this doesn't crash
#define IDENTITY1(x) x
@@ -12,3 +13,9 @@
#define IDENTITY9(x) IDENTITY8(x) IDENTITY8(x) IDENTITY8(x) IDENTITY8(x)
#define IDENTITY0(x) IDENTITY9(x) IDENTITY9(x) IDENTITY9(x) IDENTITY9(x)
IDENTITY0()
+
+#define FOO() BAR() second
+#define BAR()
+first // CHECK: {{^}}first{{$}}
+FOO() // CHECK: {{^}} second{{$}}
+third // CHECK: {{^}}third{{$}}
diff --git a/test/Preprocessor/macro_paste_commaext.c b/test/Preprocessor/macro_paste_commaext.c
index 7cfe43d..fdb8f98 100644
--- a/test/Preprocessor/macro_paste_commaext.c
+++ b/test/Preprocessor/macro_paste_commaext.c
@@ -1,8 +1,8 @@
// RUN: %clang_cc1 %s -E | grep 'V);'
// RUN: %clang_cc1 %s -E | grep 'W, 1, 2);'
// RUN: %clang_cc1 %s -E | grep 'X, 1, 2);'
-// RUN: %clang_cc1 %s -E | grep 'Y, );'
-// RUN: %clang_cc1 %s -E | grep 'Z, );'
+// RUN: %clang_cc1 %s -E | grep 'Y,);'
+// RUN: %clang_cc1 %s -E | grep 'Z,);'
#define debug(format, ...) format, ## __VA_ARGS__)
debug(V);
diff --git a/test/Preprocessor/macro_paste_spacing.c b/test/Preprocessor/macro_paste_spacing.c
index 6498ffc..481d457 100644
--- a/test/Preprocessor/macro_paste_spacing.c
+++ b/test/Preprocessor/macro_paste_spacing.c
@@ -1,7 +1,21 @@
-// RUN: %clang_cc1 %s -E | grep "^xy$"
+// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
#define A x ## y
blah
A
+// CHECK: {{^}}xy{{$}}
+#define B(x, y) [v ## w] [ v##w] [v##w ] [w ## x] [ w##x] [w##x ] [x ## y] [ x##y] [x##y ] [y ## z] [ y##z] [y##z ]
+B(x,y)
+// CHECK: [vw] [ vw] [vw ] [wx] [ wx] [wx ] [xy] [ xy] [xy ] [yz] [ yz] [yz ]
+B(x,)
+// CHECK: [vw] [ vw] [vw ] [wx] [ wx] [wx ] [x] [ x] [x ] [z] [ z] [z ]
+B(,y)
+// CHECK: [vw] [ vw] [vw ] [w] [ w] [w ] [y] [ y] [y ] [yz] [ yz] [yz ]
+B(,)
+// CHECK: [vw] [ vw] [vw ] [w] [ w] [w ] [] [ ] [ ] [z] [ z] [z ]
+
+#define C(x, y, z) [x ## y ## z]
+C(,,) C(a,,) C(,b,) C(,,c) C(a,b,) C(a,,c) C(,b,c) C(a,b,c)
+// CHECK: [] [a] [b] [c] [ab] [ac] [bc] [abc]
diff --git a/test/Preprocessor/macro_space.c b/test/Preprocessor/macro_space.c
index 8a47a3b..13e531f 100644
--- a/test/Preprocessor/macro_space.c
+++ b/test/Preprocessor/macro_space.c
@@ -1,6 +1,36 @@
// RUN: %clang_cc1 -E %s | FileCheck --strict-whitespace %s
-#define XX
-! XX,
+#define FOO1()
+#define FOO2(x)x
+#define FOO3(x) x
+#define FOO4(x)x x
+#define FOO5(x) x x
+#define FOO6(x) [x]
+#define FOO7(x) [ x]
+#define FOO8(x) [x ]
-// CHECK: {{^}}! ,{{$}}
+#define TEST(FOO,x) FOO <FOO()> < FOO()> <FOO ()> <FOO( )> <FOO() > <FOO()x> <FOO() x> < FOO()x>
+
+TEST(FOO1,)
+// CHECK: FOO1 <> < > <> <> < > <> < > < >
+
+TEST(FOO2,)
+// CHECK: FOO2 <> < > <> <> < > <> < > < >
+
+TEST(FOO3,)
+// CHECK: FOO3 <> < > <> <> < > <> < > < >
+
+TEST(FOO4,)
+// CHECK: FOO4 < > < > < > < > < > < > < > < >
+
+TEST(FOO5,)
+// CHECK: FOO5 < > < > < > < > < > < > < > < >
+
+TEST(FOO6,)
+// CHECK: FOO6 <[]> < []> <[]> <[]> <[] > <[]> <[] > < []>
+
+TEST(FOO7,)
+// CHECK: FOO7 <[ ]> < [ ]> <[ ]> <[ ]> <[ ] > <[ ]> <[ ] > < [ ]>
+
+TEST(FOO8,)
+// CHECK: FOO8 <[ ]> < [ ]> <[ ]> <[ ]> <[ ] > <[ ]> <[ ] > < [ ]>
diff --git a/test/Preprocessor/microsoft-header-search.c b/test/Preprocessor/microsoft-header-search.c
new file mode 100644
index 0000000..2cdc54e
--- /dev/null
+++ b/test/Preprocessor/microsoft-header-search.c
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -I%S/Inputs/microsoft-header-search %s -fms-compatibility -verify
+
+// expected-warning@Inputs/microsoft-header-search/a/findme.h:3 {{findme.h successfully included using MS search rules}}
+// expected-warning@Inputs/microsoft-header-search/a/b/include3.h:3 {{#include resolved using non-portable MSVC search rules as}}
+
+// expected-warning@Inputs/microsoft-header-search/falsepos.h:3 {{successfully resolved the falsepos.h header}}
+
+#include "Inputs/microsoft-header-search/include1.h"
diff --git a/test/Preprocessor/print-pragma-microsoft.c b/test/Preprocessor/print-pragma-microsoft.c
new file mode 100644
index 0000000..5c4fb4f
--- /dev/null
+++ b/test/Preprocessor/print-pragma-microsoft.c
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 %s -fsyntax-only -fms-extensions -E -o - | FileCheck %s
+
+#define BAR "2"
+#pragma comment(linker, "bar=" BAR)
+// CHECK: #pragma comment(linker, "bar=" "2")
+#pragma comment(user, "Compiled on " __DATE__ " at " __TIME__)
+// CHECK: #pragma comment(user, "Compiled on " "{{[^"]*}}" " at " "{{[^"]*}}")
+
+#define KEY1 "KEY1"
+#define KEY2 "KEY2"
+#define VAL1 "VAL1\""
+#define VAL2 "VAL2"
+
+#pragma detect_mismatch(KEY1 KEY2, VAL1 VAL2)
+// CHECK: #pragma detect_mismatch("KEY1" "KEY2", "VAL1\"" "VAL2")
+
+#define _CRT_PACKING 8
+#pragma pack(push, _CRT_PACKING)
+// CHECK: #pragma pack(push, 8)
+#pragma pack(pop)
diff --git a/test/Preprocessor/ucn-allowed-chars.c b/test/Preprocessor/ucn-allowed-chars.c
index d49aa9c..d7d67fe 100644
--- a/test/Preprocessor/ucn-allowed-chars.c
+++ b/test/Preprocessor/ucn-allowed-chars.c
@@ -17,7 +17,7 @@
// Identifier initial characters
extern char \u0E50; // C++03, C11, C++11
extern char \u0300; // disallowed initially in C11/C++11, always in C99/C++03
-
+extern char \u0D61; // C99, C11, C++03, C++11
diff --git a/test/Preprocessor/x86_target_features.c b/test/Preprocessor/x86_target_features.c
index 751c8ae..7bc5cd8 100644
--- a/test/Preprocessor/x86_target_features.c
+++ b/test/Preprocessor/x86_target_features.c
@@ -193,16 +193,16 @@
// SHA: #define __SSE2__ 1
// SHA-NOT: #define __SSE3__ 1
-// run: %clang -target i386-unknown-unknown -march=pentiumpro -msha -mno-sha -x c -e -dm -o - %s | filecheck --check-prefix=SHANOSHA %s
+// RUN: %clang -target i386-unknown-unknown -march=pentiumpro -msha -mno-sha -x c -E -dM -o - %s | FileCheck --check-prefix=SHANOSHA %s
// SHANOSHA-NOT: #define __SHA__ 1
// SHANOSHA-NOT: #define __SSE2__ 1
-// run: %clang -target i386-unknown-unknown -march=pentiumpro -msha -mno-sse2 -x c -e -dm -o - %s | filecheck --check-prefix=SHANOSSE2 %s
+// RUN: %clang -target i386-unknown-unknown -march=pentiumpro -msha -mno-sse2 -x c -E -dM -o - %s | FileCheck --check-prefix=SHANOSSE2 %s
-// SHANOSSSE2-NOT: #define __SHA__ 1
-// SHANOSSSE2-NOT: #define __SSE2__ 1
-// SHANOSSSE2-NOT: #define __SSE3__ 1
+// SHANOSSE2-NOT: #define __SHA__ 1
+// SHANOSSE2-NOT: #define __SSE2__ 1
+// SHANOSSE2-NOT: #define __SSE3__ 1
// RUN: %clang -target i386-unknown-unknown -march=atom -mtbm -x c -E -dM -o - %s | FileCheck --check-prefix=TBM %s