Remove the -cxx-abi command-line flag.

This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples,
Itanium otherwise. It's no longer possible to do weird combinations.

To be able to run a test with a specific ABI without constraining it to a
specific triple, new substitutions are added to lit: %itanium_abi_triple and
%ms_abi_triple can be used to get the current target triple adjusted to the
desired ABI. For example, if the test suite is running with the i686-pc-win32
target, %itanium_abi_triple will expand to i686-pc-mingw32.

Differential Revision: http://llvm-reviews.chandlerc.com/D2545

llvm-svn: 199250
diff --git a/clang/include/clang/Basic/TargetOptions.h b/clang/include/clang/Basic/TargetOptions.h
index 9909182..d8a10a5 100644
--- a/clang/include/clang/Basic/TargetOptions.h
+++ b/clang/include/clang/Basic/TargetOptions.h
@@ -38,10 +38,6 @@
   /// If given, the name of the target ABI to use.
   std::string ABI;
 
-  /// If given, the name of the target C++ ABI to use. If not given, defaults
-  /// to "itanium".
-  std::string CXXABI;
-
   /// If given, the version string of the linker in use.
   std::string LinkerVersion;
 
diff --git a/clang/include/clang/Driver/CC1Options.td b/clang/include/clang/Driver/CC1Options.td
index 85cfdcf..97511e5 100644
--- a/clang/include/clang/Driver/CC1Options.td
+++ b/clang/include/clang/Driver/CC1Options.td
@@ -17,8 +17,6 @@
 // Target Options
 //===----------------------------------------------------------------------===//
 
-def cxx_abi : Separate<["-"], "cxx-abi">,
-  HelpText<"Target a particular C++ ABI type">;
 def target_abi : Separate<["-"], "target-abi">,
   HelpText<"Target a particular ABI type">;
 def target_cpu : Separate<["-"], "target-cpu">,
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp
index 7ee2706..e661c66 100644
--- a/clang/lib/Basic/TargetInfo.cpp
+++ b/clang/lib/Basic/TargetInfo.cpp
@@ -82,8 +82,10 @@
   // Default to not using fp2ret for __Complex long double
   ComplexLongDoubleUsesFP2Ret = false;
 
-  // Default to using the Itanium ABI.
-  TheCXXABI.set(TargetCXXABI::GenericItanium);
+  // Set the C++ ABI based on the triple.
+  TheCXXABI.set(Triple.getOS() == llvm::Triple::Win32
+                    ? TargetCXXABI::Microsoft
+                    : TargetCXXABI::GenericItanium);
 
   // Default to an empty address space map.
   AddrSpaceMap = &DefaultAddrSpaceMap;
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 591243e..9ce333d 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -5841,12 +5841,6 @@
     return 0;
   }
 
-  // Set the target C++ ABI.
-  if (!Opts->CXXABI.empty() && !Target->setCXXABI(Opts->CXXABI)) {
-    Diags.Report(diag::err_target_unknown_cxxabi) << Opts->CXXABI;
-    return 0;
-  }
-
   // Set the fp math unit.
   if (!Opts->FPMath.empty() && !Target->setFPMath(Opts->FPMath)) {
     Diags.Report(diag::err_target_unknown_fpmath) << Opts->FPMath;
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 492b2ce..9b5b89f 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -3933,10 +3933,6 @@
   // implemented in clang.
   CmdArgs.push_back("--dependent-lib=oldnames");
 
-  // FIXME: Make this default for the win32 triple.
-  CmdArgs.push_back("-cxx-abi");
-  CmdArgs.push_back("microsoft");
-
   if (Arg *A = Args.getLastArg(options::OPT_show_includes))
     A->render(Args, CmdArgs);
 
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index fd11ecf..bb20ae7 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1617,7 +1617,6 @@
 static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args) {
   using namespace options;
   Opts.ABI = Args.getLastArgValue(OPT_target_abi);
-  Opts.CXXABI = Args.getLastArgValue(OPT_cxx_abi);
   Opts.CPU = Args.getLastArgValue(OPT_target_cpu);
   Opts.FPMath = Args.getLastArgValue(OPT_mfpmath);
   Opts.FeaturesAsWritten = Args.getAllArgValues(OPT_target_feature);
@@ -1627,11 +1626,6 @@
   // Use the default target triple if unspecified.
   if (Opts.Triple.empty())
     Opts.Triple = llvm::sys::getDefaultTargetTriple();
-
-  // Use the MS ABI for Win32 targets unless otherwise specified.
-  if (Opts.CXXABI.empty() &&
-      llvm::Triple(Opts.Triple).getOS() == llvm::Triple::Win32)
-    Opts.CXXABI = "microsoft";
 }
 
 bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
@@ -1767,8 +1761,7 @@
   
   // Extend the signature with the target options.
   code = hash_combine(code, TargetOpts->Triple, TargetOpts->CPU,
-                      TargetOpts->ABI, TargetOpts->CXXABI,
-                      TargetOpts->LinkerVersion);
+                      TargetOpts->ABI, TargetOpts->LinkerVersion);
   for (unsigned i = 0, n = TargetOpts->FeaturesAsWritten.size(); i != n; ++i)
     code = hash_combine(code, TargetOpts->FeaturesAsWritten[i]);
 
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index e0c68c8..0d78bf0 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -363,7 +363,6 @@
       Out.indent(4) << "  Triple: " << TargetOpts.Triple << "\n";
       Out.indent(4) << "  CPU: " << TargetOpts.CPU << "\n";
       Out.indent(4) << "  ABI: " << TargetOpts.ABI << "\n";
