Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
diff --git a/test/Frontend/backend-diagnostic.c b/test/Frontend/backend-diagnostic.c
index 8b61c03..1fe4fdb 100644
--- a/test/Frontend/backend-diagnostic.c
+++ b/test/Frontend/backend-diagnostic.c
@@ -6,21 +6,18 @@
 //
 // RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin 2> %t.err
 // RUN: FileCheck < %t.err %s --check-prefix=REGULAR --check-prefix=ASM
-// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Werror=frame-larger-than 2> %t.err
+// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Werror=frame-larger-than= 2> %t.err
 // RUN: FileCheck < %t.err %s --check-prefix=PROMOTE --check-prefix=ASM
-// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Wno-frame-larger-than 2> %t.err
+// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Wno-frame-larger-than= 2> %t.err
 // RUN: FileCheck < %t.err %s --check-prefix=IGNORE --check-prefix=ASM
 //
-// Currently the stack size reporting cannot be checked with -verify because
-//  no source location is attached to the diagnostic. Therefore do not emit
-// them for the -verify test for now.
 // RUN: %clang_cc1 %s -S -o - -triple=i386-apple-darwin -verify -no-integrated-as
 
 extern void doIt(char *);
 
-// REGULAR: warning: stack size exceeded ({{[0-9]+}}) in stackSizeWarning
-// PROMOTE: error: stack size exceeded ({{[0-9]+}}) in stackSizeWarning
-// IGNORE-NOT: stack size exceeded ({{[0-9]+}}) in stackSizeWarning
+// REGULAR: warning: stack frame size of {{[0-9]+}} bytes in function 'stackSizeWarning'
+// PROMOTE: error: stack frame size of {{[0-9]+}} bytes in function 'stackSizeWarning'
+// IGNORE-NOT: stack frame size of {{[0-9]+}} bytes in function 'stackSizeWarning'
 void stackSizeWarning() {
   char buffer[80];
   doIt(buffer);
diff --git a/test/Frontend/disable-output.c b/test/Frontend/disable-output.c
new file mode 100644
index 0000000..786ac77
--- /dev/null
+++ b/test/Frontend/disable-output.c
@@ -0,0 +1,7 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 %s -emit-llvm-only -triple=i386-apple-darwin -o %t
+// RUN: not rm %t
+// RUN: %clang_cc1 %s -emit-codegen-only -triple=i386-apple-darwin -o %t
+// RUN: not rm %t
+
+// Test that output is not generated when emission is disabled.
diff --git a/test/Frontend/exceptions.c b/test/Frontend/exceptions.c
new file mode 100644
index 0000000..4bbaaa3
--- /dev/null
+++ b/test/Frontend/exceptions.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -verify %s
+// expected-no-diagnostics
+
+#if defined(__EXCEPTIONS)
+#error __EXCEPTIONS should not be defined.
+#endif
diff --git a/test/Frontend/ir-support.c b/test/Frontend/ir-support.c
new file mode 100644
index 0000000..f69161e
--- /dev/null
+++ b/test/Frontend/ir-support.c
@@ -0,0 +1,19 @@
+// Test that we can consume LLVM IR/bitcode in the frontend and produce
+// equivalent output to a standard compilation.
+
+// We strip differing '.file' directives before comparing.
+
+// Reference output:
+// RUN: %clang_cc1 -S -o - %s | grep -v '\.file' > %t.s
+
+// LLVM bitcode:
+// RUN: %clang_cc1 -emit-llvm-bc -o %t.bc %s
+// RUN: %clang_cc1 -S -o - %t.bc | grep -v '\.file' > %t.bc.s
+// RUN: diff %t.s %t.bc.s
+
+// LLVM IR source code:
+// RUN: %clang_cc1 -emit-llvm -o %t.ll %s
+// RUN: %clang_cc1 -S -o - %t.ll | grep -v '\.file' > %t.ll.s
+// RUN: diff %t.s %t.ll.s
+
+int f() { return 0; }
diff --git a/test/Frontend/lit.local.cfg b/test/Frontend/lit.local.cfg
index 4c13598..c11fb6d 100644
--- a/test/Frontend/lit.local.cfg
+++ b/test/Frontend/lit.local.cfg
@@ -1 +1 @@
-config.suffixes = ['.c', '.cpp', '.m', '.mm', '.ll', '.bc']
+config.suffixes = ['.c', '.cpp', '.m', '.mm', '.ll']
diff --git a/test/Frontend/optimization-remark-line-directive.c b/test/Frontend/optimization-remark-line-directive.c
index b4b1b92..f4c0011 100644
--- a/test/Frontend/optimization-remark-line-directive.c
+++ b/test/Frontend/optimization-remark-line-directive.c
@@ -2,14 +2,11 @@
 // directives. We cannot map #line directives back to
 // a SourceLocation.
 
-// RUN: %clang -c %s -Rpass=inline -O0 -S -gmlt -o /dev/null 2> %t.err
-// RUN: FileCheck < %t.err %s --check-prefix=INLINE-INVALID-LOC
-//
+// RUN: %clang_cc1 %s -Rpass=inline -gline-tables-only -dwarf-column-info -emit-llvm-only -verify
+
 int foo(int x, int y) __attribute__((always_inline));
 int foo(int x, int y) { return x + y; }
 
+// expected-remark@+2 {{foo inlined into bar}} expected-note@+2 {{could not determine the original source location for /bad/path/to/original.c:1230:25}}
 #line 1230 "/bad/path/to/original.c"
 int bar(int j) { return foo(j, j - 2); }
-
-// INLINE-INVALID-LOC: {{^remark: foo inlined into bar}}
-// INLINE-INVALID-LOC: note: could not determine the original source location for /bad/path/to/original.c:1230:0
diff --git a/test/Frontend/optimization-remark.c b/test/Frontend/optimization-remark.c
index 3a62db0..e512253 100644
--- a/test/Frontend/optimization-remark.c
+++ b/test/Frontend/optimization-remark.c
@@ -1,18 +1,36 @@
-// This file tests the -Rpass= flag with the inliner. The test is
-// designed to always trigger the inliner, so it should be independent
-// of the optimization level.
+// This file tests the -Rpass family of flags (-Rpass, -Rpass-missed
+// and -Rpass-analysis) with the inliner. The test is designed to
+// always trigger the inliner, so it should be independent of the
+// optimization level.
 
-// RUN: %clang_cc1 %s -Rpass=inline -O0 -gline-tables-only -emit-obj -verify -S -o /dev/null 2> %t.err
+// RUN: %clang_cc1 %s -Rpass=inline -Rpass-analysis=inline -Rpass-missed=inline -O0 -emit-llvm-only -verify
+// RUN: %clang_cc1 %s -Rpass=inline -Rpass-analysis=inline -Rpass-missed=inline -O0 -emit-llvm-only -gline-tables-only -verify
+// RUN: %clang_cc1 %s -Rpass=inline -emit-llvm -o - 2>/dev/null | FileCheck %s
 
-// RUN: %clang -c %s -Rpass=inline -O0 -S -o /dev/null 2> %t.err
-// RUN: FileCheck < %t.err %s --check-prefix=INLINE-NO-LOC
+// -Rpass should produce source location annotations, exclusively (just
+// like -gmlt).
+// CHECK: , !dbg !
+// CHECK-NOT: DW_TAG_base_type
+
+// But llvm.dbg.cu should be missing (to prevent writing debug info to
+// the final output).
+// CHECK-NOT: !llvm.dbg.cu = !{
 
 int foo(int x, int y) __attribute__((always_inline));
-
 int foo(int x, int y) { return x + y; }
 
-// expected-remark@+1 {{foo inlined into bar}}
-int bar(int j) { return foo(j, j - 2); }
+float foz(int x, int y) __attribute__((noinline));
+float foz(int x, int y) { return x * y; }
 
-// INLINE-NO-LOC: {{^remark: foo inlined into bar}}
-// INLINE-NO-LOC: note: use -gline-tables-only -gcolumn-info to track
+// The negative diagnostics are emitted twice because the inliner runs
+// twice.
+//
+int bar(int j) {
+// expected-remark@+6 {{foz should never be inlined (cost=never)}}
+// expected-remark@+5 {{foz will not be inlined into bar}}
+// expected-remark@+4 {{foz should never be inlined}}
+// expected-remark@+3 {{foz will not be inlined into bar}}
+// expected-remark@+2 {{foo should always be inlined}}
+// expected-remark@+1 {{foo inlined into bar}}
+  return foo(j, j - 2) * foz(j - 2, j);
+}
diff --git a/test/Frontend/print-header-includes.c b/test/Frontend/print-header-includes.c
index aa3e397..e248c76 100644
--- a/test/Frontend/print-header-includes.c
+++ b/test/Frontend/print-header-includes.c
@@ -1,12 +1,12 @@
-// RUN: %clang_cc1 -include Inputs/test3.h -E -H -o %t.out %s 2> %t.err
-// RUN: FileCheck < %t.err %s
+// RUN: %clang_cc1 -include Inputs/test3.h -E -H -o %t.out %s 2> %t.stderr
+// RUN: FileCheck < %t.stderr %s
 
 // CHECK-NOT: test3.h
 // CHECK: . {{.*test.h}}
 // CHECK: .. {{.*test2.h}}
 
-// RUN: %clang_cc1 -include Inputs/test3.h -E --show-includes -o %t.out %s 2> %t.err
-// RUN: FileCheck --check-prefix=MS < %t.err %s
+// RUN: %clang_cc1 -include Inputs/test3.h -E --show-includes -o %t.out %s > %t.stdout
+// RUN: FileCheck --check-prefix=MS < %t.stdout %s
 // MS-NOT: test3.h
 // MS: Note: including file: {{.*test.h}}
 // MS: Note: including file:  {{.*test2.h}}
diff --git a/test/Frontend/stdlang.c b/test/Frontend/stdlang.c
new file mode 100644
index 0000000..71997f1
--- /dev/null
+++ b/test/Frontend/stdlang.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -x cuda -std=c++11 -DCUDA %s
+// RUN: %clang_cc1 -x cl -std=c99 -DOPENCL %s
+// expected-no-diagnostics
+
+#if defined(CUDA)
+  __attribute__((device)) void f_device();
+#elif defined(OPENCL)
+  kernel void func(void);
+#endif
diff --git a/test/Frontend/verify.c b/test/Frontend/verify.c
index 4bd0c90..e2e7894 100644
--- a/test/Frontend/verify.c
+++ b/test/Frontend/verify.c
@@ -134,9 +134,18 @@
 // expected-warning@verify-directive.h: {{ }}
 // expected-error@-1 {{missing or invalid line number}}
 
+// expected-warning@verify-directive.h:0 {{ }}
+// expected-error@-1 {{missing or invalid line number}}
+
+// expected-warning@verify-directive.h:0*{{ }}
+// expected-error@-1 {{missing or invalid line number}}
+
+// expected-warning@verify-directive.h:*0{{ }}
+// syntactically ok -- means match in any line for 0 occurrences.
+
 // expected-warning@verify-directive.h:1 {{diagnostic}}
 
 //      CHECK8: error: 'warning' diagnostics expected but not seen:
-// CHECK8-NEXT:   File {{.*}}verify-directive.h Line 1 (directive at {{.*}}verify.c:137): diagnostic
+// CHECK8-NEXT:   File {{.*}}verify-directive.h Line 1 (directive at {{.*}}verify.c:146): diagnostic
 // CHECK8-NEXT: 1 error generated.
 #endif
diff --git a/test/Frontend/verify2.c b/test/Frontend/verify2.c
index 73eda4d..075a2ab 100644
--- a/test/Frontend/verify2.c
+++ b/test/Frontend/verify2.c
@@ -14,7 +14,26 @@
 
 //      CHECK: error: no expected directives found: consider use of 'expected-no-diagnostics'
 // CHECK-NEXT: error: 'error' diagnostics seen but not expected:
-// CHECK-NEXT:   Line 1: header
+// CHECK-NEXT:   Line 5: header
 // CHECK-NEXT:   Line 10: source
 // CHECK-NEXT: 3 errors generated.
 #endif
+
+#ifdef CHECK2
+// RUN: not %clang_cc1 -DCHECK2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
+
+// The following checks that -verify can match "any line" in an included file.
+// The location of the diagnostic need therefore only match in the file, not to
+// a specific line number.  This is useful where -verify is used as a testing
+// tool for 3rd-party libraries where headers may change and the specific line
+// number of a diagnostic in a header is not important.
+
+// expected-error@verify2.h:* {{header}}
+// expected-error@verify2.h:* {{unknown}}
+
+//      CHECK2: error: 'error' diagnostics expected but not seen:
+// CHECK2-NEXT:   File {{.*}}verify2.h Line * (directive at {{.*}}verify2.c:32): unknown
+// CHECK2-NEXT: error: 'error' diagnostics seen but not expected:
+// CHECK2-NEXT:   File {{.*}}verify2.c Line 10: source
+// CHECK2-NEXT: 2 errors generated.
+#endif
diff --git a/test/Frontend/verify2.h b/test/Frontend/verify2.h
index 8acbf6e..a426722 100644
--- a/test/Frontend/verify2.h
+++ b/test/Frontend/verify2.h
@@ -1,5 +1,5 @@
-#error header
-
 #if 0
 // expected-error {{should be ignored}}
 #endif
+
+#error header