Updated to Clang 3.5a.
Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
diff --git a/test/Headers/Inputs/include/setjmp.h b/test/Headers/Inputs/include/setjmp.h
new file mode 100644
index 0000000..3d5e903
--- /dev/null
+++ b/test/Headers/Inputs/include/setjmp.h
@@ -0,0 +1,8 @@
+#ifndef SETJMP_H
+#define SETJMP_H
+
+typedef struct {
+ int x[42];
+} jmp_buf;
+
+#endif
diff --git a/test/Headers/altivec-header.c b/test/Headers/altivec-header.c
index b01cc97..3d85957 100644
--- a/test/Headers/altivec-header.c
+++ b/test/Headers/altivec-header.c
@@ -1,4 +1,4 @@
-// REQUIRES: ppc64-registered-target
+// REQUIRES: powerpc-registered-target
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -S -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -fno-lax-vector-conversions -S -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-unknown-unknown -faltivec -ffreestanding -x c++ -S -o - %s | FileCheck %s
@@ -8,5 +8,8 @@
// Verify that simply including <altivec.h> does not generate any code
// (i.e. all inline routines in the header are marked "static")
-// CHECK-NOT: .text
-
+// CHECK: .text
+// CHECK-NEXT: .file
+// CHECK-NEXT: {{^$}}
+// CHECK-NEXT: .ident{{.*$}}
+// CHECK-NOT: .
diff --git a/test/Headers/c11.c b/test/Headers/c11.c
index 11bec19..c1454c8 100644
--- a/test/Headers/c11.c
+++ b/test/Headers/c11.c
@@ -1,6 +1,8 @@
+// RUN: rm -rf %t
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 %s
-// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -fmodules %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -fmodules -fmodules-cache-path=%t %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -ffreestanding %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c11 -triple i686-pc-win32 -fmsc-version=1700 %s
noreturn int f(); // expected-error 1+{{}}
@@ -22,6 +24,14 @@
#define __STDC_WANT_LIB_EXT1__ 1
#include <stddef.h>
rsize_t x = 0;
+_Static_assert(sizeof(max_align_t) >= sizeof(long long), "");
+_Static_assert(alignof(max_align_t) >= alignof(long long), "");
+_Static_assert(sizeof(max_align_t) >= sizeof(long double), "");
+_Static_assert(alignof(max_align_t) >= alignof(long double), "");
+
+#ifdef _MSC_VER
+_Static_assert(sizeof(max_align_t) == sizeof(double), "");
+#endif
// If we are freestanding, then also check RSIZE_MAX (in a hosted implementation
// we will use the host stdint.h, which may not yet have C11 support).
diff --git a/test/Headers/carbon.c b/test/Headers/carbon.c
new file mode 100644
index 0000000..0498116
--- /dev/null
+++ b/test/Headers/carbon.c
@@ -0,0 +1,4 @@
+// RUN: %clang -fsyntax-only %s
+#ifdef __APPLE__
+#include <Carbon/Carbon.h>
+#endif
diff --git a/test/Headers/cxx11.cpp b/test/Headers/cxx11.cpp
index 1a4b640..8576c5e 100644
--- a/test/Headers/cxx11.cpp
+++ b/test/Headers/cxx11.cpp
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -ffreestanding -fsyntax-only -std=c++11 %s
-// RUN: %clang_cc1 -ffreestanding -fsyntax-only -std=c++11 -fmodules %s
+// DISABLED: %clang_cc1 -ffreestanding -fsyntax-only -std=c++11 -fmodules %s
+
+// FIXME: This test fails on OS X 10.9 with headers in /usr/include, see PR18322
#include <stdalign.h>
diff --git a/test/Headers/ms-intrin.cpp b/test/Headers/ms-intrin.cpp
index 1bf134e..03f57a5 100644
--- a/test/Headers/ms-intrin.cpp
+++ b/test/Headers/ms-intrin.cpp
@@ -1,6 +1,12 @@
// RUN: %clang_cc1 -triple i386-pc-win32 -target-cpu pentium4 \
// RUN: -fms-extensions -fms-compatibility -fmsc-version=1700 \
-// RUN: -ffreestanding -verify %s
+// RUN: -ffreestanding -fsyntax-only -Werror \
+// RUN: -isystem %S/Inputs/include %s
+
+// RUN: %clang_cc1 -triple x86_64-pc-win32 \
+// RUN: -fms-extensions -fms-compatibility -fmsc-version=1700 \
+// RUN: -ffreestanding -fsyntax-only -Werror \
+// RUN: -isystem %S/Inputs/include %s
// Intrin.h needs size_t, but -ffreestanding prevents us from getting it from
// stddef.h. Work around it with this typedef.
@@ -11,14 +17,3 @@
// Use some C++ to make sure we closed the extern "C" brackets.
template <typename T>
void foo(T V) {}
-
-void bar() {
- _ReadWriteBarrier(); // expected-warning {{is deprecated: use other intrinsics or C++11 atomics instead}}
- _ReadBarrier(); // expected-warning {{is deprecated: use other intrinsics or C++11 atomics instead}}
- _WriteBarrier(); // expected-warning {{is deprecated: use other intrinsics or C++11 atomics instead}}
- // FIXME: It'd be handy if we didn't have to hardcode the line number in
- // intrin.h.
- // expected-note@Intrin.h:754 {{declared here}}
- // expected-note@Intrin.h:759 {{declared here}}
- // expected-note@Intrin.h:764 {{declared here}}
-}
diff --git a/test/Headers/warn-sysheader.cpp b/test/Headers/warn-sysheader.cpp
new file mode 100644
index 0000000..dbc3825
--- /dev/null
+++ b/test/Headers/warn-sysheader.cpp
@@ -0,0 +1,33 @@
+// Test that -Wsystem-headers works with default and custom mappings like -Werror.
+// Keep run lines at the bottom for line number stability.
+
+#ifdef IS_SYSHEADER
+#pragma clang system_header
+
+int f() { return (int)0; } // Use the old-style-cast warning as an arbitrary "ordinary" diagnostic for the purpose of testing.
+
+#warning "custom message"
+
+#if defined(A) || defined(B)
+// expected-warning@9 {{"custom message"}}
+#elif defined(C)
+// expected-warning@7 {{use of old-style cast}}
+// expected-warning@9 {{"custom message"}}
+#elif defined(D)
+// expected-error@7 {{use of old-style cast}}
+// expected-error@9 {{"custom message"}}
+#elif defined(E)
+// expected-error@7 {{use of old-style cast}}
+// expected-warning@9 {{"custom message"}}
+#endif
+
+#else
+#define IS_SYSHEADER
+#include __FILE__
+#endif
+
+// RUN: %clang_cc1 -verify -fsyntax-only -DA %s
+// RUN: %clang_cc1 -verify -fsyntax-only -DB -Wold-style-cast %s
+// RUN: %clang_cc1 -verify -fsyntax-only -DC -Wold-style-cast -Wsystem-headers %s
+// RUN: %clang_cc1 -verify -fsyntax-only -DD -Wold-style-cast -Wsystem-headers -Werror %s
+// RUN: %clang_cc1 -verify -fsyntax-only -DE -Wold-style-cast -Wsystem-headers -Werror=old-style-cast %s