-      Out.indent(4) << "  C++ ABI: " << TargetOpts.CXXABI << "\n";
       Out.indent(4) << "  Linker version: " << TargetOpts.LinkerVersion << "\n";
 
       if (!TargetOpts.FeaturesAsWritten.empty()) {
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 400619f..26281cc 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -140,7 +140,6 @@
   CHECK_TARGET_OPT(Triple, "target");
   CHECK_TARGET_OPT(CPU, "target CPU");
   CHECK_TARGET_OPT(ABI, "target ABI");
-  CHECK_TARGET_OPT(CXXABI, "target C++ ABI");
   CHECK_TARGET_OPT(LinkerVersion, "target linker version");
 #undef CHECK_TARGET_OPT
 
@@ -4009,7 +4008,6 @@
   TargetOpts.Triple = ReadString(Record, Idx);
   TargetOpts.CPU = ReadString(Record, Idx);
   TargetOpts.ABI = ReadString(Record, Idx);
-  TargetOpts.CXXABI = ReadString(Record, Idx);
   TargetOpts.LinkerVersion = ReadString(Record, Idx);
   for (unsigned N = Record[Idx++]; N; --N) {
     TargetOpts.FeaturesAsWritten.push_back(ReadString(Record, Idx));
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index ac579f7..b9d7ca8 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -1103,7 +1103,6 @@
   AddString(TargetOpts.Triple, Record);
   AddString(TargetOpts.CPU, Record);
   AddString(TargetOpts.ABI, Record);
-  AddString(TargetOpts.CXXABI, Record);
   AddString(TargetOpts.LinkerVersion, Record);
   Record.push_back(TargetOpts.FeaturesAsWritten.size());
   for (unsigned I = 0, N = TargetOpts.FeaturesAsWritten.size(); I != N; ++I) {
diff --git a/clang/test/CXX/dcl.dcl/dcl.link/p7.cpp b/clang/test/CXX/dcl.dcl/dcl.link/p7.cpp
index bc0eb17..7d80a22 100644
--- a/clang/test/CXX/dcl.dcl/dcl.link/p7.cpp
+++ b/clang/test/CXX/dcl.dcl/dcl.link/p7.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 struct X { };
 
diff --git a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp
index f6bdb42..eeb5b6f 100644
--- a/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp
+++ b/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -emit-llvm -cxx-abi itanium %s -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm -triple %itanium_abi_triple %s -o - | FileCheck %s
 
 // constexpr functions and constexpr constructors are implicitly inline.
 struct S {
diff --git a/clang/test/CXX/drs/dr2xx.cpp b/clang/test/CXX/drs/dr2xx.cpp
index 28d4953..e038e82 100644
--- a/clang/test/CXX/drs/dr2xx.cpp
+++ b/clang/test/CXX/drs/dr2xx.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -cxx-abi itanium
-// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -cxx-abi itanium
-// RUN: %clang_cc1 -std=c++1y %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -cxx-abi itanium
+// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++1y %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 
-// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -cxx-abi microsoft -DMSABI
-// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -cxx-abi microsoft -DMSABI
-// RUN: %clang_cc1 -std=c++1y %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -cxx-abi microsoft -DMSABI
+// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %ms_abi_triple -DMSABI
+// RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %ms_abi_triple -DMSABI
+// RUN: %clang_cc1 -std=c++1y %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %ms_abi_triple -DMSABI
 
 // PR13819 -- __SIZE_TYPE__ is incompatible.
 typedef __SIZE_TYPE__ size_t; // expected-error 0-1 {{extension}}
diff --git a/clang/test/CXX/special/class.copy/implicit-move-def.cpp b/clang/test/CXX/special/class.copy/implicit-move-def.cpp
index e2550ae..880268d 100644
--- a/clang/test/CXX/special/class.copy/implicit-move-def.cpp
+++ b/clang/test/CXX/special/class.copy/implicit-move-def.cpp
@@ -1,6 +1,6 @@
-// FIXME: %clang_cc1 -emit-llvm -cxx-abi itanium -o - -std=c++11 %s | FileCheck -check-prefix=CHECK %s
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-ASSIGN %s
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-CTOR %s
+// FIXME: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - -std=c++11 %s | FileCheck -check-prefix=CHECK %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-ASSIGN %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-CTOR %s
 
 // construct
 
diff --git a/clang/test/CXX/special/class.dtor/p3-0x.cpp b/clang/test/CXX/special/class.dtor/p3-0x.cpp
index bb1f907..2d7eba4 100644
--- a/clang/test/CXX/special/class.dtor/p3-0x.cpp
+++ b/clang/test/CXX/special/class.dtor/p3-0x.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s
 
 struct A {
   ~A();
diff --git a/clang/test/CXX/special/class.dtor/p9.cpp b/clang/test/CXX/special/class.dtor/p9.cpp
index 6b28ebf..1c70fd4 100644
--- a/clang/test/CXX/special/class.dtor/p9.cpp
+++ b/clang/test/CXX/special/class.dtor/p9.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -cxx-abi itanium -verify %s
-// RUN: %clang_cc1 -fsyntax-only -cxx-abi microsoft -DMSABI -verify %s
+// RUN: %clang_cc1 -fsyntax-only -triple %itanium_abi_triple -verify %s
+// RUN: %clang_cc1 -fsyntax-only -triple %ms_abi_triple -DMSABI -verify %s
 
 typedef typeof(sizeof(int)) size_t;
 
diff --git a/clang/test/CodeGen/builtin-ms-noop.cpp b/clang/test/CodeGen/builtin-ms-noop.cpp
index b0987cc..b579e2d 100644
--- a/clang/test/CodeGen/builtin-ms-noop.cpp
+++ b/clang/test/CodeGen/builtin-ms-noop.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fms-extensions -triple i686-pc-win32 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fms-extensions -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
 
 class A {
  public:
diff --git a/clang/test/CodeGen/captured-statements.c b/clang/test/CodeGen/captured-statements.c
index 8c86478..b52d115 100644
--- a/clang/test/CodeGen/captured-statements.c
+++ b/clang/test/CodeGen/captured-statements.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o %t
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o %t
 // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-GLOBALS
 // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-1
 // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-2
diff --git a/clang/test/CodeGen/cxx-default-arg.cpp b/clang/test/CodeGen/cxx-default-arg.cpp
index 72cba94..7688e79 100644
--- a/clang/test/CodeGen/cxx-default-arg.cpp
+++ b/clang/test/CodeGen/cxx-default-arg.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o %t
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o %t
 
 // Note-LABEL: define CLANG_GENERATE_KNOWN_GOOD and compile to generate code
 // that makes all of the defaulted arguments explicit. The resulting
diff --git a/clang/test/CodeGen/fp-contract-pragma.cpp b/clang/test/CodeGen/fp-contract-pragma.cpp
index 37629af..b4e24b9 100644
--- a/clang/test/CodeGen/fp-contract-pragma.cpp
+++ b/clang/test/CodeGen/fp-contract-pragma.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -O3 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -O3 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 // Is FP_CONTRACT is honored in a simple case?
 float fp_contract_1(float a, float b, float c) {
diff --git a/clang/test/CodeGen/mangle-windows.c b/clang/test/CodeGen/mangle-windows.c
index 6706492..37d1018 100644
--- a/clang/test/CodeGen/mangle-windows.c
+++ b/clang/test/CodeGen/mangle-windows.c
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft \
-// RUN:     -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-mingw32 | FileCheck %s
 
 void __stdcall f1(void) {}
diff --git a/clang/test/CodeGen/overloadable.c b/clang/test/CodeGen/overloadable.c
index ca6abf3..8b40e4d 100644
--- a/clang/test/CodeGen/overloadable.c
+++ b/clang/test/CodeGen/overloadable.c
@@ -1,4 +1,6 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | grep _Z1fPA10_1X
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
+// CHECK: _Z1fPA10_1X
+
 int __attribute__((overloadable)) f(int x) { return x; }
 float __attribute__((overloadable)) f(float x) { return x; }
 double __attribute__((overloadable)) f(double x) { return x; }
diff --git a/clang/test/CodeGen/tbaa-for-vptr.cpp b/clang/test/CodeGen/tbaa-for-vptr.cpp
index ebd5825..2fe9767 100644
--- a/clang/test/CodeGen/tbaa-for-vptr.cpp
+++ b/clang/test/CodeGen/tbaa-for-vptr.cpp
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - -fsanitize=thread %s | FileCheck %s
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - -O1 %s | FileCheck %s
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - -O1  -relaxed-aliasing -fsanitize=thread %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -fsanitize=thread %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -O1 %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -O1  -relaxed-aliasing -fsanitize=thread %s | FileCheck %s
 //
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s --check-prefix=NOTBAA
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - -O2  -relaxed-aliasing %s | FileCheck %s --check-prefix=NOTBAA
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s --check-prefix=NOTBAA
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - -O2  -relaxed-aliasing %s | FileCheck %s --check-prefix=NOTBAA
 //
 // Check that we generate TBAA for vtable pointer loads and stores.
 // When -fthread-sanitizer is used TBAA should be generated at all opt levels
diff --git a/clang/test/CodeGen/tbaa-ms-abi.cpp b/clang/test/CodeGen/tbaa-ms-abi.cpp
index 9908ac0..2a9e47e 100644
--- a/clang/test/CodeGen/tbaa-ms-abi.cpp
+++ b/clang/test/CodeGen/tbaa-ms-abi.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi microsoft -triple i686-pc-win32 -disable-llvm-optzns -emit-llvm -o - -O1 %s | FileCheck %s
+// RUN: %clang_cc1 -triple i686-pc-win32 -disable-llvm-optzns -emit-llvm -o - -O1 %s | FileCheck %s
 //
 // Test that TBAA works in the Microsoft C++ ABI.  We used to error out while
 // attempting to mangle RTTI.
diff --git a/clang/test/CodeGenCUDA/filter-decl.cu b/clang/test/CodeGenCUDA/filter-decl.cu
index dda3848..008eaae 100644
--- a/clang/test/CodeGenCUDA/filter-decl.cu
+++ b/clang/test/CodeGenCUDA/filter-decl.cu
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-HOST %s
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - -fcuda-is-device | FileCheck -check-prefix=CHECK-DEVICE %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-HOST %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - -fcuda-is-device | FileCheck -check-prefix=CHECK-DEVICE %s
 
 #include "../SemaCUDA/cuda.h"
 
diff --git a/clang/test/CodeGenCXX/2003-11-27-MultipleInheritanceThunk.cpp b/clang/test/CodeGenCXX/2003-11-27-MultipleInheritanceThunk.cpp
index f9c6566..a70f6e0 100644
--- a/clang/test/CodeGenCXX/2003-11-27-MultipleInheritanceThunk.cpp
+++ b/clang/test/CodeGenCXX/2003-11-27-MultipleInheritanceThunk.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o -
-// RUN: %clang_cc1 -cxx-abi microsoft -fno-rtti -emit-llvm %s -o -
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o -
+// RUN: %clang_cc1 -triple %ms_abi_triple -fno-rtti -emit-llvm %s -o -
 
 
 struct CallSite {
diff --git a/clang/test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp b/clang/test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp
index e9071b1..e7e34f1 100644
--- a/clang/test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp
+++ b/clang/test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o -
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o -
 
 // FIXME: Don't assert for non-Win32 triples (PR18251).
-// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi microsoft -fno-rtti -emit-llvm %s -o -
+// RUN: %clang_cc1 -triple i686-pc-win32 -fno-rtti -emit-llvm %s -o -
 
 struct A {
   virtual void Method() = 0;
diff --git a/clang/test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp b/clang/test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp
index 0f82091..03c4ed6 100644
--- a/clang/test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp
+++ b/clang/test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
 
 // CHECK: _ZN11AccessFlags6strlenEv
 struct AccessFlags {
diff --git a/clang/test/CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp b/clang/test/CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp
index 59af8f4..c5a2d5a 100644
--- a/clang/test/CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp
+++ b/clang/test/CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s
-// RUN: %clang_cc1 -cxx-abi microsoft -fno-rtti -emit-llvm -o - %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s
+// RUN: %clang_cc1 -triple %ms_abi_triple -fno-rtti -emit-llvm -o - %s
 
 struct A {
    virtual ~A();
diff --git a/clang/test/CodeGenCXX/2010-05-11-alwaysinlineinstantiation.cpp b/clang/test/CodeGenCXX/2010-05-11-alwaysinlineinstantiation.cpp
index 92d2e3e..bf00c0f 100644
--- a/clang/test/CodeGenCXX/2010-05-11-alwaysinlineinstantiation.cpp
+++ b/clang/test/CodeGenCXX/2010-05-11-alwaysinlineinstantiation.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - | FileCheck %s
 
 // CHECK-NOT: ZN12basic_stringIcEC1Ev
 // CHECK: ZN12basic_stringIcED1Ev
diff --git a/clang/test/CodeGenCXX/PR5093-static-member-function.cpp b/clang/test/CodeGenCXX/PR5093-static-member-function.cpp
index 8639a84..d61a87a 100644
--- a/clang/test/CodeGenCXX/PR5093-static-member-function.cpp
+++ b/clang/test/CodeGenCXX/PR5093-static-member-function.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 struct a {
   static void f();
 };
diff --git a/clang/test/CodeGenCXX/PR5863-unreachable-block.cpp b/clang/test/CodeGenCXX/PR5863-unreachable-block.cpp
index c4d7471..50d1731 100644
--- a/clang/test/CodeGenCXX/PR5863-unreachable-block.cpp
+++ b/clang/test/CodeGenCXX/PR5863-unreachable-block.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -fcxx-exceptions -fexceptions -emit-llvm-only %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -emit-llvm-only %s
 
 // PR5863
 class E { };
diff --git a/clang/test/CodeGenCXX/address-of-fntemplate.cpp b/clang/test/CodeGenCXX/address-of-fntemplate.cpp
index e6a355a..4ff597a 100644
--- a/clang/test/CodeGenCXX/address-of-fntemplate.cpp
+++ b/clang/test/CodeGenCXX/address-of-fntemplate.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 template <typename T> void f(T) {}
 template <typename T> void f() { }
 
diff --git a/clang/test/CodeGenCXX/attr-cleanup.cpp b/clang/test/CodeGenCXX/attr-cleanup.cpp
index fe1167b..18a7798 100644
--- a/clang/test/CodeGenCXX/attr-cleanup.cpp
+++ b/clang/test/CodeGenCXX/attr-cleanup.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
 
 namespace N {
   void free(void *i) {}
diff --git a/clang/test/CodeGenCXX/attr-used.cpp b/clang/test/CodeGenCXX/attr-used.cpp
index 0852511..86dd6b9 100644
--- a/clang/test/CodeGenCXX/attr-used.cpp
+++ b/clang/test/CodeGenCXX/attr-used.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
 
 // <rdar://problem/8684363>: clang++ not respecting __attribute__((used)) on destructors
 struct X0 {
diff --git a/clang/test/CodeGenCXX/block-byref-cxx-objc.cpp b/clang/test/CodeGenCXX/block-byref-cxx-objc.cpp
index 2d9243e..5c35ad7 100644
--- a/clang/test/CodeGenCXX/block-byref-cxx-objc.cpp
+++ b/clang/test/CodeGenCXX/block-byref-cxx-objc.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - -fblocks | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - -fblocks | FileCheck %s
 // rdar://8594790
 
 struct A {
diff --git a/clang/test/CodeGenCXX/block.cpp b/clang/test/CodeGenCXX/block.cpp
index 93e22dc..aa35668 100644
--- a/clang/test/CodeGenCXX/block.cpp
+++ b/clang/test/CodeGenCXX/block.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - -fblocks 
-// RUN: %clang_cc1 %s -cxx-abi microsoft -fno-rtti -emit-llvm -o - -fblocks 
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - -fblocks 
+// RUN: %clang_cc1 %s -triple %ms_abi_triple -fno-rtti -emit-llvm -o - -fblocks 
 // Just test that this doesn't crash the compiler...
 
 void func(void*);
diff --git a/clang/test/CodeGenCXX/c-linkage.cpp b/clang/test/CodeGenCXX/c-linkage.cpp
index 469652c..2f8729e 100644
--- a/clang/test/CodeGenCXX/c-linkage.cpp
+++ b/clang/test/CodeGenCXX/c-linkage.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
 // pr6644
 
 extern "C" {
diff --git a/clang/test/CodeGenCXX/captured-statements.cpp b/clang/test/CodeGenCXX/captured-statements.cpp
index 8dc9b3d..fb35446 100644
--- a/clang/test/CodeGenCXX/captured-statements.cpp
+++ b/clang/test/CodeGenCXX/captured-statements.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -emit-llvm %s -o %t
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -emit-llvm %s -o %t
 // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-1
 // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-2
 // RUN: FileCheck %s -input-file=%t -check-prefix=CHECK-3
diff --git a/clang/test/CodeGenCXX/const-base-cast.cpp b/clang/test/CodeGenCXX/const-base-cast.cpp
index fa85615..dd980d5 100644
--- a/clang/test/CodeGenCXX/const-base-cast.cpp
+++ b/clang/test/CodeGenCXX/const-base-cast.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
 
 // Check that the following construct, which is similar to one which occurs
 // in Firefox, is folded correctly.
diff --git a/clang/test/CodeGenCXX/const-global-linkage.cpp b/clang/test/CodeGenCXX/const-global-linkage.cpp
index 789ea71..e1e9321 100644
--- a/clang/test/CodeGenCXX/const-global-linkage.cpp
+++ b/clang/test/CodeGenCXX/const-global-linkage.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 const int x = 10;
 const int y = 20;
diff --git a/clang/test/CodeGenCXX/constructor-attr.cpp b/clang/test/CodeGenCXX/constructor-attr.cpp
index 77fc7c8..468ce36 100644
--- a/clang/test/CodeGenCXX/constructor-attr.cpp
+++ b/clang/test/CodeGenCXX/constructor-attr.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 // CHECK: @llvm.global_ctors
 
diff --git a/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp b/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp
index e395620..d93a0d1 100644
--- a/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp
+++ b/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp
@@ -1,6 +1,6 @@
 //RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-unknown-linux | FileCheck --check-prefix=CHECKGEN %s
 //RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv7-apple-ios3.0 -target-abi apcs-gnu | FileCheck --check-prefix=CHECKARM %s
-//RUN: %clang_cc1 %s -emit-llvm -o - -triple=i386-pc-win32 -cxx-abi microsoft -fno-rtti | FileCheck --check-prefix=CHECKMS %s
+//RUN: %clang_cc1 %s -emit-llvm -o - -triple=i386-pc-win32 -fno-rtti | FileCheck --check-prefix=CHECKMS %s
 // FIXME: these tests crash on the bots when run with -triple=x86_64-pc-win32
 
 // Make sure we attach the 'returned' attribute to the 'this' parameter of
diff --git a/clang/test/CodeGenCXX/constructor-init-reference.cpp b/clang/test/CodeGenCXX/constructor-init-reference.cpp
index e16cbb3..61f426d 100644
--- a/clang/test/CodeGenCXX/constructor-init-reference.cpp
+++ b/clang/test/CodeGenCXX/constructor-init-reference.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 int x;
 struct A {
diff --git a/clang/test/CodeGenCXX/copy-assign-synthesis-2.cpp b/clang/test/CodeGenCXX/copy-assign-synthesis-2.cpp
index e0bd5ef..0bc7d3d 100644
--- a/clang/test/CodeGenCXX/copy-assign-synthesis-2.cpp
+++ b/clang/test/CodeGenCXX/copy-assign-synthesis-2.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
 struct A {};
 A& (A::*x)(const A&) = &A::operator=;
 // CHECK-LABEL: define linkonce_odr {{.*}}%struct.A* @_ZN1AaSERKS_
diff --git a/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp b/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp
index e73a7f1..47c34ca 100644
--- a/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp
+++ b/clang/test/CodeGenCXX/copy-constructor-synthesis-2.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 struct A { virtual void a(); };
 A x(A& y) { return y; }
diff --git a/clang/test/CodeGenCXX/coverage.cpp b/clang/test/CodeGenCXX/coverage.cpp
index b00f25b..88f7409 100644
--- a/clang/test/CodeGenCXX/coverage.cpp
+++ b/clang/test/CodeGenCXX/coverage.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - -test-coverage -femit-coverage-notes | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - -test-coverage -femit-coverage-notes | FileCheck %s
 
 extern "C" void test_name1() {}
 void test_name2() {}
diff --git a/clang/test/CodeGenCXX/cxx0x-defaulted-templates.cpp b/clang/test/CodeGenCXX/cxx0x-defaulted-templates.cpp
index e906b24..6f4c533 100644
--- a/clang/test/CodeGenCXX/cxx0x-defaulted-templates.cpp
+++ b/clang/test/CodeGenCXX/cxx0x-defaulted-templates.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 template <typename T>
 struct X {
diff --git a/clang/test/CodeGenCXX/cxx11-noreturn.cpp b/clang/test/CodeGenCXX/cxx11-noreturn.cpp
index 527a8ae..b876bb9 100644
--- a/clang/test/CodeGenCXX/cxx11-noreturn.cpp
+++ b/clang/test/CodeGenCXX/cxx11-noreturn.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -std=c++11 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 %s -o - | FileCheck %s
 
 int g();
 
diff --git a/clang/test/CodeGenCXX/cxx11-unrestricted-union.cpp b/clang/test/CodeGenCXX/cxx11-unrestricted-union.cpp
index 165d286..2f22ad2 100644
--- a/clang/test/CodeGenCXX/cxx11-unrestricted-union.cpp
+++ b/clang/test/CodeGenCXX/cxx11-unrestricted-union.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -std=c++11 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -emit-llvm %s -o - | FileCheck %s
 
 struct A {
   A(); A(const A&); A(A&&); A &operator=(const A&); A &operator=(A&&); ~A();
diff --git a/clang/test/CodeGenCXX/debug-info-char16.cpp b/clang/test/CodeGenCXX/debug-info-char16.cpp
index 78da4c8..e6e2f15 100644
--- a/clang/test/CodeGenCXX/debug-info-char16.cpp
+++ b/clang/test/CodeGenCXX/debug-info-char16.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -std=c++11 -g %s -o -| FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -g %s -o -| FileCheck %s
 
 // 16 is DW_ATE_UTF (0x10) encoding attribute.
 char16_t char_a = u'h';
diff --git a/clang/test/CodeGenCXX/debug-info-enum.cpp b/clang/test/CodeGenCXX/debug-info-enum.cpp
index f1beb8d..7e02ede 100644
--- a/clang/test/CodeGenCXX/debug-info-enum.cpp
+++ b/clang/test/CodeGenCXX/debug-info-enum.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -g %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -g %s -o - | FileCheck %s
 
 // CHECK: [[ENUMS:![0-9]*]], {{[^,]*}}, {{[^,]*}}, {{[^,]*}}, {{[^,]*}}, {{[^,]*}}} ; [ DW_TAG_compile_unit ]
 // CHECK: [[ENUMS]] = metadata !{metadata [[E1:![0-9]*]], metadata [[E2:![0-9]*]], metadata [[E3:![0-9]*]]}
diff --git a/clang/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp b/clang/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp
index a4ef046..28b1fab 100644
--- a/clang/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp
+++ b/clang/test/CodeGenCXX/debug-info-global-ctor-dtor.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 %s -g -cxx-abi itanium -fno-use-cxa-atexit -S -emit-llvm -o - \
+// RUN: %clang_cc1 %s -g -triple %itanium_abi_triple -fno-use-cxa-atexit -S -emit-llvm -o - \
 // RUN:     | FileCheck %s --check-prefix=CHECK-NOKEXT
-// RUN: %clang_cc1 %s -g -cxx-abi itanium -fno-use-cxa-atexit -fapple-kext -S -emit-llvm -o - \
+// RUN: %clang_cc1 %s -g -triple %itanium_abi_triple -fno-use-cxa-atexit -fapple-kext -S -emit-llvm -o - \
 // RUN:     | FileCheck %s --check-prefix=CHECK-KEXT
 
 class A {
diff --git a/clang/test/CodeGenCXX/debug-info-method.cpp b/clang/test/CodeGenCXX/debug-info-method.cpp
index 00e9575..49b8dc4 100644
--- a/clang/test/CodeGenCXX/debug-info-method.cpp
+++ b/clang/test/CodeGenCXX/debug-info-method.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -std=c++11 -g %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -std=c++11 -g %s -o - | FileCheck %s
 // CHECK: metadata !"_ZTS1A"} ; [ DW_TAG_class_type ] [A]
 // CHECK: metadata !"_ZN1A3fooEiS_3$_0", {{.*}} [protected]
 // CHECK: ![[THISTYPE:[0-9]+]] = {{.*}} ; [ DW_TAG_pointer_type ] {{.*}} [artificial] [from _ZTS1A]
diff --git a/clang/test/CodeGenCXX/debug-info-same-line.cpp b/clang/test/CodeGenCXX/debug-info-same-line.cpp
index e1511f3..05b426e 100644
--- a/clang/test/CodeGenCXX/debug-info-same-line.cpp
+++ b/clang/test/CodeGenCXX/debug-info-same-line.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -g -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -g -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 // Make sure that clang outputs distinct debug info for a function
 // that is inlined twice on the same line. Otherwise it would appear
diff --git a/clang/test/CodeGenCXX/debug-info-template-limit.cpp b/clang/test/CodeGenCXX/debug-info-template-limit.cpp
index 6b15857..e1f23ad 100644
--- a/clang/test/CodeGenCXX/debug-info-template-limit.cpp
+++ b/clang/test/CodeGenCXX/debug-info-template-limit.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -fno-standalone-debug -cxx-abi itanium -g %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -fno-standalone-debug -triple %itanium_abi_triple -g %s -o - | FileCheck %s
 
 // Check that this pointer type is TC<int>
 // CHECK: ![[LINE:[0-9]+]] = {{.*}}"TC<int>", {{.*}} metadata !"_ZTS2TCIiE"} ; [ DW_TAG_class_type ]
diff --git a/clang/test/CodeGenCXX/debug-info-thunk.cpp b/clang/test/CodeGenCXX/debug-info-thunk.cpp
index e67e237..1d6f1a7 100644
--- a/clang/test/CodeGenCXX/debug-info-thunk.cpp
+++ b/clang/test/CodeGenCXX/debug-info-thunk.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -g -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -g -S -emit-llvm -o - | FileCheck %s
 
 struct A {
   virtual void f();
diff --git a/clang/test/CodeGenCXX/debug-info-use-after-free.cpp b/clang/test/CodeGenCXX/debug-info-use-after-free.cpp
index 02825a2..0f28a90 100644
--- a/clang/test/CodeGenCXX/debug-info-use-after-free.cpp
+++ b/clang/test/CodeGenCXX/debug-info-use-after-free.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -g -cxx-abi itanium -emit-llvm-only %s
+// RUN: %clang_cc1 -g -triple %itanium_abi_triple -emit-llvm-only %s
 // Check that we don't crash.
 // PR12305, PR12315
 
diff --git a/clang/test/CodeGenCXX/debug-info-uuid.cpp b/clang/test/CodeGenCXX/debug-info-uuid.cpp
index a57e2f0..6137400 100644
--- a/clang/test/CodeGenCXX/debug-info-uuid.cpp
+++ b/clang/test/CodeGenCXX/debug-info-uuid.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -fms-extensions -triple=x86_64-pc-win32 -cxx-abi microsoft -g %s -o - -std=c++11 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -fms-extensions -triple=x86_64-pc-win32 -g %s -o - -std=c++11 | FileCheck %s
 // RUN: not %clang_cc1 -emit-llvm -fms-extensions -triple=x86_64-unknown-unknown -g %s -o - -std=c++11 2>&1 | FileCheck %s --check-prefix=CHECK-ITANIUM
 
 // CHECK: metadata [[TGIARGS:![0-9]*]], null} ; [ DW_TAG_structure_type ] [tmpl_guid<&__uuidof(uuid)>]
diff --git a/clang/test/CodeGenCXX/default-constructor-default-argument.cpp b/clang/test/CodeGenCXX/default-constructor-default-argument.cpp
index aa4f173..17ecc35 100644
--- a/clang/test/CodeGenCXX/default-constructor-default-argument.cpp
+++ b/clang/test/CodeGenCXX/default-constructor-default-argument.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 // Check that call to constructor for struct A is generated correctly.
 struct A { A(int x = 2); };
diff --git a/clang/test/CodeGenCXX/default-constructor-template-member.cpp b/clang/test/CodeGenCXX/default-constructor-template-member.cpp
index 22b5a1e..93df818 100644
--- a/clang/test/CodeGenCXX/default-constructor-template-member.cpp
+++ b/clang/test/CodeGenCXX/default-constructor-template-member.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
 
 template <class T> struct A { A(); };
 struct B { A<int> x; };
diff --git a/clang/test/CodeGenCXX/default-destructor-nested.cpp b/clang/test/CodeGenCXX/default-destructor-nested.cpp
index 2afa9cf..77b06d6 100644
--- a/clang/test/CodeGenCXX/default-destructor-nested.cpp
+++ b/clang/test/CodeGenCXX/default-destructor-nested.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm-only
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm-only
 // PR6294
 
 class A {
diff --git a/clang/test/CodeGenCXX/deferred-global-init.cpp b/clang/test/CodeGenCXX/deferred-global-init.cpp
index 644f4ca..c683ad2 100644
--- a/clang/test/CodeGenCXX/deferred-global-init.cpp
+++ b/clang/test/CodeGenCXX/deferred-global-init.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 // PR5967
 
 extern void* foo;
diff --git a/clang/test/CodeGenCXX/delayed-template-parsing.cpp b/clang/test/CodeGenCXX/delayed-template-parsing.cpp
index fa177d4..c5f4486 100644
--- a/clang/test/CodeGenCXX/delayed-template-parsing.cpp
+++ b/clang/test/CodeGenCXX/delayed-template-parsing.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -fdelayed-template-parsing -triple=i386-pc-win32 | FileCheck %s
-// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -fdelayed-template-parsing -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -fms-extensions -fdelayed-template-parsing -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -fms-extensions -fdelayed-template-parsing -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
 
 namespace ClassScopeSpecialization {
   struct Type {
diff --git a/clang/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp b/clang/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp
index 8df53e4..b7a5554 100644
--- a/clang/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp
+++ b/clang/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 struct A { int i; };
 struct B { char j; };
diff --git a/clang/test/CodeGenCXX/destructor-exception-spec.cpp b/clang/test/CodeGenCXX/destructor-exception-spec.cpp
index aa29d58..50c17ef 100644
--- a/clang/test/CodeGenCXX/destructor-exception-spec.cpp
+++ b/clang/test/CodeGenCXX/destructor-exception-spec.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm-only %s -std=c++11
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm-only -fno-use-cxa-atexit %s -std=c++11
-// RUN: %clang_cc1 -cxx-abi microsoft -fno-rtti -emit-llvm-only %s -std=c++11
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm-only %s -std=c++11
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm-only -fno-use-cxa-atexit %s -std=c++11
+// RUN: %clang_cc1 -triple %ms_abi_triple -fno-rtti -emit-llvm-only %s -std=c++11
 
 // PR13479: don't crash with -fno-exceptions.
 namespace {
diff --git a/clang/test/CodeGenCXX/duplicate-mangled-name.cpp b/clang/test/CodeGenCXX/duplicate-mangled-name.cpp
index b8f0fb0..65bfa22 100644
--- a/clang/test/CodeGenCXX/duplicate-mangled-name.cpp
+++ b/clang/test/CodeGenCXX/duplicate-mangled-name.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm-only %s -verify
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm-only %s -verify
 
 // rdar://15522601
 class MyClass {
diff --git a/clang/test/CodeGenCXX/dynamic_cast-no-rtti.cpp b/clang/test/CodeGenCXX/dynamic_cast-no-rtti.cpp
index 16d746a..cde03a3 100644
--- a/clang/test/CodeGenCXX/dynamic_cast-no-rtti.cpp
+++ b/clang/test/CodeGenCXX/dynamic_cast-no-rtti.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -verify -fno-rtti -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -verify -fno-rtti -triple %itanium_abi_triple -o - | FileCheck %s
 // expected-no-diagnostics
 
 struct A {
diff --git a/clang/test/CodeGenCXX/elide-call-reference.cpp b/clang/test/CodeGenCXX/elide-call-reference.cpp
index c80e8fb..0ce856f 100644
--- a/clang/test/CodeGenCXX/elide-call-reference.cpp
+++ b/clang/test/CodeGenCXX/elide-call-reference.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 // PR5695
 
 struct A { A(const A&); ~A(); };
diff --git a/clang/test/CodeGenCXX/extern-c.cpp b/clang/test/CodeGenCXX/extern-c.cpp
index f3522e8..bca86c6 100644
--- a/clang/test/CodeGenCXX/extern-c.cpp
+++ b/clang/test/CodeGenCXX/extern-c.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
 namespace foo {
 
 // CHECK-NOT: @a = global i32
diff --git a/clang/test/CodeGenCXX/function-template-explicit-specialization.cpp b/clang/test/CodeGenCXX/function-template-explicit-specialization.cpp
index b471917..8ff0655 100644
--- a/clang/test/CodeGenCXX/function-template-explicit-specialization.cpp
+++ b/clang/test/CodeGenCXX/function-template-explicit-specialization.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - | FileCheck %s
 
 template<typename T> void a(T);
 template<> void a(int) {}
diff --git a/clang/test/CodeGenCXX/function-template-specialization.cpp b/clang/test/CodeGenCXX/function-template-specialization.cpp
index 4ee9124..eb099df 100644
--- a/clang/test/CodeGenCXX/function-template-specialization.cpp
+++ b/clang/test/CodeGenCXX/function-template-specialization.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - | FileCheck %s
 template<typename T, typename U>
 T* next(T* ptr, const U& diff);
 
diff --git a/clang/test/CodeGenCXX/global-llvm-constant.cpp b/clang/test/CodeGenCXX/global-llvm-constant.cpp
index 6e202a7..55933ee 100644
--- a/clang/test/CodeGenCXX/global-llvm-constant.cpp
+++ b/clang/test/CodeGenCXX/global-llvm-constant.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
 
 struct A {
   A() { x = 10; }
diff --git a/clang/test/CodeGenCXX/implicit-instantiation-1.cpp b/clang/test/CodeGenCXX/implicit-instantiation-1.cpp
index 8c6f080..c3c49c3 100644
--- a/clang/test/CodeGenCXX/implicit-instantiation-1.cpp
+++ b/clang/test/CodeGenCXX/implicit-instantiation-1.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium %s -o %t
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o %t
 
 template<typename T>
 struct X {
diff --git a/clang/test/CodeGenCXX/instr-profile.cpp b/clang/test/CodeGenCXX/instr-profile.cpp
index 6e33268..da9f6fb 100644
--- a/clang/test/CodeGenCXX/instr-profile.cpp
+++ b/clang/test/CodeGenCXX/instr-profile.cpp
@@ -7,11 +7,11 @@
 // FIXME: Don't seek bb labels, like "if.else"
 // REQUIRES: asserts
 
-// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -Xclang -cxx-abi -Xclang itanium | FileCheck -check-prefix=PGOGEN %s
-// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -Xclang -cxx-abi -Xclang itanium | FileCheck -check-prefix=PGOGEN-EXC %s
+// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -target %itanium_abi_triple | FileCheck -check-prefix=PGOGEN %s
+// RUN: %clangxx %s -o - -emit-llvm -S -fprofile-instr-generate -target %itanium_abi_triple | FileCheck -check-prefix=PGOGEN-EXC %s
 
-// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile.pgodata -Xclang -cxx-abi -Xclang itanium | FileCheck -check-prefix=PGOUSE %s
-// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile.pgodata -Xclang -cxx-abi -Xclang itanium | FileCheck -check-prefix=PGOUSE-EXC %s
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile.pgodata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE %s
+// RUN: %clang %s -o - -emit-llvm -S -fprofile-instr-use=%S/Inputs/instr-profile.pgodata -target %itanium_abi_triple | FileCheck -check-prefix=PGOUSE-EXC %s
 
 // PGOGEN: @[[THC:__llvm_pgo_ctr[0-9]*]] = private global [11 x i64] zeroinitializer
 // PGOGEN-EXC: @[[THC:__llvm_pgo_ctr[0-9]*]] = private global [11 x i64] zeroinitializer
diff --git a/clang/test/CodeGenCXX/instrument-functions.cpp b/clang/test/CodeGenCXX/instrument-functions.cpp
index 664b2dc..587b638 100644
--- a/clang/test/CodeGenCXX/instrument-functions.cpp
+++ b/clang/test/CodeGenCXX/instrument-functions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -S -emit-llvm -cxx-abi itanium -o - %s -finstrument-functions | FileCheck %s
+// RUN: %clang_cc1 -S -emit-llvm -triple %itanium_abi_triple -o - %s -finstrument-functions | FileCheck %s
 
 // CHECK: @_Z5test1i
 int test1(int x) {
diff --git a/clang/test/CodeGenCXX/internal-linkage.cpp b/clang/test/CodeGenCXX/internal-linkage.cpp
index 927e89e..77b1670 100644
--- a/clang/test/CodeGenCXX/internal-linkage.cpp
+++ b/clang/test/CodeGenCXX/internal-linkage.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
 
 struct Global { Global(); };
 template<typename T> struct X { X() {} };
diff --git a/clang/test/CodeGenCXX/mangle-abi-examples.cpp b/clang/test/CodeGenCXX/mangle-abi-examples.cpp
index 4d22f16..6fb82cf 100644
--- a/clang/test/CodeGenCXX/mangle-abi-examples.cpp
+++ b/clang/test/CodeGenCXX/mangle-abi-examples.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 
 // CHECK: @_ZTVZ3foovEN1C1DE =
 // CHECK: @_ZTVZN1A3fooEiE1B =
diff --git a/clang/test/CodeGenCXX/mangle-address-space.cpp b/clang/test/CodeGenCXX/mangle-address-space.cpp
index 466a3b0..a0b3c1a 100644
--- a/clang/test/CodeGenCXX/mangle-address-space.cpp
+++ b/clang/test/CodeGenCXX/mangle-address-space.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
 
 // CHECK-LABEL: define void @_Z2f0Pc
 void f0(char *p) { }
diff --git a/clang/test/CodeGenCXX/mangle-local-class-names.cpp b/clang/test/CodeGenCXX/mangle-local-class-names.cpp
index 2055d0a..848e460 100644
--- a/clang/test/CodeGenCXX/mangle-local-class-names.cpp
+++ b/clang/test/CodeGenCXX/mangle-local-class-names.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 
 // CHECK:  @_ZZ4FUNCvEN4SSSSC1ERKf
 // CHECK: @_ZZ4FUNCvEN4SSSSC2E_0RKf
diff --git a/clang/test/CodeGenCXX/mangle-local-class-vtables.cpp b/clang/test/CodeGenCXX/mangle-local-class-vtables.cpp
index 7ddad5d..078d735 100644
--- a/clang/test/CodeGenCXX/mangle-local-class-vtables.cpp
+++ b/clang/test/CodeGenCXX/mangle-local-class-vtables.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 
 // CHECK: @_ZTVZN1J1KEvE1C = {{.*}} @_ZTIZN1J1KEvE1C {{.*}} @_ZZN1J1KEvENK1C1FEv 
 // CHECK: @_ZTIZN1J1KEvE1C = {{.*}} @_ZTSZN1J1KEvE1C
diff --git a/clang/test/CodeGenCXX/mangle-local-classes-nested.cpp b/clang/test/CodeGenCXX/mangle-local-classes-nested.cpp
index fb30562..cee541f 100644
--- a/clang/test/CodeGenCXX/mangle-local-classes-nested.cpp
+++ b/clang/test/CodeGenCXX/mangle-local-classes-nested.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 
 // CHECK: @_ZTVZZ1HvEN1S1IEvE1S = 
 
diff --git a/clang/test/CodeGenCXX/mangle-ms-abi-examples.cpp b/clang/test/CodeGenCXX/mangle-ms-abi-examples.cpp
index d6726ca..182d00d 100644
--- a/clang/test/CodeGenCXX/mangle-ms-abi-examples.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-abi-examples.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fms-extensions -fno-rtti -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -fms-extensions -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 
 // CHECK: @"\01??_7D@C@?1??foo@@YAXXZ@6B@" =
 // CHECK: @"\01??_7B@?1??foo@A@@QAEXH@Z@6B@" =
diff --git a/clang/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp b/clang/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp
index 50a2383..58f24d5 100644
--- a/clang/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-arg-qualifiers.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 | FileCheck -check-prefix=X64 %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-win32 | FileCheck -check-prefix=X64 %s
 
 void foo(const unsigned int) {}
 // CHECK: "\01?foo@@YAXI@Z"
diff --git a/clang/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp b/clang/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp
index e10cc8e..5d4b672 100644
--- a/clang/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-back-references-pr13207.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 
 template<class X, class Y, class Z>
 class A {};
diff --git a/clang/test/CodeGenCXX/mangle-ms-back-references.cpp b/clang/test/CodeGenCXX/mangle-ms-back-references.cpp
index 4f17326..25a058a3 100644
--- a/clang/test/CodeGenCXX/mangle-ms-back-references.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-back-references.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -fms-extensions -fblocks -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 
 void f1(const char* a, const char* b) {}
 // CHECK: "\01?f1@@YAXPBD0@Z"
diff --git a/clang/test/CodeGenCXX/mangle-ms-cxx11.cpp b/clang/test/CodeGenCXX/mangle-ms-cxx11.cpp
index 6947a53..c3e7370 100644
--- a/clang/test/CodeGenCXX/mangle-ms-cxx11.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-cxx11.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fms-extensions -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 
 // CHECK: "\01?LRef@@YAXAAH@Z"
 void LRef(int& a) { }
diff --git a/clang/test/CodeGenCXX/mangle-ms-return-qualifiers.cpp b/clang/test/CodeGenCXX/mangle-ms-return-qualifiers.cpp
index 87e04c6..f20509f 100644
--- a/clang/test/CodeGenCXX/mangle-ms-return-qualifiers.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-return-qualifiers.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 
 void a1() {}
 // CHECK: "\01?a1@@YAXXZ"
diff --git a/clang/test/CodeGenCXX/mangle-ms-template-callback.cpp b/clang/test/CodeGenCXX/mangle-ms-template-callback.cpp
index 6878148..cfa4e88 100644
--- a/clang/test/CodeGenCXX/mangle-ms-template-callback.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-template-callback.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 
 template<typename Signature>
 class C;
diff --git a/clang/test/CodeGenCXX/mangle-ms-templates.cpp b/clang/test/CodeGenCXX/mangle-ms-templates.cpp
index 514f573..24e4f4a 100644
--- a/clang/test/CodeGenCXX/mangle-ms-templates.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-templates.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -fdelayed-template-parsing -triple=i386-pc-win32 | FileCheck %s
-// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -cxx-abi microsoft -fms-extensions -fdelayed-template-parsing -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -fms-extensions -fdelayed-template-parsing -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -fms-extensions -fdelayed-template-parsing -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
 
 template<typename T>
 class Class {
diff --git a/clang/test/CodeGenCXX/mangle-ms-vector-types.cpp b/clang/test/CodeGenCXX/mangle-ms-vector-types.cpp
index 64cb725..aca4929 100644
--- a/clang/test/CodeGenCXX/mangle-ms-vector-types.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms-vector-types.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fms-extensions -ffreestanding -target-feature +avx -emit-llvm %s -o - -cxx-abi microsoft -triple=i686-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -fms-extensions -ffreestanding -target-feature +avx -emit-llvm %s -o - -triple=i686-pc-win32 | FileCheck %s
 
 #include <xmmintrin.h>
 #include <emmintrin.h>
diff --git a/clang/test/CodeGenCXX/mangle-ms.cpp b/clang/test/CodeGenCXX/mangle-ms.cpp
index 62f9831..2b0457f 100644
--- a/clang/test/CodeGenCXX/mangle-ms.cpp
+++ b/clang/test/CodeGenCXX/mangle-ms.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 -std=c++11 | FileCheck %s
-// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 -std=c++11| FileCheck -check-prefix X64 %s
+// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -triple=i386-pc-win32 -std=c++11 | FileCheck %s
+// RUN: %clang_cc1 -fblocks -emit-llvm %s -o - -triple=x86_64-pc-win32 -std=c++11| FileCheck -check-prefix X64 %s
 
 int a;
 // CHECK-DAG: @"\01?a@@3HA"
diff --git a/clang/test/CodeGenCXX/mangle-nullptr-arg.cpp b/clang/test/CodeGenCXX/mangle-nullptr-arg.cpp
index c3f4501..66ed7e5 100644
--- a/clang/test/CodeGenCXX/mangle-nullptr-arg.cpp
+++ b/clang/test/CodeGenCXX/mangle-nullptr-arg.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 template<int *ip> struct IP {};
 
diff --git a/clang/test/CodeGenCXX/mangle-std-externc.cpp b/clang/test/CodeGenCXX/mangle-std-externc.cpp
index 09a2533..f0c7d69 100644
--- a/clang/test/CodeGenCXX/mangle-std-externc.cpp
+++ b/clang/test/CodeGenCXX/mangle-std-externc.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -DNS=std -emit-llvm -cxx-abi itanium -o - | FileCheck %s --check-prefix=CHECK-STD
-// RUN: %clang_cc1 %s -DNS=n -emit-llvm -cxx-abi itanium -o - | FileCheck %s --check-prefix=CHECK-N
+// RUN: %clang_cc1 %s -DNS=std -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s --check-prefix=CHECK-STD
+// RUN: %clang_cc1 %s -DNS=n -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s --check-prefix=CHECK-N
 
 // _ZNSt1DISt1CE1iE = std::D<std::C>::i
 // CHECK-STD: @_ZNSt1DISt1CE1iE = 
diff --git a/clang/test/CodeGenCXX/mangle-template.cpp b/clang/test/CodeGenCXX/mangle-template.cpp
index ad66c5d..8fd27b8 100644
--- a/clang/test/CodeGenCXX/mangle-template.cpp
+++ b/clang/test/CodeGenCXX/mangle-template.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -Wno-return-type -Wno-main -std=c++11 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s
+// RUN: %clang_cc1 -verify -Wno-return-type -Wno-main -std=c++11 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
 // expected-no-diagnostics
 
 namespace test1 {
diff --git a/clang/test/CodeGenCXX/mangle-windows.cpp b/clang/test/CodeGenCXX/mangle-windows.cpp
index c087616..8564447 100644
--- a/clang/test/CodeGenCXX/mangle-windows.cpp
+++ b/clang/test/CodeGenCXX/mangle-windows.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft \
-// RUN:     -triple=i386-pc-win32 | FileCheck --check-prefix=WIN %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | \
+// RUN:     FileCheck --check-prefix=WIN %s
 //
 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-mingw32 | \
 // RUN:     FileCheck --check-prefix=ITANIUM %s
diff --git a/clang/test/CodeGenCXX/member-alignment.cpp b/clang/test/CodeGenCXX/member-alignment.cpp
index ba853c3..43ed5e2 100644
--- a/clang/test/CodeGenCXX/member-alignment.cpp
+++ b/clang/test/CodeGenCXX/member-alignment.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - | FileCheck %s
 
 // rdar://7268289
 
diff --git a/clang/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp b/clang/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp
index 7407efe..92bc0fc 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-alignment-fail.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=i686-pc-win32 -o - %s  2>/dev/null | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=x86_64-pc-win32 -o - %s  2>/dev/null | FileCheck %s -check-prefix CHECK-X64
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -triple=i686-pc-win32 -o - %s  2>/dev/null | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -triple=x86_64-pc-win32 -o - %s  2>/dev/null | FileCheck %s -check-prefix CHECK-X64
 
 struct B { char a; };
 struct A : virtual B {} a;
diff --git a/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp b/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp
index 4f96f2a..4415c2e 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-arg-order.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -mconstructor-aliases -std=c++11 -fexceptions -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -mconstructor-aliases -std=c++11 -fexceptions -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 
 struct A {
   A(int a);
diff --git a/clang/test/CodeGenCXX/microsoft-abi-array-cookies.cpp b/clang/test/CodeGenCXX/microsoft-abi-array-cookies.cpp
index 1ba1f6a..8da4fcf 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-array-cookies.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-array-cookies.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 
 struct ClassWithoutDtor {
   char x;
diff --git a/clang/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp b/clang/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp
index 92db9a7..319f39c 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-constexpr-vs-inheritance.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -fno-rtti -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 
 struct A {
   constexpr A(int x) : x(x) {}
diff --git a/clang/test/CodeGenCXX/microsoft-abi-default-cc.cpp b/clang/test/CodeGenCXX/microsoft-abi-default-cc.cpp
index 1254d6a..e3ca392 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-default-cc.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-default-cc.cpp
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -triple i386-pc-linux -emit-llvm %s -o - | FileCheck -check-prefix GCABI %s
-// RUN: %clang_cc1 -emit-llvm %s -o - -DMS_ABI -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck -check-prefix MSABI %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -DMS_ABI -triple=i386-pc-win32 | FileCheck -check-prefix MSABI %s
 
 #ifdef MS_ABI
 # define METHOD_CC __thiscall
diff --git a/clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp b/clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp
index 7757ea0..6731c0e 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-exceptions.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -cxx-abi microsoft -fexceptions -fno-rtti | FileCheck -check-prefix WIN32 %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fexceptions -fno-rtti | FileCheck -check-prefix WIN32 %s
 
 struct A {
   A();
diff --git a/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp b/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
index dca9f17..1da8e12 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-member-pointers.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 // FIXME: Test x86_64 member pointers when codegen no longer asserts on records
 // with virtual bases.
 
diff --git a/clang/test/CodeGenCXX/microsoft-abi-methods.cpp b/clang/test/CodeGenCXX/microsoft-abi-methods.cpp
index c996ba5..579e549 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-methods.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-methods.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
 
 class C {
  public:
diff --git a/clang/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp b/clang/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
index 802f0ca..b1c1482 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-multiple-nonvirtual-inheritance.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -mconstructor-aliases -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -mconstructor-aliases -triple=i386-pc-win32 | FileCheck %s
 
 struct Left {
   virtual void left();
diff --git a/clang/test/CodeGenCXX/microsoft-abi-non-virtual-base-ordering.cpp b/clang/test/CodeGenCXX/microsoft-abi-non-virtual-base-ordering.cpp
index f09c47e..0c82ac3 100755
--- a/clang/test/CodeGenCXX/microsoft-abi-non-virtual-base-ordering.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-non-virtual-base-ordering.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=i686-pc-win32 -o - %s  2>/dev/null | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=x86_64-pc-win32 -o - %s  2>/dev/null | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -triple=i686-pc-win32 -o - %s  2>/dev/null | FileCheck %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -triple=x86_64-pc-win32 -o - %s  2>/dev/null | FileCheck %s
 
 struct C0 { int a; };
 struct C1 { int a; virtual void C1M() {} };
diff --git a/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp b/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
index d0750e6..7a49471 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-sret-and-byval.cpp
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-linux | FileCheck -check-prefix LINUX %s
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -cxx-abi microsoft -fno-rtti | FileCheck -check-prefix WIN32 %s
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-win32 -mconstructor-aliases -cxx-abi microsoft -fno-rtti | FileCheck -check-prefix WIN64 %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -mconstructor-aliases -fno-rtti | FileCheck -check-prefix WIN32 %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-win32 -mconstructor-aliases -fno-rtti | FileCheck -check-prefix WIN64 %s
 
 struct Empty {};
 
diff --git a/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp b/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
index c0b9722..e25f21e 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-static-initializers.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -mconstructor-aliases -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -mconstructor-aliases -triple=i386-pc-win32 | FileCheck %s
 
 // CHECK: @llvm.global_ctors = appending global [2 x { i32, void ()* }]
 // CHECK: [{ i32, void ()* } { i32 65535, void ()* @"\01??__Efoo@?$B@H@@YAXXZ" },
diff --git a/clang/test/CodeGenCXX/microsoft-abi-structors-alias.cpp b/clang/test/CodeGenCXX/microsoft-abi-structors-alias.cpp
index d54520f..9301163 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-structors-alias.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-structors-alias.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 -fno-rtti -mconstructor-aliases | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -fno-rtti -mconstructor-aliases | FileCheck %s
 
 namespace test1 {
 template <typename T> class A {
diff --git a/clang/test/CodeGenCXX/microsoft-abi-structors.cpp b/clang/test/CodeGenCXX/microsoft-abi-structors.cpp
index 9199096..19fff5d 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-structors.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-structors.cpp
@@ -1,10 +1,10 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -mconstructor-aliases -cxx-abi microsoft -triple=i386-pc-win32 -fno-rtti > %t
+// RUN: %clang_cc1 -emit-llvm %s -o - -mconstructor-aliases -triple=i386-pc-win32 -fno-rtti > %t
 // RUN: FileCheck %s < %t
 // vftables are emitted very late, so do another pass to try to keep the checks
 // in source order.
 // RUN: FileCheck --check-prefix DTORS %s < %t
 //
-// RUN: %clang_cc1 -emit-llvm %s -o - -mconstructor-aliases -cxx-abi microsoft -triple=x86_64-pc-win32 -fno-rtti | FileCheck --check-prefix DTORS-X64 %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -mconstructor-aliases -triple=x86_64-pc-win32 -fno-rtti | FileCheck --check-prefix DTORS-X64 %s
 
 namespace basic {
 
diff --git a/clang/test/CodeGenCXX/microsoft-abi-thunks.cpp b/clang/test/CodeGenCXX/microsoft-abi-thunks.cpp
index f1bc385..2be642c 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-thunks.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-thunks.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 >%t 2>&1
+// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -triple=i386-pc-win32 >%t 2>&1
 // RUN: FileCheck --check-prefix=MANGLING %s < %t
 // RUN: FileCheck --check-prefix=XMANGLING %s < %t
 // RUN: FileCheck --check-prefix=CODEGEN %s < %t
-// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 2>&1 | FileCheck --check-prefix=MANGLING-X64 %s
+// RUN: %clang_cc1 -fno-rtti -emit-llvm %s -o - -triple=x86_64-pc-win32 2>&1 | FileCheck --check-prefix=MANGLING-X64 %s
 
 void foo(void *);
 
diff --git a/clang/test/CodeGenCXX/microsoft-abi-vbtables.cpp b/clang/test/CodeGenCXX/microsoft-abi-vbtables.cpp
index 79e32a84..b950d0c 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-vbtables.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-vbtables.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -fno-rtti -triple=i386-pc-win32 -emit-llvm -o - | FileCheck %s
 
 // See microsoft-abi-structors.cpp for constructor codegen tests.
 
diff --git a/clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp b/clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp
index 8e23ade..5d11896 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance-vtordisps.cpp
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -fno-rtti -triple=i386-pc-win32 -emit-llvm -o - | FileCheck %s
 
 // For now, just make sure x86_64 doesn't crash.
-// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=x86_64-pc-win32 -emit-llvm -o %t
+// RUN: %clang_cc1 %s -fno-rtti -triple=x86_64-pc-win32 -emit-llvm -o %t
 
 struct A {
   virtual void f();
diff --git a/clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp b/clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
index 1014ae4..80efdd0 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -o %t
+// RUN: %clang_cc1 %s -fno-rtti -triple=i386-pc-win32 -emit-llvm -o %t
 // RUN: FileCheck %s < %t
 // RUN: FileCheck --check-prefix=CHECK2 %s < %t
 
 // For now, just make sure x86_64 doesn't crash.
-// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=x86_64-pc-win32 -emit-llvm -o %t
+// RUN: %clang_cc1 %s -fno-rtti -triple=x86_64-pc-win32 -emit-llvm -o %t
 
 struct VBase {
   virtual ~VBase();
diff --git a/clang/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp b/clang/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
index 51a04c8..879e1d9 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-virtual-member-pointers.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK32
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -cxx-abi microsoft -triple=x86_64-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK64
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK32
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -triple=x86_64-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK64
 
 struct S {
   int x, y, z;
diff --git a/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp b/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp
index d93dee1..21a5fb6 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -o %t.ll -fdump-vtable-layouts >%t
+// RUN: %clang_cc1 %s -fno-rtti -triple=i386-pc-win32 -emit-llvm -o %t.ll -fdump-vtable-layouts >%t
 
 // RUN: FileCheck --check-prefix=NO-THUNKS-Test1 %s < %t
 // RUN: FileCheck --check-prefix=NO-THUNKS-Test2 %s < %t
diff --git a/clang/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp b/clang/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp
index dd7af0a..7812b58 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-vtables-return-thunks.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fno-rtti %s -emit-llvm -o %t -cxx-abi microsoft -triple=i386-pc-win32 -fdump-vtable-layouts 2>&1 | FileCheck --check-prefix=VFTABLES %s
+// RUN: %clang_cc1 -fno-rtti %s -emit-llvm -o %t -triple=i386-pc-win32 -fdump-vtable-layouts 2>&1 | FileCheck --check-prefix=VFTABLES %s
 // RUN: FileCheck --check-prefix=GLOBALS %s < %t
 // RUN: FileCheck --check-prefix=CODEGEN %s < %t
 
diff --git a/clang/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp b/clang/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
index 6d0dc12..428d9ee 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-vtables-single-inheritance.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fno-rtti -cxx-abi microsoft -triple=i386-pc-win32 -emit-llvm -fdump-vtable-layouts -o %t.ll > %t
+// RUN: %clang_cc1 %s -fno-rtti -triple=i386-pc-win32 -emit-llvm -fdump-vtable-layouts -o %t.ll > %t
 // RUN: FileCheck --check-prefix=EMITS-VFTABLE %s < %t.ll
 // RUN: FileCheck --check-prefix=NO-VFTABLE %s < %t.ll
 // RUN: FileCheck --check-prefix=CHECK-A %s < %t
diff --git a/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp b/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp
index 3fef0e4..93494c2 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-vtordisps.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -fdump-vtable-layouts %s -o %t.ll -cxx-abi microsoft -triple=i386-pc-win32 >%t
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -fdump-vtable-layouts %s -o %t.ll -triple=i386-pc-win32 > %t
 // RUN: FileCheck --check-prefix=VTABLE-SIMPLE-A %s < %t
 // RUN: FileCheck --check-prefix=VTABLE-SIMPLE-B %s < %t
 // RUN: FileCheck --check-prefix=VTABLE-SIMPLE-C %s < %t
@@ -13,7 +13,7 @@
 // RUN: FileCheck --check-prefix=MANGLING %s < %t.ll
 
 // For now, just make sure x86_64 doesn't crash.
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -fdump-vtable-layouts %s -cxx-abi microsoft -triple=x86_64-pc-win32 >/dev/null
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -fdump-vtable-layouts %s -triple=x86_64-pc-win32 > /dev/null
 
 struct V1 {
   virtual void f();
diff --git a/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp b/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
index 7ef9a7a..333d30e 100644
--- a/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
+++ b/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm -o %t.ll -fdump-vtable-layouts %s -cxx-abi microsoft -triple=i386-pc-win32 >%t
+// RUN: %clang_cc1 -fno-rtti -emit-llvm -o %t.ll -fdump-vtable-layouts %s -triple=i386-pc-win32 >%t
 
 // RUN: FileCheck --check-prefix=VTABLE-C %s < %t
 // RUN: FileCheck --check-prefix=VTABLE-D %s < %t
diff --git a/clang/test/CodeGenCXX/microsoft-new.cpp b/clang/test/CodeGenCXX/microsoft-new.cpp
index 784de7b..4c3d72e 100644
--- a/clang/test/CodeGenCXX/microsoft-new.cpp
+++ b/clang/test/CodeGenCXX/microsoft-new.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi itanium -fms-compatibility %s -emit-llvm -o - | FileCheck %s

+// RUN: %clang_cc1 -triple i686-pc-win32 -fms-compatibility %s -emit-llvm -o - | FileCheck %s

 

 #include <stddef.h>

 

@@ -13,7 +13,7 @@
 	// MSVC will fall back on the non-array operator new.

     void *a;

     int *p = new(arbitrary) int[4];

-    // CHECK: call i8* @_Znwj11arbitrary_t(i32 16, %struct.arbitrary_t*

+    // CHECK: call i8* @"\01??2@YAPAXIUarbitrary_t@@@Z"(i32 16, %struct.arbitrary_t*

   }

 

   struct S {

@@ -22,9 +22,9 @@
 

   void g() {

     S *s = new(arbitrary) S[2];

-    // CHECK: call i8* @_ZN7PR131641SnaEj11arbitrary_t(i32 2, %struct.arbitrary_t*

+    // CHECK: call i8* @"\01??_US@PR13164@@SAPAXIUarbitrary_t@@@Z"(i32 2, %struct.arbitrary_t*

     S *s1 = new(arbitrary) S;

-    // CHECK: call i8* @_Znwj11arbitrary_t(i32 1, %struct.arbitrary_t*

+    // CHECK: call i8* @"\01??2@YAPAXIUarbitrary_t@@@Z"(i32 1, %struct.arbitrary_t*

   }

 

   struct T {

@@ -34,6 +34,6 @@
   void h() {

     // This should still call the global operator new[].

     T *t = new(arbitrary2) T[2];

-    // CHECK: call i8* @_Znaj12arbitrary2_t(i32 2, %struct.arbitrary2_t*

+    // CHECK: call i8* @"\01??_U@YAPAXIUarbitrary2_t@@@Z"(i32 2, %struct.arbitrary2_t*

   }

 }

diff --git a/clang/test/CodeGenCXX/microsoft-uuidof.cpp b/clang/test/CodeGenCXX/microsoft-uuidof.cpp
index 0ce3003..d57ca83 100644
--- a/clang/test/CodeGenCXX/microsoft-uuidof.cpp
+++ b/clang/test/CodeGenCXX/microsoft-uuidof.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -triple=i386-pc-win32 -fms-extensions -cxx-abi itanium | FileCheck %s --check-prefix=CHECK-DEFINE-GUID
-// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -fms-extensions -cxx-abi itanium | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -DWRONG_GUID -triple=i386-pc-win32 -fms-extensions -cxx-abi itanium | FileCheck %s --check-prefix=CHECK-DEFINE-WRONG-GUID
+// RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -triple=i386-pc-linux -fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-GUID
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-linux -fms-extensions | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -DWRONG_GUID -triple=i386-pc-linux -fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-WRONG-GUID
 
 #ifdef DEFINE_GUID
 struct _GUID {
diff --git a/clang/test/CodeGenCXX/ms-integer-static-data-members.cpp b/clang/test/CodeGenCXX/ms-integer-static-data-members.cpp
index 00beaa6..5505db1 100644
--- a/clang/test/CodeGenCXX/ms-integer-static-data-members.cpp
+++ b/clang/test/CodeGenCXX/ms-integer-static-data-members.cpp
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi microsoft -triple=i386-pc-win32 %s -o - | FileCheck %s
-// RUN: %clang_cc1 -DINLINE_INIT -emit-llvm -cxx-abi microsoft -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK-INLINE
-// RUN: %clang_cc1 -DREAL_DEFINITION -emit-llvm -cxx-abi microsoft -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK-OUTOFLINE
-// RUN: %clang_cc1 -DINLINE_INIT -DREAL_DEFINITION -emit-llvm -cxx-abi microsoft -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK-INLINE
+// RUN: %clang_cc1 -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s
+// RUN: %clang_cc1 -DINLINE_INIT -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK-INLINE
+// RUN: %clang_cc1 -DREAL_DEFINITION -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK-OUTOFLINE
+// RUN: %clang_cc1 -DINLINE_INIT -DREAL_DEFINITION -emit-llvm -triple=i386-pc-win32 %s -o - | FileCheck %s --check-prefix=CHECK-INLINE
 
 struct S {
   // For MS ABI, we emit a linkonce_odr definition here, even though it's really just a declaration.
diff --git a/clang/test/CodeGenCXX/ms_wide_predefined_expr.cpp b/clang/test/CodeGenCXX/ms_wide_predefined_expr.cpp
index f92486d..b6af519 100644
--- a/clang/test/CodeGenCXX/ms_wide_predefined_expr.cpp
+++ b/clang/test/CodeGenCXX/ms_wide_predefined_expr.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 %s -fms-extensions -triple i686-pc-win32 -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -fms-extensions -triple i686-pc-win32 -emit-llvm -o - | FileCheck %s
 
-// CHECK: @L__FUNCTION__._Z4funcv = private constant [5 x i16] [i16 102, i16 117, i16 110, i16 99, i16 0], align 2
+// CHECK: @"L__FUNCTION__.?func@@YAXXZ" = private constant [5 x i16] [i16 102, i16 117, i16 110, i16 99, i16 0], align 2
 
 void wprint(const wchar_t*);
 
diff --git a/clang/test/CodeGenCXX/noinline-template.cpp b/clang/test/CodeGenCXX/noinline-template.cpp
index 8efecec..3dd4366 100644
--- a/clang/test/CodeGenCXX/noinline-template.cpp
+++ b/clang/test/CodeGenCXX/noinline-template.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s  -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 
 // This was a problem in Sema, but only shows up as noinline missing
 // in CodeGen.
diff --git a/clang/test/CodeGenCXX/pr11797.cpp b/clang/test/CodeGenCXX/pr11797.cpp
index 80e1b07..2a31090 100644
--- a/clang/test/CodeGenCXX/pr11797.cpp
+++ b/clang/test/CodeGenCXX/pr11797.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -fvisibility hidden -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -fvisibility hidden -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 namespace std __attribute__ ((__visibility__ ("default"))) {}
 #pragma GCC visibility push(default)
diff --git a/clang/test/CodeGenCXX/pr12104.cpp b/clang/test/CodeGenCXX/pr12104.cpp
index be17f2f..560ffbe 100644
--- a/clang/test/CodeGenCXX/pr12104.cpp
+++ b/clang/test/CodeGenCXX/pr12104.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -include %S/pr12104.h %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 -x c++ -cxx-abi itanium -emit-pch -o %t %S/pr12104.h
-// RUN: %clang_cc1 -include-pch %t %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -include %S/pr12104.h %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -x c++ -triple %itanium_abi_triple -emit-pch -o %t %S/pr12104.h
+// RUN: %clang_cc1 -include-pch %t %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 template struct Patch<1>;
 
diff --git a/clang/test/CodeGenCXX/pr9965.cpp b/clang/test/CodeGenCXX/pr9965.cpp
index fe2cd71..46fd609 100644
--- a/clang/test/CodeGenCXX/pr9965.cpp
+++ b/clang/test/CodeGenCXX/pr9965.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 struct A { A(); };
 template<typename T>
 struct X : A // default constructor is not trivial
diff --git a/clang/test/CodeGenCXX/pragma-weak.cpp b/clang/test/CodeGenCXX/pragma-weak.cpp
index 9d7d489..e2d4648 100644
--- a/clang/test/CodeGenCXX/pragma-weak.cpp
+++ b/clang/test/CodeGenCXX/pragma-weak.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
 
 #pragma weak zex
 int zex;
diff --git a/clang/test/CodeGenCXX/predefined-expr.cpp b/clang/test/CodeGenCXX/predefined-expr.cpp
index 912b555..b2b1ba3 100644
--- a/clang/test/CodeGenCXX/predefined-expr.cpp
+++ b/clang/test/CodeGenCXX/predefined-expr.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 // CHECK: private unnamed_addr constant [15 x i8] c"externFunction\00"
 // CHECK: private unnamed_addr constant [26 x i8] c"void NS::externFunction()\00"
diff --git a/clang/test/CodeGenCXX/reference-field.cpp b/clang/test/CodeGenCXX/reference-field.cpp
index aa34fa3..54e914d 100644
--- a/clang/test/CodeGenCXX/reference-field.cpp
+++ b/clang/test/CodeGenCXX/reference-field.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s -O2 | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s -O2 | FileCheck %s
 
 // Make sure the call to b() doesn't get optimized out.
 extern struct x {char& x,y;}y;
diff --git a/clang/test/CodeGenCXX/reference-init.cpp b/clang/test/CodeGenCXX/reference-init.cpp
index 2c14934..3a3eaee 100644
--- a/clang/test/CodeGenCXX/reference-init.cpp
+++ b/clang/test/CodeGenCXX/reference-init.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm-only -cxx-abi itanium -verify %s
+// RUN: %clang_cc1 -emit-llvm-only -triple %itanium_abi_triple -verify %s
 // expected-no-diagnostics
 
 struct XPTParamDescriptor {};
diff --git a/clang/test/CodeGenCXX/return.cpp b/clang/test/CodeGenCXX/return.cpp
index afc52a6..5c1cfda 100644
--- a/clang/test/CodeGenCXX/return.cpp
+++ b/clang/test/CodeGenCXX/return.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -O -o - %s | FileCheck %s --check-prefix=CHECK-OPT
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -O -o - %s | FileCheck %s --check-prefix=CHECK-OPT
 
 // CHECK:     @_Z9no_return
 // CHECK-OPT: @_Z9no_return
diff --git a/clang/test/CodeGenCXX/scoped-enums.cpp b/clang/test/CodeGenCXX/scoped-enums.cpp
index 1951386..218013a 100644
--- a/clang/test/CodeGenCXX/scoped-enums.cpp
+++ b/clang/test/CodeGenCXX/scoped-enums.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 // PR9923
 enum class Color { red, blue, green };
diff --git a/clang/test/CodeGenCXX/specialized-static-data-mem-init.cpp b/clang/test/CodeGenCXX/specialized-static-data-mem-init.cpp
index e6bd6e7..21bc123 100644
--- a/clang/test/CodeGenCXX/specialized-static-data-mem-init.cpp
+++ b/clang/test/CodeGenCXX/specialized-static-data-mem-init.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 // rdar: // 8562966
 // pr8409
 
diff --git a/clang/test/CodeGenCXX/stmtexpr.cpp b/clang/test/CodeGenCXX/stmtexpr.cpp
index af39440..7bf19bb 100644
--- a/clang/test/CodeGenCXX/stmtexpr.cpp
+++ b/clang/test/CodeGenCXX/stmtexpr.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Wno-unused-value -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 // rdar: //8540501
 extern "C" int printf(...);
 extern "C" void abort();
diff --git a/clang/test/CodeGenCXX/template-dependent-bind-temporary.cpp b/clang/test/CodeGenCXX/template-dependent-bind-temporary.cpp
index 3f70d8d..47d8279 100644
--- a/clang/test/CodeGenCXX/template-dependent-bind-temporary.cpp
+++ b/clang/test/CodeGenCXX/template-dependent-bind-temporary.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 // rdar: //8620524
 // PR7851
 struct string {
diff --git a/clang/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp b/clang/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
index 2069ea1..137792b 100644
--- a/clang/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
+++ b/clang/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fvisibility hidden -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fvisibility hidden -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 // Verify that symbols are hidden.
 // CHECK: @_ZN1CIiE5Inner6Inner26StaticE = weak_odr hidden global
diff --git a/clang/test/CodeGenCXX/throw-expression-dtor.cpp b/clang/test/CodeGenCXX/throw-expression-dtor.cpp
index 6e0cf48..b883b85 100644
--- a/clang/test/CodeGenCXX/throw-expression-dtor.cpp
+++ b/clang/test/CodeGenCXX/throw-expression-dtor.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm-only -verify -cxx-abi itanium -fcxx-exceptions -fexceptions
+// RUN: %clang_cc1 %s -emit-llvm-only -verify -triple %itanium_abi_triple -fcxx-exceptions -fexceptions
 // expected-no-diagnostics
 // PR7281
 
diff --git a/clang/test/CodeGenCXX/thunk-use-after-free.cpp b/clang/test/CodeGenCXX/thunk-use-after-free.cpp
index a74b1d5..14f2356 100644
--- a/clang/test/CodeGenCXX/thunk-use-after-free.cpp
+++ b/clang/test/CodeGenCXX/thunk-use-after-free.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm-only -cxx-abi itanium -O1 %s
+// RUN: %clang_cc1 -emit-llvm-only -triple %itanium_abi_triple -O1 %s
 // This used to crash under asan and valgrind.
 // PR12284
 
diff --git a/clang/test/CodeGenCXX/trivial-constructor-init.cpp b/clang/test/CodeGenCXX/trivial-constructor-init.cpp
index bfbec0b..9130e4e 100644
--- a/clang/test/CodeGenCXX/trivial-constructor-init.cpp
+++ b/clang/test/CodeGenCXX/trivial-constructor-init.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -std=c++11 -cxx-abi itanium | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -std=c++11 -triple %itanium_abi_triple | FileCheck %s
 
 extern "C" int printf(...);
 
diff --git a/clang/test/CodeGenCXX/vararg-non-pod.cpp b/clang/test/CodeGenCXX/vararg-non-pod.cpp
index 12a0ada..613b28c 100644
--- a/clang/test/CodeGenCXX/vararg-non-pod.cpp
+++ b/clang/test/CodeGenCXX/vararg-non-pod.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Wno-error=non-pod-varargs -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -Wno-error=non-pod-varargs -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 struct X {
   X();
diff --git a/clang/test/CodeGenCXX/virt-dtor-gen.cpp b/clang/test/CodeGenCXX/virt-dtor-gen.cpp
index 706f23c..ba83689 100644
--- a/clang/test/CodeGenCXX/virt-dtor-gen.cpp
+++ b/clang/test/CodeGenCXX/virt-dtor-gen.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -o - -cxx-abi itanium -emit-llvm %s | FileCheck %s
+// RUN: %clang_cc1 -o - -triple %itanium_abi_triple -emit-llvm %s | FileCheck %s
 // PR5483
 
 // Make sure we generate all three forms of the destructor when it is virtual.
diff --git a/clang/test/CodeGenCXX/virt-dtor-key.cpp b/clang/test/CodeGenCXX/virt-dtor-key.cpp
index aa119ec..22c1cd6 100644
--- a/clang/test/CodeGenCXX/virt-dtor-key.cpp
+++ b/clang/test/CodeGenCXX/virt-dtor-key.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
 // CHECK: @_ZTI3foo = unnamed_addr constant
 class foo {
    foo();
diff --git a/clang/test/CodeGenCXX/virt-template-vtable.cpp b/clang/test/CodeGenCXX/virt-template-vtable.cpp
index 16c23aa..a71db48 100644
--- a/clang/test/CodeGenCXX/virt-template-vtable.cpp
+++ b/clang/test/CodeGenCXX/virt-template-vtable.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 template<class T> class A {
 public:
diff --git a/clang/test/CodeGenCXX/virtual-base-cast.cpp b/clang/test/CodeGenCXX/virtual-base-cast.cpp
index 40e68f6..6a4894b 100644
--- a/clang/test/CodeGenCXX/virtual-base-cast.cpp
+++ b/clang/test/CodeGenCXX/virtual-base-cast.cpp
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-llvm %s -o - -triple i686-pc-linux-gnu | FileCheck %s
-// RUN: %clang_cc1 -cxx-abi microsoft -emit-llvm %s -o - -triple i686-pc-win32 | FileCheck -check-prefix MSVC %s
+// RUN: %clang_cc1 -emit-llvm %s -o - -triple i686-pc-win32 | FileCheck -check-prefix MSVC %s
 
 struct A { int a; virtual int aa(); };
 struct B { int b; virtual int bb(); };
diff --git a/clang/test/CodeGenCXX/virtual-base-ctor.cpp b/clang/test/CodeGenCXX/virtual-base-ctor.cpp
index 28b4e40..8c28965 100644
--- a/clang/test/CodeGenCXX/virtual-base-ctor.cpp
+++ b/clang/test/CodeGenCXX/virtual-base-ctor.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - -O2 | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - -O2 | FileCheck %s
 
 struct B;
 extern B x;
diff --git a/clang/test/CodeGenCXX/virtual-base-destructor-call.cpp b/clang/test/CodeGenCXX/virtual-base-destructor-call.cpp
index 6b98c64..3d79071 100644
--- a/clang/test/CodeGenCXX/virtual-base-destructor-call.cpp
+++ b/clang/test/CodeGenCXX/virtual-base-destructor-call.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 struct basic_ios{~basic_ios(); };
 
diff --git a/clang/test/CodeGenCXX/virtual-destructor-synthesis.cpp b/clang/test/CodeGenCXX/virtual-destructor-synthesis.cpp
index f513ddf..80d1b1e 100644
--- a/clang/test/CodeGenCXX/virtual-destructor-synthesis.cpp
+++ b/clang/test/CodeGenCXX/virtual-destructor-synthesis.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 struct box {
   virtual ~box();
diff --git a/clang/test/CodeGenCXX/virtual-function-calls.cpp b/clang/test/CodeGenCXX/virtual-function-calls.cpp
index b3e2d1f..0a6fc6b 100644
--- a/clang/test/CodeGenCXX/virtual-function-calls.cpp
+++ b/clang/test/CodeGenCXX/virtual-function-calls.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -std=c++11 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -std=c++11 -emit-llvm -o - | FileCheck %s
 
 // PR5021
 namespace PR5021 {
diff --git a/clang/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp b/clang/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp
index 6941a77..0310465 100644
--- a/clang/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp
+++ b/clang/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 struct D;
 struct B {
diff --git a/clang/test/CodeGenCXX/virtual-implicit-move-assignment.cpp b/clang/test/CodeGenCXX/virtual-implicit-move-assignment.cpp
index b8ecb40..7c28fb1 100644
--- a/clang/test/CodeGenCXX/virtual-implicit-move-assignment.cpp
+++ b/clang/test/CodeGenCXX/virtual-implicit-move-assignment.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -std=c++11 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -std=c++11 -o - %s | FileCheck %s
 
 struct D;
 struct B {
diff --git a/clang/test/CodeGenCXX/virtual-inherited-destructor.cpp b/clang/test/CodeGenCXX/virtual-inherited-destructor.cpp
index f36e56c..3ca7b6d 100644
--- a/clang/test/CodeGenCXX/virtual-inherited-destructor.cpp
+++ b/clang/test/CodeGenCXX/virtual-inherited-destructor.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm-only
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm-only
 
 struct A { virtual ~A(); };
 struct B : A {
diff --git a/clang/test/CodeGenCXX/virtual-pseudo-destructor-call.cpp b/clang/test/CodeGenCXX/virtual-pseudo-destructor-call.cpp
index 0d963f9..b14a34d 100644
--- a/clang/test/CodeGenCXX/virtual-pseudo-destructor-call.cpp
+++ b/clang/test/CodeGenCXX/virtual-pseudo-destructor-call.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 struct A {
   virtual ~A();
diff --git a/clang/test/CodeGenCXX/visibility-hidden-extern-templates.cpp b/clang/test/CodeGenCXX/visibility-hidden-extern-templates.cpp
index 8061412..95e8e08 100644
--- a/clang/test/CodeGenCXX/visibility-hidden-extern-templates.cpp
+++ b/clang/test/CodeGenCXX/visibility-hidden-extern-templates.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -O1 -cxx-abi itanium -emit-llvm -o - -fvisibility hidden %s | FileCheck %s
+// RUN: %clang_cc1 -O1 -triple %itanium_abi_triple -emit-llvm -o - -fvisibility hidden %s | FileCheck %s
 
 template<typename T>
 struct X {
diff --git a/clang/test/CodeGenCXX/volatile-1.cpp b/clang/test/CodeGenCXX/volatile-1.cpp
index aa900c3..2038936 100644
--- a/clang/test/CodeGenCXX/volatile-1.cpp
+++ b/clang/test/CodeGenCXX/volatile-1.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -Wno-unused-value -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -Wno-unused-value -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
 
 // CHECK: @i = global [[INT:i[0-9]+]] 0
 volatile int i, j, k;
diff --git a/clang/test/CodeGenCXX/vtable-cast-crash.cpp b/clang/test/CodeGenCXX/vtable-cast-crash.cpp
index 3321fc7..58f9e0b 100644
--- a/clang/test/CodeGenCXX/vtable-cast-crash.cpp
+++ b/clang/test/CodeGenCXX/vtable-cast-crash.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm-only -cxx-abi itanium %s
+// RUN: %clang_cc1 -emit-llvm-only -triple %itanium_abi_triple %s
 struct A
 {
 A();    
diff --git a/clang/test/CodeGenCXX/weak-extern-typeinfo.cpp b/clang/test/CodeGenCXX/weak-extern-typeinfo.cpp
index 9e8504d..68198ee 100644
--- a/clang/test/CodeGenCXX/weak-extern-typeinfo.cpp
+++ b/clang/test/CodeGenCXX/weak-extern-typeinfo.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 // rdar://10246395
 
 #define WEAK __attribute__ ((weak)) 
diff --git a/clang/test/CodeGenCXX/weak-external.cpp b/clang/test/CodeGenCXX/weak-external.cpp
index d030e22..a2c53a5 100644
--- a/clang/test/CodeGenCXX/weak-external.cpp
+++ b/clang/test/CodeGenCXX/weak-external.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -cxx-abi itanium %s -S -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -triple %itanium_abi_triple %s -S -emit-llvm -o - | FileCheck %s
 // PR4262
 
 // CHECK-NOT: _ZNSs12_S_constructIPKcEEPcT_S3_RKSaIcESt20forward_iterator_tag
diff --git a/clang/test/CodeGenObjC/debug-info-self.m b/clang/test/CodeGenObjC/debug-info-self.m
index 5bb1a8a..7a484d8 100644
--- a/clang/test/CodeGenObjC/debug-info-self.m
+++ b/clang/test/CodeGenObjC/debug-info-self.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -g %s -o - | FileCheck %s
+// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -g %s -o - | FileCheck %s
 // self and _cmd are marked as DW_AT_artificial. 
 // myarg is not marked as DW_AT_artificial.
 
diff --git a/clang/test/CodeGenObjC/overloadable.m b/clang/test/CodeGenObjC/overloadable.m
index 9c462b7..0d55cd3f 100644
--- a/clang/test/CodeGenObjC/overloadable.m
+++ b/clang/test/CodeGenObjC/overloadable.m
@@ -1,5 +1,5 @@
 // rdar://6657613
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
 
 @class C;
 
diff --git a/clang/test/CodeGenObjCXX/arc-mangle.mm b/clang/test/CodeGenObjCXX/arc-mangle.mm
index 005f8f8..b921a7f 100644
--- a/clang/test/CodeGenObjCXX/arc-mangle.mm
+++ b/clang/test/CodeGenObjCXX/arc-mangle.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 
 // CHECK-LABEL: define void @_Z1fPU8__strongP11objc_object(i8**)
 void f(__strong id *) {}
diff --git a/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm b/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
index 91fd47a..3e01f03 100644
--- a/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
+++ b/clang/test/CodeGenObjCXX/microsoft-abi-arc-param-order.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi microsoft -mconstructor-aliases -fobjc-arc -triple i686-pc-win32 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -mconstructor-aliases -fobjc-arc -triple i686-pc-win32 -emit-llvm -o - %s | FileCheck %s
 
 struct A {
   A();
diff --git a/clang/test/CodeGenOpenCL/address-spaces-mangling.cl b/clang/test/CodeGenOpenCL/address-spaces-mangling.cl
index 8d9a15f..edb53fc 100644
--- a/clang/test/CodeGenOpenCL/address-spaces-mangling.cl
+++ b/clang/test/CodeGenOpenCL/address-spaces-mangling.cl
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -cxx-abi itanium -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s
-// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -cxx-abi itanium -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s
+// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s
+// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s
 
 // We can't name this f as private is equivalent to default
 // no specifier given address space so we get multiple definition
diff --git a/clang/test/CodeGenOpenCL/local.cl b/clang/test/CodeGenOpenCL/local.cl
index bc31e52..309c31a 100644
--- a/clang/test/CodeGenOpenCL/local.cl
+++ b/clang/test/CodeGenOpenCL/local.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 __kernel void foo(void) {
   // CHECK: @foo.i = internal addrspace(2)
diff --git a/clang/test/Driver/cl.c b/clang/test/Driver/cl.c
index 4fd4064..855cdc8 100644
--- a/clang/test/Driver/cl.c
+++ b/clang/test/Driver/cl.c
@@ -31,5 +31,4 @@
 // CL-NOT: -fapple-kext
 
 // RUN: %clang_cl /c -### -- %s 2>&1 | FileCheck -check-prefix=COMPILE %s
-// COMPILE: "-cxx-abi" "microsoft"
 // COMPILE: "-fdiagnostics-format" "msvc"
diff --git a/clang/test/Layout/ms-x86-alias-avoidance-padding.cpp b/clang/test/Layout/ms-x86-alias-avoidance-padding.cpp
index 3112b39..e0565f7 100644
--- a/clang/test/Layout/ms-x86-alias-avoidance-padding.cpp
+++ b/clang/test/Layout/ms-x86-alias-avoidance-padding.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Layout/ms-x86-aligned-tail-padding.cpp b/clang/test/Layout/ms-x86-aligned-tail-padding.cpp
index 3b5be91..36f7b97 100644
--- a/clang/test/Layout/ms-x86-aligned-tail-padding.cpp
+++ b/clang/test/Layout/ms-x86-aligned-tail-padding.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Layout/ms-x86-basic-layout.cpp b/clang/test/Layout/ms-x86-basic-layout.cpp
index fc57ec9..f4fd34a 100644
--- a/clang/test/Layout/ms-x86-basic-layout.cpp
+++ b/clang/test/Layout/ms-x86-basic-layout.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Layout/ms-x86-bitfields-vbases.cpp b/clang/test/Layout/ms-x86-bitfields-vbases.cpp
index 240cc99..7cffa8c 100644
--- a/clang/test/Layout/ms-x86-bitfields-vbases.cpp
+++ b/clang/test/Layout/ms-x86-bitfields-vbases.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>&1 \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 struct B0 { int a; };
diff --git a/clang/test/Layout/ms-x86-empty-base-after-base-with-vbptr.cpp b/clang/test/Layout/ms-x86-empty-base-after-base-with-vbptr.cpp
index 8d71b05..224594e 100644
--- a/clang/test/Layout/ms-x86-empty-base-after-base-with-vbptr.cpp
+++ b/clang/test/Layout/ms-x86-empty-base-after-base-with-vbptr.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts %s 2>/dev/null \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 
diff --git a/clang/test/Layout/ms-x86-empty-nonvirtual-bases.cpp b/clang/test/Layout/ms-x86-empty-nonvirtual-bases.cpp
index dd1cbe7..6ef1494 100644
--- a/clang/test/Layout/ms-x86-empty-nonvirtual-bases.cpp
+++ b/clang/test/Layout/ms-x86-empty-nonvirtual-bases.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Layout/ms-x86-empty-virtual-base.cpp b/clang/test/Layout/ms-x86-empty-virtual-base.cpp
index e61cdf3..28db524 100644
--- a/clang/test/Layout/ms-x86-empty-virtual-base.cpp
+++ b/clang/test/Layout/ms-x86-empty-virtual-base.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
@@ -757,4 +757,4 @@
 sizeof(T)+
 sizeof(U)+
 sizeof(V)+
-sizeof(T3)];
\ No newline at end of file
+sizeof(T3)];
diff --git a/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp b/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp
index 8cada51..991bd4a 100644
--- a/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp
+++ b/clang/test/Layout/ms-x86-lazy-empty-nonvirtual-base.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Layout/ms-x86-misalignedarray.cpp b/clang/test/Layout/ms-x86-misalignedarray.cpp
index c3e664d..de5bcc7 100644
--- a/clang/test/Layout/ms-x86-misalignedarray.cpp
+++ b/clang/test/Layout/ms-x86-misalignedarray.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>&1 \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 struct T0 { char c; };
diff --git a/clang/test/Layout/ms-x86-pack-and-align.cpp b/clang/test/Layout/ms-x86-pack-and-align.cpp
index 2caad71..e868766 100644
--- a/clang/test/Layout/ms-x86-pack-and-align.cpp
+++ b/clang/test/Layout/ms-x86-pack-and-align.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>&1 \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Layout/ms-x86-primary-bases.cpp b/clang/test/Layout/ms-x86-primary-bases.cpp
index 1597657..9d7312c 100644
--- a/clang/test/Layout/ms-x86-primary-bases.cpp
+++ b/clang/test/Layout/ms-x86-primary-bases.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Layout/ms-x86-size-alignment-fail.cpp b/clang/test/Layout/ms-x86-size-alignment-fail.cpp
index ad1de16..7e975b0 100644
--- a/clang/test/Layout/ms-x86-size-alignment-fail.cpp
+++ b/clang/test/Layout/ms-x86-size-alignment-fail.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts %s 2>/dev/null \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Layout/ms-x86-vfvb-alignment.cpp b/clang/test/Layout/ms-x86-vfvb-alignment.cpp
index 51d46fe..7ec0c5f 100644
--- a/clang/test/Layout/ms-x86-vfvb-alignment.cpp
+++ b/clang/test/Layout/ms-x86-vfvb-alignment.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>&1 \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Layout/ms-x86-vfvb-sharing.cpp b/clang/test/Layout/ms-x86-vfvb-sharing.cpp
index 8deb9c0..981fe68 100644
--- a/clang/test/Layout/ms-x86-vfvb-sharing.cpp
+++ b/clang/test/Layout/ms-x86-vfvb-sharing.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>&1 \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Layout/ms-x86-vtordisp.cpp b/clang/test/Layout/ms-x86-vtordisp.cpp
index 390d671..52a8fe2 100644
--- a/clang/test/Layout/ms-x86-vtordisp.cpp
+++ b/clang/test/Layout/ms-x86-vtordisp.cpp
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>&1 \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>&1 \
 // RUN:            | FileCheck %s
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only -cxx-abi microsoft %s 2>/dev/null \
+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts -fsyntax-only %s 2>/dev/null \
 // RUN:            | FileCheck %s -check-prefix CHECK-X64
 
 extern "C" int printf(const char *fmt, ...);
diff --git a/clang/test/Modules/module_file_info.m b/clang/test/Modules/module_file_info.m
index 09319d6..f9a35ba 100644
--- a/clang/test/Modules/module_file_info.m
+++ b/clang/test/Modules/module_file_info.m
@@ -16,7 +16,6 @@
 // CHECK:     Triple:
 // CHECK:     CPU: 
 // CHECK:     ABI: 
-// CHECK:     C++ ABI: 
 // CHECK:     Linker version: 
 
 // CHECK: Header search options:
diff --git a/clang/test/PCH/cxx-reference.cpp b/clang/test/PCH/cxx-reference.cpp
index a22f9ac..becb935 100644
--- a/clang/test/PCH/cxx-reference.cpp
+++ b/clang/test/PCH/cxx-reference.cpp
@@ -1,6 +1,6 @@
 // Test this without pch.
-// RUN: %clang_cc1 -x c++ -cxx-abi itanium -std=c++11 -include %S/cxx-reference.h -fsyntax-only -emit-llvm -o - %s
+// RUN: %clang_cc1 -x c++ -triple %itanium_abi_triple -std=c++11 -include %S/cxx-reference.h -fsyntax-only -emit-llvm -o - %s
 
 // Test with pch.
-// RUN: %clang_cc1 -x c++ -cxx-abi itanium -std=c++11 -emit-pch -o %t %S/cxx-reference.h
-// RUN: %clang_cc1 -x c++ -cxx-abi itanium -std=c++11 -include-pch %t -fsyntax-only -emit-llvm -o - %s 
+// RUN: %clang_cc1 -x c++ -triple %itanium_abi_triple -std=c++11 -emit-pch -o %t %S/cxx-reference.h
+// RUN: %clang_cc1 -x c++ -triple %itanium_abi_triple -std=c++11 -include-pch %t -fsyntax-only -emit-llvm -o - %s 
diff --git a/clang/test/PCH/cxx-required-decls.cpp b/clang/test/PCH/cxx-required-decls.cpp
index f98ce43..c2f8e2f 100644
--- a/clang/test/PCH/cxx-required-decls.cpp
+++ b/clang/test/PCH/cxx-required-decls.cpp
@@ -1,9 +1,9 @@
 // Test this without pch.
-// RUN: %clang_cc1 -include %S/cxx-required-decls.h %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -include %S/cxx-required-decls.h %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 // Test with pch.
-// RUN: %clang_cc1 -x c++-header -cxx-abi itanium -emit-pch -o %t %S/cxx-required-decls.h
-// RUN: %clang_cc1 -include-pch %t %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -x c++-header -triple %itanium_abi_triple -emit-pch -o %t %S/cxx-required-decls.h
+// RUN: %clang_cc1 -include-pch %t %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
 
 // CHECK: @_ZL5globS = internal global %struct.S zeroinitializer
 // CHECK: @_ZL3bar = internal global i32 0, align 4
diff --git a/clang/test/PCH/cxx-templates.cpp b/clang/test/PCH/cxx-templates.cpp
index 6cad26e..52ea875 100644
--- a/clang/test/PCH/cxx-templates.cpp
+++ b/clang/test/PCH/cxx-templates.cpp
@@ -1,21 +1,21 @@
 // Test this without pch.
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fexceptions -include %S/cxx-templates.h -verify %s -ast-dump -o -
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fexceptions -include %S/cxx-templates.h %s -emit-llvm -o - -DNO_ERRORS | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -include %S/cxx-templates.h -verify %s -ast-dump -o -
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -include %S/cxx-templates.h %s -emit-llvm -o - -DNO_ERRORS | FileCheck %s
 
 // Test with pch.
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fexceptions -x c++-header -emit-pch -o %t %S/cxx-templates.h
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fexceptions -include-pch %t -verify %s -ast-dump  -o -
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fexceptions -include-pch %t %s -emit-llvm -o - -error-on-deserialized-decl doNotDeserialize -DNO_ERRORS | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -x c++-header -emit-pch -o %t %S/cxx-templates.h
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -include-pch %t -verify %s -ast-dump  -o -
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -include-pch %t %s -emit-llvm -o - -error-on-deserialized-decl doNotDeserialize -DNO_ERRORS | FileCheck %s
 
 // Test with modules.
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fexceptions -fmodules -x c++-header -emit-pch -o %t %S/cxx-templates.h
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fexceptions -fmodules -include-pch %t -verify %s -ast-dump  -o -
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fexceptions -fmodules -include-pch %t %s -emit-llvm -o - -error-on-deserialized-decl doNotDeserialize -DNO_ERRORS | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -fmodules -x c++-header -emit-pch -o %t %S/cxx-templates.h
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -fmodules -include-pch %t -verify %s -ast-dump  -o -
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fexceptions -fmodules -include-pch %t %s -emit-llvm -o - -error-on-deserialized-decl doNotDeserialize -DNO_ERRORS | FileCheck %s
 
 // Test with pch and delayed template parsing.
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fdelayed-template-parsing -fexceptions -x c++-header -emit-pch -o %t %S/cxx-templates.h
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fdelayed-template-parsing -fexceptions -include-pch %t -verify %s -ast-dump  -o -
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fcxx-exceptions -fdelayed-template-parsing -fexceptions -include-pch %t %s -emit-llvm -o - -DNO_ERRORS | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fdelayed-template-parsing -fexceptions -x c++-header -emit-pch -o %t %S/cxx-templates.h
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fdelayed-template-parsing -fexceptions -include-pch %t -verify %s -ast-dump  -o -
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fcxx-exceptions -fdelayed-template-parsing -fexceptions -include-pch %t %s -emit-llvm -o - -DNO_ERRORS | FileCheck %s
 
 // CHECK: define weak_odr {{.*}}void @_ZN2S4IiE1mEv
 // CHECK: define linkonce_odr {{.*}}void @_ZN2S3IiE1mEv
diff --git a/clang/test/PCH/irgen-rdar13114142.mm b/clang/test/PCH/irgen-rdar13114142.mm
index f3c3f09..288c39d 100644
--- a/clang/test/PCH/irgen-rdar13114142.mm
+++ b/clang/test/PCH/irgen-rdar13114142.mm
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-pch -o %t.pch
-// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -include-pch %t.pch -o - | FileCheck %s
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-pch -o %t.pch
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -include-pch %t.pch -o - | FileCheck %s
 
 #ifndef HEADER
 #define HEADER
diff --git a/clang/test/PCH/objc_literals.mm b/clang/test/PCH/objc_literals.mm
index 84d9eba..777046e 100644
--- a/clang/test/PCH/objc_literals.mm
+++ b/clang/test/PCH/objc_literals.mm
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-pch -x objective-c++ -std=c++0x -o %t %s
-// RUN: %clang_cc1 -cxx-abi itanium -include-pch %t -x objective-c++ -std=c++0x -verify %s
-// RUN: %clang_cc1 -cxx-abi itanium -include-pch %t -x objective-c++ -std=c++0x -ast-print %s | FileCheck -check-prefix=CHECK-PRINT %s
-// RUN: %clang_cc1 -cxx-abi itanium -include-pch %t -x objective-c++ -std=c++0x -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-IR %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-pch -x objective-c++ -std=c++0x -o %t %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -include-pch %t -x objective-c++ -std=c++0x -verify %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -include-pch %t -x objective-c++ -std=c++0x -ast-print %s | FileCheck -check-prefix=CHECK-PRINT %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -include-pch %t -x objective-c++ -std=c++0x -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-IR %s
 
 // expected-no-diagnostics
 
diff --git a/clang/test/PCH/objcxx-ivar-class.mm b/clang/test/PCH/objcxx-ivar-class.mm
index e0d01e9..329f06f 100644
--- a/clang/test/PCH/objcxx-ivar-class.mm
+++ b/clang/test/PCH/objcxx-ivar-class.mm
@@ -1,9 +1,9 @@
 // Test this without pch.
-// RUN: %clang_cc1 -include %S/objcxx-ivar-class.h -cxx-abi itanium %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -include %S/objcxx-ivar-class.h -triple %itanium_abi_triple %s -emit-llvm -o - | FileCheck %s
 
 // Test with pch.
-// RUN: %clang_cc1 -x objective-c++-header -cxx-abi itanium -emit-pch -o %t %S/objcxx-ivar-class.h
-// RUN: %clang_cc1 -include-pch %t -cxx-abi itanium %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -x objective-c++-header -triple %itanium_abi_triple -emit-pch -o %t %S/objcxx-ivar-class.h
+// RUN: %clang_cc1 -include-pch %t -triple %itanium_abi_triple %s -emit-llvm -o - | FileCheck %s
 
 // CHECK: [C position]
 // CHECK: call {{.*}} @_ZN1SC1ERKS_
diff --git a/clang/test/Sema/empty1.c b/clang/test/Sema/empty1.c
index 115f938..9a2fb67 100644
--- a/clang/test/Sema/empty1.c
+++ b/clang/test/Sema/empty1.c
@@ -1,7 +1,6 @@
-// RUN: %clang_cc1 %s -cxx-abi itanium -fsyntax-only -verify -Wc++-compat
+// RUN: %clang_cc1 %s -triple %itanium_abi_triple -fsyntax-only -verify -Wc++-compat
 
-// FIXME: Empty C structs are 4 bytes in MSVC, but the -cxx-abi flag probably
-// shouldn't affect this since it's not C++. PR18263.
+// Note: Empty C structs are 4 bytes in the Microsoft ABI.
 
 struct emp_1 { // expected-warning {{empty struct has size 0 in C, size 1 in C++}}
 };
diff --git a/clang/test/Sema/ms_bitfield_layout.c b/clang/test/Sema/ms_bitfield_layout.c
index 4a2076c..f2010c1 100644
--- a/clang/test/Sema/ms_bitfield_layout.c
+++ b/clang/test/Sema/ms_bitfield_layout.c
@@ -1,6 +1,6 @@
-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -cxx-abi microsoft -fdump-record-layouts %s 2>/dev/null \

+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts %s 2>/dev/null \

 // RUN:            | FileCheck %s

-// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -cxx-abi microsoft -fdump-record-layouts %s 2>/dev/null \

+// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple x86_64-pc-win32 -fdump-record-layouts %s 2>/dev/null \

 // RUN:            | FileCheck %s

 

 typedef struct A {

diff --git a/clang/test/Sema/ms_class_layout.cpp b/clang/test/Sema/ms_class_layout.cpp
index e58ca3f..e4e47b3 100644
--- a/clang/test/Sema/ms_class_layout.cpp
+++ b/clang/test/Sema/ms_class_layout.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -cxx-abi microsoft %s 2>&1 \
+// RUN: %clang_cc1 -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts %s 2>&1 \
 // RUN:            | FileCheck %s
 
 #pragma pack(push, 8)
diff --git a/clang/test/SemaCXX/calling-conv-compat.cpp b/clang/test/SemaCXX/calling-conv-compat.cpp
index c55124c..cebac9f 100644
--- a/clang/test/SemaCXX/calling-conv-compat.cpp
+++ b/clang/test/SemaCXX/calling-conv-compat.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 -fms-extensions -cxx-abi microsoft -verify -triple i686-pc-win32 %s
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 -fms-extensions -verify -triple i686-pc-win32 %s
 
 // Pointers to free functions
 void            free_func_default();
diff --git a/clang/test/SemaCXX/decl-microsoft-call-conv.cpp b/clang/test/SemaCXX/decl-microsoft-call-conv.cpp
index fa782ead..4282047 100644
--- a/clang/test/SemaCXX/decl-microsoft-call-conv.cpp
+++ b/clang/test/SemaCXX/decl-microsoft-call-conv.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi microsoft -fms-extensions -verify %s
+// RUN: %clang_cc1 -triple i686-pc-win32 -fms-extensions -verify %s
 
 typedef void void_fun_t();
 typedef void __cdecl cdecl_fun_t();
diff --git a/clang/test/SemaCXX/destructor.cpp b/clang/test/SemaCXX/destructor.cpp
index bd22ff6..7642228 100644
--- a/clang/test/SemaCXX/destructor.cpp
+++ b/clang/test/SemaCXX/destructor.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fsyntax-only -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -verify %s
-// RUN: %clang_cc1 -std=c++11 -cxx-abi microsoft -DMSABI -fsyntax-only -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -verify %s
+// RUN: %clang_cc1 -std=c++11 -triple %itanium_abi_triple -fsyntax-only -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -verify %s
+// RUN: %clang_cc1 -std=c++11 -triple %ms_abi_triple -DMSABI -fsyntax-only -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -verify %s
 class A {
 public:
   ~A();
diff --git a/clang/test/SemaCXX/implicit-virtual-member-functions.cpp b/clang/test/SemaCXX/implicit-virtual-member-functions.cpp
index e3040c3..f88a55c 100644
--- a/clang/test/SemaCXX/implicit-virtual-member-functions.cpp
+++ b/clang/test/SemaCXX/implicit-virtual-member-functions.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -cxx-abi itanium -verify %s
-// RUN: %clang_cc1 -fsyntax-only -cxx-abi microsoft -DMSABI -verify %s
+// RUN: %clang_cc1 -fsyntax-only -triple %itanium_abi_triple -verify %s
+// RUN: %clang_cc1 -fsyntax-only -triple %ms_abi_triple -DMSABI -verify %s
 struct A {
   virtual ~A();
 };
diff --git a/clang/test/SemaCXX/member-pointer-ms.cpp b/clang/test/SemaCXX/member-pointer-ms.cpp
index aee8e2e..11260ed 100644
--- a/clang/test/SemaCXX/member-pointer-ms.cpp
+++ b/clang/test/SemaCXX/member-pointer-ms.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -std=c++11 -cxx-abi microsoft -fms-compatibility -fsyntax-only -triple=i386-pc-win32 -verify %s
-// RUN: %clang_cc1 -std=c++11 -cxx-abi microsoft -fms-compatibility -fsyntax-only -triple=x86_64-pc-win32 -verify %s
+// RUN: %clang_cc1 -std=c++11 -fms-compatibility -fsyntax-only -triple=i386-pc-win32 -verify %s
+// RUN: %clang_cc1 -std=c++11 -fms-compatibility -fsyntax-only -triple=x86_64-pc-win32 -verify %s
 //
 // This file should also give no diagnostics when run through cl.exe from MSVS
 // 2012, which supports C++11 and static_assert.  It should pass for both 64-bit
diff --git a/clang/test/SemaCXX/microsoft-dtor-lookup-cxx11.cpp b/clang/test/SemaCXX/microsoft-dtor-lookup-cxx11.cpp
index ed97a1d..5a399aa 100644
--- a/clang/test/SemaCXX/microsoft-dtor-lookup-cxx11.cpp
+++ b/clang/test/SemaCXX/microsoft-dtor-lookup-cxx11.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi microsoft -std=c++11 -verify %s
+// RUN: %clang_cc1 -triple i686-pc-win32 -std=c++11 -verify %s
 
 struct S {
   virtual ~S() = delete; // expected-note {{'~S' has been explicitly marked deleted here}}
diff --git a/clang/test/SemaCXX/microsoft-dtor-lookup.cpp b/clang/test/SemaCXX/microsoft-dtor-lookup.cpp
index a25ede6..a9f6f65 100644
--- a/clang/test/SemaCXX/microsoft-dtor-lookup.cpp
+++ b/clang/test/SemaCXX/microsoft-dtor-lookup.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi itanium -fsyntax-only %s
-// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi microsoft -verify -DMSVC_ABI %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only %s
+// RUN: %clang_cc1 -triple %ms_abi_triple -verify -DMSVC_ABI %s
 
 namespace Test1 {
 
diff --git a/clang/test/SemaCXX/primary-base.cpp b/clang/test/SemaCXX/primary-base.cpp
index 220e93f..d305aa3 100644
--- a/clang/test/SemaCXX/primary-base.cpp
+++ b/clang/test/SemaCXX/primary-base.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify %s
 // expected-no-diagnostics
 class A { virtual void f(); };
 class B : virtual A { };
diff --git a/clang/test/SemaCXX/typeid-ref.cpp b/clang/test/SemaCXX/typeid-ref.cpp
index 5b7754f..d77993c 100644
--- a/clang/test/SemaCXX/typeid-ref.cpp
+++ b/clang/test/SemaCXX/typeid-ref.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck %s
 namespace std {
   class type_info;
 }
diff --git a/clang/test/SemaCXX/undefined-internal.cpp b/clang/test/SemaCXX/undefined-internal.cpp
index 8942017..fdfa43b 100644
--- a/clang/test/SemaCXX/undefined-internal.cpp
+++ b/clang/test/SemaCXX/undefined-internal.cpp
@@ -1,9 +1,9 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 
 // Make sure we don't produce invalid IR.
-// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm-only %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm-only %s
 
-// FIXME: -cxx-abi itanium shouldn't be necessary; the test should pass
+// FIXME: Itanium shouldn't be necessary; the test should pass
 // in MS mode too.
 
 namespace test1 {
diff --git a/clang/test/SemaCXX/virtual-base-used.cpp b/clang/test/SemaCXX/virtual-base-used.cpp
index c2ff06b..c46cf5a 100644
--- a/clang/test/SemaCXX/virtual-base-used.cpp
+++ b/clang/test/SemaCXX/virtual-base-used.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -cxx-abi itanium -verify %s
-// RUN: %clang_cc1 -fsyntax-only -cxx-abi microsoft -DMSABI -verify %s
+// RUN: %clang_cc1 -fsyntax-only -triple %itanium_abi_triple -verify %s
+// RUN: %clang_cc1 -fsyntax-only -triple %ms_abi_triple -DMSABI -verify %s
 // PR7800
 
 // The Microsoft ABI doesn't have the concept of key functions, so we have different
diff --git a/clang/test/SemaCXX/virtual-override-x86.cpp b/clang/test/SemaCXX/virtual-override-x86.cpp
index 75d8af3..1d9d1fb 100644
--- a/clang/test/SemaCXX/virtual-override-x86.cpp
+++ b/clang/test/SemaCXX/virtual-override-x86.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple=i686-pc-unknown -fsyntax-only -verify %s -std=c++11 -cxx-abi microsoft
+// RUN: %clang_cc1 -triple=i686-pc-win32 -fsyntax-only -verify %s -std=c++11
 
 namespace PR14339 {
   class A {
diff --git a/clang/test/SemaCXX/virtual-override.cpp b/clang/test/SemaCXX/virtual-override.cpp
index 48444a6..e95acab 100644
--- a/clang/test/SemaCXX/virtual-override.cpp
+++ b/clang/test/SemaCXX/virtual-override.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -fsyntax-only -cxx-abi itanium -verify %s -std=c++11
-// RUN: %clang_cc1 -fsyntax-only -cxx-abi microsoft -verify %s -std=c++11
+// RUN: %clang_cc1 -fsyntax-only -triple %itanium_abi_triple -verify %s -std=c++11
+// RUN: %clang_cc1 -fsyntax-only -triple %ms_abi_triple -verify %s -std=c++11
 namespace T1 {
 
 class A {
diff --git a/clang/test/SemaCXX/warn-reinterpret-base-class.cpp b/clang/test/SemaCXX/warn-reinterpret-base-class.cpp
index f7d5bc5..0231f19 100644
--- a/clang/test/SemaCXX/warn-reinterpret-base-class.cpp
+++ b/clang/test/SemaCXX/warn-reinterpret-base-class.cpp
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -cxx-abi itanium -verify -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s
-// RUN: %clang_cc1 -std=c++11 -fsyntax-only -cxx-abi microsoft -DMSABI -verify -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -triple %itanium_abi_triple -verify -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -triple %ms_abi_triple -DMSABI -verify -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s
 
-// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -cxx-abi itanium -fdiagnostics-parseable-fixits -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s 2>&1 | FileCheck %s
-// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -cxx-abi microsoft -fdiagnostics-parseable-fixits -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -triple %itanium_abi_triple -fdiagnostics-parseable-fixits -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s 2>&1 | FileCheck %s
+// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -triple %ms_abi_triple -fdiagnostics-parseable-fixits -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s 2>&1 | FileCheck %s
 
 // PR 13824
 class A {
diff --git a/clang/test/SemaCXX/warn-weak-vtables.cpp b/clang/test/SemaCXX/warn-weak-vtables.cpp
index c49bbc0..671ff29 100644
--- a/clang/test/SemaCXX/warn-weak-vtables.cpp
+++ b/clang/test/SemaCXX/warn-weak-vtables.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -cxx-abi itanium -Wweak-vtables -Wweak-template-vtables
-// RUN: %clang_cc1 %s -fsyntax-only -cxx-abi microsoft -Werror -Wno-weak-vtables -Wno-weak-template-vtables
+// RUN: %clang_cc1 %s -fsyntax-only -verify -triple %itanium_abi_triple -Wweak-vtables -Wweak-template-vtables
+// RUN: %clang_cc1 %s -fsyntax-only -triple %ms_abi_triple -Werror -Wno-weak-vtables -Wno-weak-template-vtables
 
 struct A { // expected-warning {{'A' has no out-of-line virtual method definitions; its vtable will be emitted in every translation unit}}
   virtual void f() { } 
diff --git a/clang/test/SemaObjCXX/microsoft-abi-byval.mm b/clang/test/SemaObjCXX/microsoft-abi-byval.mm
index 9b3a5c9..a44f240 100644
--- a/clang/test/SemaObjCXX/microsoft-abi-byval.mm
+++ b/clang/test/SemaObjCXX/microsoft-abi-byval.mm
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -cxx-abi microsoft -Wno-objc-root-class %s
+// RUN: %clang_cc1 -fsyntax-only -verify -triple %ms_abi_triple -Wno-objc-root-class %s
 // expected-no-diagnostics
 
 class Foo {
diff --git a/clang/test/SemaTemplate/inject-templated-friend-post.cpp b/clang/test/SemaTemplate/inject-templated-friend-post.cpp
index b0aca68..0c82f40 100644
--- a/clang/test/SemaTemplate/inject-templated-friend-post.cpp
+++ b/clang/test/SemaTemplate/inject-templated-friend-post.cpp
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 %s -std=c++98 -cxx-abi itanium -emit-llvm -o - | FileCheck %s
-// RUN: %clang_cc1 %s -std=c++98 -cxx-abi itanium -emit-llvm -o - -DPROTOTYPE | FileCheck --check-prefix=CHECK-PROTOTYPE %s
-// RUN: %clang_cc1 %s -std=c++98 -cxx-abi itanium -emit-llvm -o - -DINSTANTIATE | FileCheck --check-prefix=CHECK-INSTANTIATE %s
-// RUN: %clang_cc1 %s -std=c++98 -cxx-abi itanium -emit-llvm -o - -DPROTOTYPE -DINSTANTIATE | FileCheck --check-prefix=CHECK-PROTOTYPE-INSTANTIATE %s
+// RUN: %clang_cc1 %s -std=c++98 -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -std=c++98 -triple %itanium_abi_triple -emit-llvm -o - -DPROTOTYPE | FileCheck --check-prefix=CHECK-PROTOTYPE %s
+// RUN: %clang_cc1 %s -std=c++98 -triple %itanium_abi_triple -emit-llvm -o - -DINSTANTIATE | FileCheck --check-prefix=CHECK-INSTANTIATE %s
+// RUN: %clang_cc1 %s -std=c++98 -triple %itanium_abi_triple -emit-llvm -o - -DPROTOTYPE -DINSTANTIATE | FileCheck --check-prefix=CHECK-PROTOTYPE-INSTANTIATE %s
 // RUN: %clang_cc1 %s -DREDEFINE -verify
 // RUN: %clang_cc1 %s -DPROTOTYPE -DREDEFINE -verify
 // PR8007: friend function not instantiated, reordered version.
diff --git a/clang/test/SemaTemplate/inject-templated-friend.cpp b/clang/test/SemaTemplate/inject-templated-friend.cpp
index 037d6675..d7cece4 100644
--- a/clang/test/SemaTemplate/inject-templated-friend.cpp
+++ b/clang/test/SemaTemplate/inject-templated-friend.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple %itanium_abi_triple -o - | FileCheck %s
 // RUN: %clang_cc1 %s -DREDEFINE -verify
 // PR8007: friend function not instantiated.
 
diff --git a/clang/test/SemaTemplate/instantiate-complete.cpp b/clang/test/SemaTemplate/instantiate-complete.cpp
index 0e169b9..a29e9d3 100644
--- a/clang/test/SemaTemplate/instantiate-complete.cpp
+++ b/clang/test/SemaTemplate/instantiate-complete.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -cxx-abi itanium -fsyntax-only -verify %s
-// RUN: %clang_cc1 -cxx-abi microsoft -DMSABI -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple %ms_abi_triple -DMSABI -fsyntax-only -verify %s
 
 // Tests various places where requiring a complete type involves
 // instantiation of that type.
diff --git a/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp b/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
index 59a0a60..a376f0e 100644
--- a/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
+++ b/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -cxx-abi itanium -std=c++11 -ftemplate-depth 16 -fcxx-exceptions -fexceptions %s
+// RUN: %clang_cc1 -fsyntax-only -verify -triple %itanium_abi_triple -std=c++11 -ftemplate-depth 16 -fcxx-exceptions -fexceptions %s
 
 // DR1330: an exception specification for a function template is only
 // instantiated when it is needed.
diff --git a/clang/test/SemaTemplate/virtual-member-functions.cpp b/clang/test/SemaTemplate/virtual-member-functions.cpp
index 005cd58..1a01808 100644
--- a/clang/test/SemaTemplate/virtual-member-functions.cpp
+++ b/clang/test/SemaTemplate/virtual-member-functions.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -cxx-abi itanium -fsyntax-only -verify %s
-// RUN: %clang_cc1 -cxx-abi microsoft -DMSABI -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple %ms_abi_triple -DMSABI -fsyntax-only -verify %s
 
 namespace PR5557 {
 template <class T> struct A {
diff --git a/clang/test/lit.cfg b/clang/test/lit.cfg
index ee011c6..48b2fad 100644
--- a/clang/test/lit.cfg
+++ b/clang/test/lit.cfg
@@ -228,6 +228,25 @@
     # Ensure the result is an ascii string, across Python2.5+ - Python3.
     return str(dir.decode('ascii'))
 
+def makeItaniumABITriple(triple):
+    m = re.match(r'(\w+)-(\w+)-(\w+)', triple)
+    if not m:
+      lit_config.fatal("Could not turn '%s' into Itanium ABI triple" % triple)
+    if m.group(3).lower() != 'win32':
+      # All non-win32 triples use the Itanium ABI.
+      return triple
+    return m.group(1) + '-' + m.group(2) + '-mingw32'
+
+def makeMSABITriple(triple):
+    m = re.match(r'(\w+)-(\w+)-(\w+)', triple)
+    if not m:
+      lit_config.fatal("Could not turn '%s' into MS ABI triple" % triple)
+    if m.group(3).lower() == 'win32':
+      # If the OS is win32, we're done.
+      return triple
+    # Otherwise, replace the OS part with Win32.
+    return m.group(1) + '-' + m.group(2) + '-win32'
+
 config.substitutions.append( ('%clang_cc1', '%s -cc1 -internal-isystem %s'
                               % (config.clang,
                                  getClangBuiltinIncludeDir(config.clang))) )
@@ -239,6 +258,8 @@
                               ' --driver-mode=g++ '))
 config.substitutions.append( ('%clang', ' ' + config.clang + ' ') )
 config.substitutions.append( ('%test_debuginfo', ' ' + config.llvm_src_root + '/utils/test_debuginfo.pl ') )
+config.substitutions.append( ('%itanium_abi_triple', makeItaniumABITriple(config.target_triple)) )
+config.substitutions.append( ('%ms_abi_triple', makeMSABITriple(config.target_triple)) )
 
 # FIXME: Find nicer way to prohibit this.
 config.substitutions.append(