Index: lib/Frontend/CompilerInvocation.cpp =================================================================== --- lib/Frontend/CompilerInvocation.cpp +++ lib/Frontend/CompilerInvocation.cpp @@ -1618,9 +1618,12 @@ // 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, const char *const *ArgBegin, Index: test/Analysis/inlining/dyn-dispatch-bifurcate.cpp =================================================================== --- test/Analysis/inlining/dyn-dispatch-bifurcate.cpp +++ test/Analysis/inlining/dyn-dispatch-bifurcate.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify %s +// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -analyzer-config ipa=dynamic-bifurcate -verify -Wno-reinterpret-base-class %s void clang_analyzer_eval(bool); Index: test/CXX/class.access/p4.cpp =================================================================== --- test/CXX/class.access/p4.cpp +++ test/CXX/class.access/p4.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -verify %s +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -cxx-abi itanium -verify %s +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -cxx-abi microsoft -DMSABI -verify %s // C++0x [class.access]p4: @@ -112,6 +113,9 @@ namespace test3 { class A { private: +#ifdef MSABI + // expected-note@+2 {{declared private here}} +#endif ~A(); // expected-note 2 {{declared private here}} static A foo; }; @@ -119,7 +123,10 @@ A a; // expected-error {{variable of type 'test3::A' has private destructor}} A A::foo; - void foo(A param) { // okay +#ifdef MSABI + // expected-error@+2 {{variable of type 'test3::A' has private destructor}} +#endif + void foo(A param) { // Okay in Itanium. A local; // expected-error {{variable of type 'test3::A' has private destructor}} } Index: test/CXX/dcl.dcl/dcl.link/p7.cpp =================================================================== --- test/CXX/dcl.dcl/dcl.link/p7.cpp +++ test/CXX/dcl.dcl/dcl.link/p7.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s struct X { }; @@ -7,8 +7,6 @@ // CHECK: @x2 = external global %struct.X // CHECK: @x3 = external global %struct.X extern "C" { - - X x1; } Index: test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp =================================================================== --- test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp +++ test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p2.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -emit-llvm -cxx-abi itanium %s -o - | FileCheck %s // constexpr functions and constexpr constructors are implicitly inline. struct S { Index: test/CXX/drs/dr2xx.cpp =================================================================== --- test/CXX/drs/dr2xx.cpp +++ test/CXX/drs/dr2xx.cpp @@ -534,36 +534,36 @@ namespace dr252 { // dr252: yes struct A { - void operator delete(void*); // expected-note {{found}} + void operator delete(void*); // expected-note 1-2 {{found}} }; struct B { - void operator delete(void*); // expected-note {{found}} + void operator delete(void*); // expected-note 1-2 {{found}} }; struct C : A, B { - virtual ~C(); + virtual ~C(); // expected-error 0-1 {{'operator delete' found in multiple base classes}} }; C::~C() {} // expected-error {{'operator delete' found in multiple base classes}} struct D { - void operator delete(void*, int); // expected-note {{here}} - virtual ~D(); + void operator delete(void*, int); // expected-note 1-2 {{here}} + virtual ~D(); // expected-error 0-1 {{no suitable member 'operator delete'}} }; D::~D() {} // expected-error {{no suitable member 'operator delete'}} struct E { void operator delete(void*, int); - void operator delete(void*) = delete; // expected-error 0-1{{extension}} expected-note {{here}} - virtual ~E(); + void operator delete(void*) = delete; // expected-error 0-1{{extension}} expected-note 1-2 {{here}} + virtual ~E(); // expected-error 0-1 {{attempt to use a deleted function}} }; - E::~E() {} // expected-error {{deleted}} + E::~E() {} // expected-error {{attempt to use a deleted function}} struct F { // If both functions are available, the first one is a placement delete. void operator delete(void*, size_t); - void operator delete(void*) = delete; // expected-error 0-1{{extension}} expected-note {{here}} - virtual ~F(); + void operator delete(void*) = delete; // expected-error 0-1{{extension}} expected-note 1-2 {{here}} + virtual ~F(); // expected-error 0-1 {{attempt to use a deleted function}} }; - F::~F() {} // expected-error {{deleted}} + F::~F() {} // expected-error {{attempt to use a deleted function}} struct G { void operator delete(void*, size_t); Index: test/CXX/special/class.copy/implicit-move-def.cpp =================================================================== --- test/CXX/special/class.copy/implicit-move-def.cpp +++ test/CXX/special/class.copy/implicit-move-def.cpp @@ -1,6 +1,6 @@ -// FIXME: %clang_cc1 -emit-llvm -o - -std=c++11 %s | FileCheck -check-prefix=CHECK %s -// RUN: %clang_cc1 -emit-llvm -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-ASSIGN %s -// RUN: %clang_cc1 -emit-llvm -o - -std=c++11 %s | FileCheck -check-prefix=CHECK-CTOR %s +// 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 // construct Index: test/CXX/special/class.dtor/p3-0x.cpp =================================================================== --- test/CXX/special/class.dtor/p3-0x.cpp +++ test/CXX/special/class.dtor/p3-0x.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -fexceptions -fcxx-exceptions -emit-llvm -o - %s | FileCheck %s struct A { ~A(); Index: test/CXX/special/class.dtor/p5-0x.cpp =================================================================== --- test/CXX/special/class.dtor/p5-0x.cpp +++ test/CXX/special/class.dtor/p5-0x.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -verify -std=c++11 %s +// RUN: %clang_cc1 -verify -cxx-abi itanium -std=c++11 %s +// RUN: %clang_cc1 -verify -cxx-abi microsoft -DMSABI -std=c++11 %s struct NonTrivDtor { ~NonTrivDtor(); @@ -94,6 +95,13 @@ // expected-error {{deleted function '~D2' cannot override a non-deleted}} // implicitly-virtual destructor } d2; // expected-error {{deleted function}} +#ifdef MSABI +// expected-error@+7 {{no suitable member 'operator delete' in 'D3'}} +// expected-note@+7 {{member 'operator delete' declared here}} +// expected-note@+7 {{member 'operator delete' declared here}} +// expected-error@+9 {{attempt to use a deleted function}} +// expected-note@+9 {{function has been explicitly marked deleted here}} +#endif struct D3 { // expected-note {{virtual destructor requires an unambiguous, accessible 'operator delete'}} virtual ~D3() = default; // expected-note {{explicitly defaulted function was implicitly deleted here}} void operator delete(void*, double = 0.0); Index: test/CXX/special/class.dtor/p9.cpp =================================================================== --- test/CXX/special/class.dtor/p9.cpp +++ test/CXX/special/class.dtor/p9.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -cxx-abi itanium -verify %s +// RUN: %clang_cc1 -fsyntax-only -cxx-abi microsoft -DMSABI -verify %s typedef typeof(sizeof(int)) size_t; @@ -28,12 +29,18 @@ namespace test1 { class A { public: +#ifdef MSABI + // expected-note@+2 {{declared here}} +#endif static void operator delete(void *p) {}; // expected-note {{member 'operator delete' declared here}} virtual ~A(); }; class B : protected A { public: +#ifdef MSABI + // expected-note@+2 {{declared here}} +#endif static void operator delete(void *, size_t) {}; // expected-note {{member 'operator delete' declared here}} ~B(); }; @@ -43,6 +50,9 @@ using A::operator delete; using B::operator delete; +#ifdef MSABI + // expected-error@+2 {{multiple suitable 'operator delete' functions in 'C'}} +#endif ~C(); }; @@ -52,12 +62,22 @@ // ...at the point of definition of a virtual destructor... namespace test2 { struct A { +#ifdef MSABI + // expected-error@+3 {{no suitable member 'operator delete' in 'A'}} + // expected-note@+3 {{declared here}} +#endif virtual ~A(); static void operator delete(void*, const int &); }; struct B { +#ifdef MSABI + // expected-error@+2 {{no suitable member 'operator delete' in 'B'}} +#endif virtual ~B(); +#ifdef MSABI + // expected-note@+2 {{declared here}} +#endif static void operator delete(void*, const int &); // expected-note {{declared here}} }; B::~B() {} // expected-error {{no suitable member 'operator delete' in 'B'}} @@ -74,7 +94,13 @@ // PR7346 namespace test3 { struct A { +#ifdef MSABI + // expected-error@+2 {{no suitable member 'operator delete' in 'A'}} +#endif virtual ~A(); +#ifdef MSABI + // expected-note@+2 {{declared here}} +#endif static void operator delete(void*, const int &); }; Index: test/CodeGen/builtin-ms-noop.cpp =================================================================== --- test/CodeGen/builtin-ms-noop.cpp +++ test/CodeGen/builtin-ms-noop.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fms-extensions -triple i686-pc-win32 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -fms-extensions -triple i686-pc-win32 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s class A { public: @@ -11,4 +11,3 @@ // CHECK: ret void __noop(A()); }; - Index: test/CodeGen/captured-statements.c =================================================================== --- test/CodeGen/captured-statements.c +++ test/CodeGen/captured-statements.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o %t +// RUN: %clang_cc1 -cxx-abi itanium -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 Index: test/CodeGen/complex-convert.c =================================================================== --- test/CodeGen/complex-convert.c +++ test/CodeGen/complex-convert.c @@ -22,9 +22,14 @@ _Complex signed long long csll1; _Complex unsigned long long cull1; // CHECK-LABEL: define void @foo( - // CHECK: alloca i[[CHSIZE:[0-9]+]], align [[CHALIGN:[0-9]+]] - // CHECK-NEXT: alloca i[[CHSIZE]], align [[CHALIGN]] - // CHECK-NEXT: alloca i[[LLSIZE:[0-9]+]], align [[LLALIGN:[0-9]+]] + // Match the prototype to pick up the size of sc and sll. + // CHECK: i[[CHSIZE:[0-9]+]]{{[^,]*}}, + // CHECK: i[[CHSIZE]]{{[^,]*}}, + // CHECK: i[[LLSIZE:[0-9]+]] + + // Match against the allocas to pick up the alignments. + // CHECK: alloca i[[CHSIZE]], align [[CHALIGN:[0-9]+]] + // CHECK: alloca i[[LLSIZE]], align [[LLALIGN:[0-9]+]] sc1 = csc; // CHECK: %[[VAR1:[A-Za-z0-9.]+]] = getelementptr inbounds { i[[CHSIZE]], i[[CHSIZE]] }* %[[CSC:[A-Za-z0-9.]+]], i{{[0-9]+}} 0, i{{[0-9]+}} 0 Index: test/CodeGen/cxx-default-arg.cpp =================================================================== --- test/CodeGen/cxx-default-arg.cpp +++ test/CodeGen/cxx-default-arg.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o %t +// RUN: %clang_cc1 -cxx-abi itanium -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 Index: test/CodeGen/fp-contract-pragma.cpp =================================================================== --- test/CodeGen/fp-contract-pragma.cpp +++ test/CodeGen/fp-contract-pragma.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -O3 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -O3 -cxx-abi itanium -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) { Index: test/CodeGen/overloadable.c =================================================================== --- test/CodeGen/overloadable.c +++ test/CodeGen/overloadable.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | grep _Z1fPA10_1X +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | grep _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; } Index: test/CodeGen/tbaa-for-vptr.cpp =================================================================== --- test/CodeGen/tbaa-for-vptr.cpp +++ test/CodeGen/tbaa-for-vptr.cpp @@ -1,9 +1,9 @@ -// RUN: %clang_cc1 -emit-llvm -o - -fsanitize=thread %s | FileCheck %s -// RUN: %clang_cc1 -emit-llvm -o - -O1 %s | FileCheck %s -// RUN: %clang_cc1 -emit-llvm -o - -O1 -relaxed-aliasing -fsanitize=thread %s | FileCheck %s +// 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 -emit-llvm -o - %s | FileCheck %s --check-prefix=NOTBAA -// RUN: %clang_cc1 -emit-llvm -o - -O2 -relaxed-aliasing %s | FileCheck %s --check-prefix=NOTBAA +// 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 // // Check that we generate TBAA for vtable pointer loads and stores. // When -fthread-sanitizer is used TBAA should be generated at all opt levels Index: test/CodeGenCUDA/filter-decl.cu =================================================================== --- test/CodeGenCUDA/filter-decl.cu +++ test/CodeGenCUDA/filter-decl.cu @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-HOST %s -// RUN: %clang_cc1 -emit-llvm %s -o - -fcuda-is-device | FileCheck -check-prefix=CHECK-DEVICE %s +// 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 #include "../SemaCUDA/cuda.h" Index: test/CodeGenCXX/2003-11-27-MultipleInheritanceThunk.cpp =================================================================== --- test/CodeGenCXX/2003-11-27-MultipleInheritanceThunk.cpp +++ test/CodeGenCXX/2003-11-27-MultipleInheritanceThunk.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - +// RUN: %clang_cc1 -cxx-abi microsoft -fno-rtti -emit-llvm %s -o - struct CallSite { Index: test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp =================================================================== --- test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp +++ test/CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - +// RUN: %clang_cc1 -cxx-abi microsoft -fno-rtti -emit-llvm %s -o - struct A { virtual void Method() = 0; Index: test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp =================================================================== --- test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp +++ test/CodeGenCXX/2004-03-09-UnmangledBuiltinMethods.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s // CHECK: _ZN11AccessFlags6strlenEv struct AccessFlags { Index: test/CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp =================================================================== --- test/CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp +++ test/CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s +// RUN: %clang_cc1 -cxx-abi microsoft -fno-rtti -emit-llvm -o - %s struct A { virtual ~A(); Index: test/CodeGenCXX/2010-05-11-alwaysinlineinstantiation.cpp =================================================================== --- test/CodeGenCXX/2010-05-11-alwaysinlineinstantiation.cpp +++ test/CodeGenCXX/2010-05-11-alwaysinlineinstantiation.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium %s -o - | FileCheck %s // CHECK-NOT: ZN12basic_stringIcEC1Ev // CHECK: ZN12basic_stringIcED1Ev Index: test/CodeGenCXX/PR5093-static-member-function.cpp =================================================================== --- test/CodeGenCXX/PR5093-static-member-function.cpp +++ test/CodeGenCXX/PR5093-static-member-function.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s struct a { static void f(); }; Index: test/CodeGenCXX/PR5863-unreachable-block.cpp =================================================================== --- test/CodeGenCXX/PR5863-unreachable-block.cpp +++ test/CodeGenCXX/PR5863-unreachable-block.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -emit-llvm-only %s +// RUN: %clang_cc1 -cxx-abi itanium -fcxx-exceptions -fexceptions -emit-llvm-only %s // PR5863 class E { }; Index: test/CodeGenCXX/address-of-fntemplate.cpp =================================================================== --- test/CodeGenCXX/address-of-fntemplate.cpp +++ test/CodeGenCXX/address-of-fntemplate.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s template void f(T) {} template void f() { } Index: test/CodeGenCXX/attr-cleanup.cpp =================================================================== --- test/CodeGenCXX/attr-cleanup.cpp +++ test/CodeGenCXX/attr-cleanup.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s namespace N { void free(void *i) {} Index: test/CodeGenCXX/attr-used.cpp =================================================================== --- test/CodeGenCXX/attr-used.cpp +++ test/CodeGenCXX/attr-used.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s // : clang++ not respecting __attribute__((used)) on destructors struct X0 { Index: test/CodeGenCXX/block-byref-cxx-objc.cpp =================================================================== --- test/CodeGenCXX/block-byref-cxx-objc.cpp +++ test/CodeGenCXX/block-byref-cxx-objc.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - -fblocks | FileCheck %s // rdar://8594790 struct A { Index: test/CodeGenCXX/block.cpp =================================================================== --- test/CodeGenCXX/block.cpp +++ test/CodeGenCXX/block.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - -fblocks +// RUN: %clang_cc1 %s -cxx-abi microsoft -fno-rtti -emit-llvm -o - -fblocks // Just test that this doesn't crash the compiler... void func(void*); Index: test/CodeGenCXX/c-linkage.cpp =================================================================== --- test/CodeGenCXX/c-linkage.cpp +++ test/CodeGenCXX/c-linkage.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s // pr6644 extern "C" { Index: test/CodeGenCXX/captured-statements.cpp =================================================================== --- test/CodeGenCXX/captured-statements.cpp +++ test/CodeGenCXX/captured-statements.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o %t +// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -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 Index: test/CodeGenCXX/const-base-cast.cpp =================================================================== --- test/CodeGenCXX/const-base-cast.cpp +++ test/CodeGenCXX/const-base-cast.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s // Check that the following construct, which is similar to one which occurs // in Firefox, is folded correctly. Index: test/CodeGenCXX/const-global-linkage.cpp =================================================================== --- test/CodeGenCXX/const-global-linkage.cpp +++ test/CodeGenCXX/const-global-linkage.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s const int x = 10; const int y = 20; Index: test/CodeGenCXX/constructor-attr.cpp =================================================================== --- test/CodeGenCXX/constructor-attr.cpp +++ test/CodeGenCXX/constructor-attr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s // CHECK: @llvm.global_ctors Index: test/CodeGenCXX/constructor-direct-call.cpp =================================================================== --- test/CodeGenCXX/constructor-direct-call.cpp +++ test/CodeGenCXX/constructor-direct-call.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i686-pc-win32 -fms-extensions -Wmicrosoft %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -triple i686-pc-mingw32 -fms-extensions -Wmicrosoft %s -emit-llvm -o - | FileCheck %s class Test1 { public: @@ -22,10 +22,10 @@ void f2() { // CHECK: %var = alloca %class.Test2, align 4 - // CHECK-NEXT: call void @_ZN5Test2C1Ev(%class.Test2* %var) + // CHECK-NEXT: call x86_thiscallcc void @_ZN5Test2C1Ev(%class.Test2* %var) Test2 var; - // CHECK-NEXT: call void @_ZN5Test2C1Ev(%class.Test2* %var) + // CHECK-NEXT: call x86_thiscallcc void @_ZN5Test2C1Ev(%class.Test2* %var) var.Test2::Test2(); // CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %{{.*}}, i8* %{{.*}}, i32 8, i32 4, i1 false) @@ -45,16 +45,16 @@ }; void f3() { - // CHECK: call void @_ZN5Test3C1Ev(%class.Test3* %var) + // CHECK: call x86_thiscallcc void @_ZN5Test3C1Ev(%class.Test3* %var) Test3 var; - // CHECK-NEXT: call void @_ZN5Test3C1Ev(%class.Test3* %var2) + // CHECK-NEXT: call x86_thiscallcc void @_ZN5Test3C1Ev(%class.Test3* %var2) Test3 var2; - // CHECK-NEXT: call void @_ZN5Test3C1Ev(%class.Test3* %var) + // CHECK-NEXT: call x86_thiscallcc void @_ZN5Test3C1Ev(%class.Test3* %var) var.Test3::Test3(); - // CHECK-NEXT: call void @_ZN5Test3C1ERKS_(%class.Test3* %var, %class.Test3* %var2) + // CHECK-NEXT: call x86_thiscallcc void @_ZN5Test3C1ERKS_(%class.Test3* %var, %class.Test3* %var2) var.Test3::Test3(var2); } Index: test/CodeGenCXX/constructor-init-reference.cpp =================================================================== --- test/CodeGenCXX/constructor-init-reference.cpp +++ test/CodeGenCXX/constructor-init-reference.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | grep "store i32\* @x, i32\*\*" +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s int x; struct A { @@ -6,4 +6,4 @@ A() : y(x) {} }; A z; - +// CHECK: store i32* @x, i32** Index: test/CodeGenCXX/copy-assign-synthesis-2.cpp =================================================================== --- test/CodeGenCXX/copy-assign-synthesis-2.cpp +++ test/CodeGenCXX/copy-assign-synthesis-2.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s struct A {}; A& (A::*x)(const A&) = &A::operator=; // CHECK-LABEL: define linkonce_odr {{.*}}%struct.A* @_ZN1AaSERKS_ Index: test/CodeGenCXX/copy-constructor-synthesis-2.cpp =================================================================== --- test/CodeGenCXX/copy-constructor-synthesis-2.cpp +++ test/CodeGenCXX/copy-constructor-synthesis-2.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s struct A { virtual void a(); }; A x(A& y) { return y; } Index: test/CodeGenCXX/coverage.cpp =================================================================== --- test/CodeGenCXX/coverage.cpp +++ test/CodeGenCXX/coverage.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - -test-coverage -femit-coverage-notes | FileCheck %s +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - -test-coverage -femit-coverage-notes | FileCheck %s extern "C" void test_name1() {} void test_name2() {} Index: test/CodeGenCXX/cxx0x-defaulted-templates.cpp =================================================================== --- test/CodeGenCXX/cxx0x-defaulted-templates.cpp +++ test/CodeGenCXX/cxx0x-defaulted-templates.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s template struct X { Index: test/CodeGenCXX/cxx11-noreturn.cpp =================================================================== --- test/CodeGenCXX/cxx11-noreturn.cpp +++ test/CodeGenCXX/cxx11-noreturn.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -std=c++11 %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -std=c++11 %s -o - | FileCheck %s int g(); Index: test/CodeGenCXX/cxx11-unrestricted-union.cpp =================================================================== --- test/CodeGenCXX/cxx11-unrestricted-union.cpp +++ test/CodeGenCXX/cxx11-unrestricted-union.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -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(); Index: test/CodeGenCXX/debug-info-char16.cpp =================================================================== --- test/CodeGenCXX/debug-info-char16.cpp +++ test/CodeGenCXX/debug-info-char16.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -std=c++11 -g %s -o -| FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -std=c++11 -g %s -o -| FileCheck %s // 16 is DW_ATE_UTF (0x10) encoding attribute. char16_t char_a = u'h'; Index: test/CodeGenCXX/debug-info-enum.cpp =================================================================== --- test/CodeGenCXX/debug-info-enum.cpp +++ test/CodeGenCXX/debug-info-enum.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -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]*]]} Index: test/CodeGenCXX/debug-info-gline-tables-only.cpp =================================================================== --- test/CodeGenCXX/debug-info-gline-tables-only.cpp +++ test/CodeGenCXX/debug-info-gline-tables-only.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -gline-tables-only -S -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -fno-rtti -gline-tables-only -S -emit-llvm -o - | FileCheck %s // Checks that clang with "-gline-tables-only" doesn't emit debug info // for variables and types. Index: test/CodeGenCXX/debug-info-global-ctor-dtor.cpp =================================================================== --- test/CodeGenCXX/debug-info-global-ctor-dtor.cpp +++ test/CodeGenCXX/debug-info-global-ctor-dtor.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 %s -g -fno-use-cxa-atexit -S -emit-llvm -o - \ +// RUN: %clang_cc1 %s -g -cxx-abi itanium -fno-use-cxa-atexit -S -emit-llvm -o - \ // RUN: | FileCheck %s --check-prefix=CHECK-NOKEXT -// RUN: %clang_cc1 %s -g -fno-use-cxa-atexit -fapple-kext -S -emit-llvm -o - \ +// RUN: %clang_cc1 %s -g -cxx-abi itanium -fno-use-cxa-atexit -fapple-kext -S -emit-llvm -o - \ // RUN: | FileCheck %s --check-prefix=CHECK-KEXT class A { Index: test/CodeGenCXX/debug-info-method.cpp =================================================================== --- test/CodeGenCXX/debug-info-method.cpp +++ test/CodeGenCXX/debug-info-method.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -std=c++11 -g %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -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] Index: test/CodeGenCXX/debug-info-same-line.cpp =================================================================== --- test/CodeGenCXX/debug-info-same-line.cpp +++ test/CodeGenCXX/debug-info-same-line.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -g -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -g -cxx-abi itanium -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 Index: test/CodeGenCXX/debug-info-template-limit.cpp =================================================================== --- test/CodeGenCXX/debug-info-template-limit.cpp +++ test/CodeGenCXX/debug-info-template-limit.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -flimit-debug-info -emit-llvm -g -S %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -flimit-debug-info -cxx-abi itanium -g %s -o - | FileCheck %s // Check that this pointer type is TC // CHECK: ![[LINE:[0-9]+]] = {{.*}}"TC", {{.*}} metadata !"_ZTS2TCIiE"} ; [ DW_TAG_class_type ] Index: test/CodeGenCXX/debug-info-thunk.cpp =================================================================== --- test/CodeGenCXX/debug-info-thunk.cpp +++ test/CodeGenCXX/debug-info-thunk.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -g -S -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -cxx-abi itanium -g -S -emit-llvm -o - | FileCheck %s struct A { virtual void f(); Index: test/CodeGenCXX/debug-info-use-after-free.cpp =================================================================== --- test/CodeGenCXX/debug-info-use-after-free.cpp +++ test/CodeGenCXX/debug-info-use-after-free.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -g -emit-llvm-only %s +// RUN: %clang_cc1 -g -cxx-abi itanium -emit-llvm-only %s // Check that we don't crash. // PR12305, PR12315 Index: test/CodeGenCXX/default-constructor-default-argument.cpp =================================================================== --- test/CodeGenCXX/default-constructor-default-argument.cpp +++ test/CodeGenCXX/default-constructor-default-argument.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s // Check that call to constructor for struct A is generated correctly. struct A { A(int x = 2); }; Index: test/CodeGenCXX/default-constructor-template-member.cpp =================================================================== --- test/CodeGenCXX/default-constructor-template-member.cpp +++ test/CodeGenCXX/default-constructor-template-member.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s template struct A { A(); }; struct B { A x; }; Index: test/CodeGenCXX/default-destructor-nested.cpp =================================================================== --- test/CodeGenCXX/default-destructor-nested.cpp +++ test/CodeGenCXX/default-destructor-nested.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm-only +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm-only // PR6294 class A { Index: test/CodeGenCXX/deferred-global-init.cpp =================================================================== --- test/CodeGenCXX/deferred-global-init.cpp +++ test/CodeGenCXX/deferred-global-init.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s // PR5967 extern void* foo; Index: test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp =================================================================== --- test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp +++ test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s struct A { int i; }; struct B { char j; }; Index: test/CodeGenCXX/destructor-exception-spec.cpp =================================================================== --- test/CodeGenCXX/destructor-exception-spec.cpp +++ test/CodeGenCXX/destructor-exception-spec.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -emit-llvm-only %s -std=c++11 -// RUN: %clang_cc1 -emit-llvm-only -fno-use-cxa-atexit %s -std=c++11 +// 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 // PR13479: don't crash with -fno-exceptions. Index: test/CodeGenCXX/duplicate-mangled-name.cpp =================================================================== --- test/CodeGenCXX/duplicate-mangled-name.cpp +++ test/CodeGenCXX/duplicate-mangled-name.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm-only %s -verify +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm-only %s -verify // rdar://15522601 class MyClass { Index: test/CodeGenCXX/dynamic_cast-no-rtti.cpp =================================================================== --- test/CodeGenCXX/dynamic_cast-no-rtti.cpp +++ test/CodeGenCXX/dynamic_cast-no-rtti.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -verify -fno-rtti -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm %s -verify -fno-rtti -cxx-abi itanium -o - | FileCheck %s // expected-no-diagnostics struct A { Index: test/CodeGenCXX/elide-call-reference.cpp =================================================================== --- test/CodeGenCXX/elide-call-reference.cpp +++ test/CodeGenCXX/elide-call-reference.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s // PR5695 struct A { A(const A&); ~A(); }; Index: test/CodeGenCXX/extern-c.cpp =================================================================== --- test/CodeGenCXX/extern-c.cpp +++ test/CodeGenCXX/extern-c.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s namespace foo { // CHECK-NOT: @a = global i32 Index: test/CodeGenCXX/function-template-explicit-specialization.cpp =================================================================== --- test/CodeGenCXX/function-template-explicit-specialization.cpp +++ test/CodeGenCXX/function-template-explicit-specialization.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium %s -o - | FileCheck %s template void a(T); template<> void a(int) {} Index: test/CodeGenCXX/function-template-specialization.cpp =================================================================== --- test/CodeGenCXX/function-template-specialization.cpp +++ test/CodeGenCXX/function-template-specialization.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium %s -o - | FileCheck %s template T* next(T* ptr, const U& diff); Index: test/CodeGenCXX/global-llvm-constant.cpp =================================================================== --- test/CodeGenCXX/global-llvm-constant.cpp +++ test/CodeGenCXX/global-llvm-constant.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s struct A { A() { x = 10; } Index: test/CodeGenCXX/implicit-instantiation-1.cpp =================================================================== --- test/CodeGenCXX/implicit-instantiation-1.cpp +++ test/CodeGenCXX/implicit-instantiation-1.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o %t +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium %s -o %t template struct X { Index: test/CodeGenCXX/instrument-functions.cpp =================================================================== --- test/CodeGenCXX/instrument-functions.cpp +++ test/CodeGenCXX/instrument-functions.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -S -emit-llvm -o - %s -finstrument-functions | FileCheck %s +// RUN: %clang_cc1 -S -emit-llvm -cxx-abi itanium -o - %s -finstrument-functions | FileCheck %s // CHECK: @_Z5test1i int test1(int x) { Index: test/CodeGenCXX/internal-linkage.cpp =================================================================== --- test/CodeGenCXX/internal-linkage.cpp +++ test/CodeGenCXX/internal-linkage.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s struct Global { Global(); }; template struct X { X() {} }; Index: test/CodeGenCXX/mangle-abi-examples.cpp =================================================================== --- test/CodeGenCXX/mangle-abi-examples.cpp +++ test/CodeGenCXX/mangle-abi-examples.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s // CHECK: @_ZTVZ3foovEN1C1DE = // CHECK: @_ZTVZN1A3fooEiE1B = Index: test/CodeGenCXX/mangle-address-space.cpp =================================================================== --- test/CodeGenCXX/mangle-address-space.cpp +++ test/CodeGenCXX/mangle-address-space.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s // CHECK-LABEL: define void @_Z2f0Pc void f0(char *p) { } Index: test/CodeGenCXX/mangle-local-class-names.cpp =================================================================== --- test/CodeGenCXX/mangle-local-class-names.cpp +++ test/CodeGenCXX/mangle-local-class-names.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s // CHECK: @_ZZ4FUNCvEN4SSSSC1ERKf // CHECK: @_ZZ4FUNCvEN4SSSSC2E_0RKf Index: test/CodeGenCXX/mangle-local-class-vtables.cpp =================================================================== --- test/CodeGenCXX/mangle-local-class-vtables.cpp +++ test/CodeGenCXX/mangle-local-class-vtables.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s // CHECK: @_ZTVZN1J1KEvE1C = {{.*}} @_ZTIZN1J1KEvE1C {{.*}} @_ZZN1J1KEvENK1C1FEv // CHECK: @_ZTIZN1J1KEvE1C = {{.*}} @_ZTSZN1J1KEvE1C Index: test/CodeGenCXX/mangle-local-classes-nested.cpp =================================================================== --- test/CodeGenCXX/mangle-local-classes-nested.cpp +++ test/CodeGenCXX/mangle-local-classes-nested.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s // CHECK: @_ZTVZZ1HvEN1S1IEvE1S = Index: test/CodeGenCXX/mangle-nullptr-arg.cpp =================================================================== --- test/CodeGenCXX/mangle-nullptr-arg.cpp +++ test/CodeGenCXX/mangle-nullptr-arg.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s template struct IP {}; Index: test/CodeGenCXX/mangle-std-externc.cpp =================================================================== --- test/CodeGenCXX/mangle-std-externc.cpp +++ test/CodeGenCXX/mangle-std-externc.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 %s -DNS=std -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-STD -// RUN: %clang_cc1 %s -DNS=n -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-N +// 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 // _ZNSt1DISt1CE1iE = std::D::i // CHECK-STD: @_ZNSt1DISt1CE1iE = Index: test/CodeGenCXX/mangle-template.cpp =================================================================== --- test/CodeGenCXX/mangle-template.cpp +++ test/CodeGenCXX/mangle-template.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s | FileCheck %s namespace test1 { int x; template class T { }; Index: test/CodeGenCXX/member-alignment.cpp =================================================================== --- test/CodeGenCXX/member-alignment.cpp +++ test/CodeGenCXX/member-alignment.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium %s -o - | FileCheck %s // rdar://7268289 Index: test/CodeGenCXX/microsoft-interface.cpp =================================================================== --- test/CodeGenCXX/microsoft-interface.cpp +++ test/CodeGenCXX/microsoft-interface.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -fms-extensions -Wno-microsoft -triple=i386-pc-win32 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -fms-extensions -Wno-microsoft -triple=i386-pc-mingw32 -emit-llvm %s -o - | FileCheck %s __interface I { int test() { @@ -20,23 +20,23 @@ // CHECK: @_ZTV1S = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1S to i8*), i8* bitcast (i32 (%struct.S*)* @_ZN1S4testEv to i8*)] // CHECK-LABEL: define i32 @_Z2fnv() -// CHECK: call void @_ZN1SC1Ev(%struct.S* %s) -// CHECK: %{{[.0-9A-Z_a-z]+}} = call i32 @_ZN1S4testEv(%struct.S* %s) +// CHECK: call x86_thiscallcc void @_ZN1SC1Ev(%struct.S* %s) +// CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc i32 @_ZN1S4testEv(%struct.S* %s) -// CHECK-LABEL: define linkonce_odr void @_ZN1SC1Ev(%struct.S* %this) -// CHECK: call void @_ZN1SC2Ev(%struct.S* %{{[.0-9A-Z_a-z]+}}) +// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @_ZN1SC1Ev(%struct.S* %this) +// CHECK: call x86_thiscallcc void @_ZN1SC2Ev(%struct.S* %{{[.0-9A-Z_a-z]+}}) -// CHECK-LABEL: define linkonce_odr i32 @_ZN1S4testEv(%struct.S* %this) -// CHECK: %{{[.0-9A-Z_a-z]+}} = call i32 @_ZN1I4testEv(%__interface.I* %{{[.0-9A-Z_a-z]+}}) +// CHECK-LABEL: define linkonce_odr x86_thiscallcc i32 @_ZN1S4testEv(%struct.S* %this) +// CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc i32 @_ZN1I4testEv(%__interface.I* %{{[.0-9A-Z_a-z]+}}) -// CHECK-LABEL: define linkonce_odr i32 @_ZN1I4testEv(%__interface.I* %this) +// CHECK-LABEL: define linkonce_odr x86_thiscallcc i32 @_ZN1I4testEv(%__interface.I* %this) // CHECK: ret i32 1 -// CHECK-LABEL: define linkonce_odr void @_ZN1SC2Ev(%struct.S* %this) -// CHECK: call void @_ZN1IC2Ev(%__interface.I* %{{[.0-9A-Z_a-z]+}}) +// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @_ZN1SC2Ev(%struct.S* %this) +// CHECK: call x86_thiscallcc void @_ZN1IC2Ev(%__interface.I* %{{[.0-9A-Z_a-z]+}}) // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1S, i64 0, i64 2), i8*** %{{[.0-9A-Z_a-z]+}} -// CHECK-LABEL: define linkonce_odr void @_ZN1IC2Ev(%__interface.I* %this) +// CHECK-LABEL: define linkonce_odr x86_thiscallcc void @_ZN1IC2Ev(%__interface.I* %this) // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1I, i64 0, i64 2), i8*** %{{[.0-9A-Z_a-z]+}} // CHECK-NOT-LABEL: define linkonce_odr %__interface.I* @_ZN1IaSERKS_(%__interface.I* %this, %__interface.I*) Index: test/CodeGenCXX/microsoft-new.cpp =================================================================== --- test/CodeGenCXX/microsoft-new.cpp +++ test/CodeGenCXX/microsoft-new.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple i686-pc-win32 -fms-compatibility %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi itanium -fms-compatibility %s -emit-llvm -o - | FileCheck %s #include Index: test/CodeGenCXX/microsoft-uuidof.cpp =================================================================== --- test/CodeGenCXX/microsoft-uuidof.cpp +++ test/CodeGenCXX/microsoft-uuidof.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -triple=i386-pc-win32 -fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-GUID -// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -fms-extensions | FileCheck %s -// RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -DWRONG_GUID -triple=i386-pc-win32 -fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-WRONG-GUID +// 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 #ifdef DEFINE_GUID struct _GUID { Index: test/CodeGenCXX/ms_wide_predefined_expr.cpp =================================================================== --- test/CodeGenCXX/ms_wide_predefined_expr.cpp +++ test/CodeGenCXX/ms_wide_predefined_expr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -fms-extensions -triple i686-pc-win32 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -fms-extensions -triple i686-pc-win32 -cxx-abi itanium -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 Index: test/CodeGenCXX/noinline-template.cpp =================================================================== --- test/CodeGenCXX/noinline-template.cpp +++ test/CodeGenCXX/noinline-template.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s // This was a problem in Sema, but only shows up as noinline missing // in CodeGen. Index: test/CodeGenCXX/pr11797.cpp =================================================================== --- test/CodeGenCXX/pr11797.cpp +++ test/CodeGenCXX/pr11797.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -fvisibility hidden -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -fvisibility hidden -cxx-abi itanium -emit-llvm -o - | FileCheck %s namespace std __attribute__ ((__visibility__ ("default"))) {} #pragma GCC visibility push(default) Index: test/CodeGenCXX/pr12104.cpp =================================================================== --- test/CodeGenCXX/pr12104.cpp +++ test/CodeGenCXX/pr12104.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -include %S/pr12104.h %s -emit-llvm -o - | FileCheck %s -// RUN: %clang_cc1 -x c++ -emit-pch -o %t %S/pr12104.h -// RUN: %clang_cc1 -include-pch %t %s -emit-llvm -o - | FileCheck %s +// 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 template struct Patch<1>; Index: test/CodeGenCXX/pr9965.cpp =================================================================== --- test/CodeGenCXX/pr9965.cpp +++ test/CodeGenCXX/pr9965.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s struct A { A(); }; template struct X : A // default constructor is not trivial Index: test/CodeGenCXX/pragma-weak.cpp =================================================================== --- test/CodeGenCXX/pragma-weak.cpp +++ test/CodeGenCXX/pragma-weak.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s #pragma weak zex int zex; Index: test/CodeGenCXX/predefined-expr.cpp =================================================================== --- test/CodeGenCXX/predefined-expr.cpp +++ test/CodeGenCXX/predefined-expr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -std=c++11 %s -cxx-abi itanium -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" Index: test/CodeGenCXX/reference-field.cpp =================================================================== --- test/CodeGenCXX/reference-field.cpp +++ test/CodeGenCXX/reference-field.cpp @@ -1,6 +1,8 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s -O2 | grep "@_Z1bv" +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -o - %s -O2 | FileCheck %s // Make sure the call to b() doesn't get optimized out. extern struct x {char& x,y;}y; int b(); int a() { if (!&y.x) b(); } + +// CHECK: @_Z1bv Index: test/CodeGenCXX/reference-init.cpp =================================================================== --- test/CodeGenCXX/reference-init.cpp +++ test/CodeGenCXX/reference-init.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm-only -verify %s +// RUN: %clang_cc1 -emit-llvm-only -cxx-abi itanium -verify %s // expected-no-diagnostics struct XPTParamDescriptor {}; Index: test/CodeGenCXX/return.cpp =================================================================== --- test/CodeGenCXX/return.cpp +++ test/CodeGenCXX/return.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s -// RUN: %clang_cc1 -emit-llvm -O -o - %s | FileCheck %s --check-prefix=CHECK-OPT +// 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 // CHECK: @_Z9no_return // CHECK-OPT: @_Z9no_return Index: test/CodeGenCXX/scoped-enums.cpp =================================================================== --- test/CodeGenCXX/scoped-enums.cpp +++ test/CodeGenCXX/scoped-enums.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -std=c++11 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s // PR9923 enum class Color { red, blue, green }; Index: test/CodeGenCXX/specialized-static-data-mem-init.cpp =================================================================== --- test/CodeGenCXX/specialized-static-data-mem-init.cpp +++ test/CodeGenCXX/specialized-static-data-mem-init.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s // rdar: // 8562966 // pr8409 Index: test/CodeGenCXX/stmtexpr.cpp =================================================================== --- test/CodeGenCXX/stmtexpr.cpp +++ test/CodeGenCXX/stmtexpr.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-unused-value -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -Wno-unused-value -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s // rdar: //8540501 extern "C" int printf(...); extern "C" void abort(); Index: test/CodeGenCXX/template-dependent-bind-temporary.cpp =================================================================== --- test/CodeGenCXX/template-dependent-bind-temporary.cpp +++ test/CodeGenCXX/template-dependent-bind-temporary.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s // rdar: //8620524 // PR7851 struct string { Index: test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp =================================================================== --- test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp +++ test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fvisibility hidden -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fvisibility hidden -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s // Verify that symbols are hidden. // CHECK: @_ZN1CIiE5Inner6Inner26StaticE = weak_odr hidden global Index: test/CodeGenCXX/throw-expression-dtor.cpp =================================================================== --- test/CodeGenCXX/throw-expression-dtor.cpp +++ test/CodeGenCXX/throw-expression-dtor.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm-only -verify -fcxx-exceptions -fexceptions +// RUN: %clang_cc1 %s -emit-llvm-only -verify -cxx-abi itanium -fcxx-exceptions -fexceptions // expected-no-diagnostics // PR7281 Index: test/CodeGenCXX/thunk-use-after-free.cpp =================================================================== --- test/CodeGenCXX/thunk-use-after-free.cpp +++ test/CodeGenCXX/thunk-use-after-free.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm-only -O1 %s +// RUN: %clang_cc1 -emit-llvm-only -cxx-abi itanium -O1 %s // This used to crash under asan and valgrind. // PR12284 Index: test/CodeGenCXX/trivial-constructor-init.cpp =================================================================== --- test/CodeGenCXX/trivial-constructor-init.cpp +++ test/CodeGenCXX/trivial-constructor-init.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - -std=c++11 | FileCheck %s +// RUN: %clang_cc1 -emit-llvm %s -o - -std=c++11 -cxx-abi itanium | FileCheck %s extern "C" int printf(...); Index: test/CodeGenCXX/vararg-non-pod.cpp =================================================================== --- test/CodeGenCXX/vararg-non-pod.cpp +++ test/CodeGenCXX/vararg-non-pod.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-error=non-pod-varargs -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -Wno-error=non-pod-varargs -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s struct X { X(); Index: test/CodeGenCXX/virt-dtor-gen.cpp =================================================================== --- test/CodeGenCXX/virt-dtor-gen.cpp +++ test/CodeGenCXX/virt-dtor-gen.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -o - -emit-llvm %s | FileCheck %s +// RUN: %clang_cc1 -o - -cxx-abi itanium -emit-llvm %s | FileCheck %s // PR5483 // Make sure we generate all three forms of the destructor when it is virtual. Index: test/CodeGenCXX/virt-dtor-key.cpp =================================================================== --- test/CodeGenCXX/virt-dtor-key.cpp +++ test/CodeGenCXX/virt-dtor-key.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s // CHECK: @_ZTI3foo = unnamed_addr constant class foo { foo(); Index: test/CodeGenCXX/virt-template-vtable.cpp =================================================================== --- test/CodeGenCXX/virt-template-vtable.cpp +++ test/CodeGenCXX/virt-template-vtable.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s template class A { public: Index: test/CodeGenCXX/virtual-base-ctor.cpp =================================================================== --- test/CodeGenCXX/virtual-base-ctor.cpp +++ test/CodeGenCXX/virtual-base-ctor.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - -O2 | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - -O2 | FileCheck %s struct B; extern B x; Index: test/CodeGenCXX/virtual-base-destructor-call.cpp =================================================================== --- test/CodeGenCXX/virtual-base-destructor-call.cpp +++ test/CodeGenCXX/virtual-base-destructor-call.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s struct basic_ios{~basic_ios(); }; Index: test/CodeGenCXX/virtual-destructor-synthesis.cpp =================================================================== --- test/CodeGenCXX/virtual-destructor-synthesis.cpp +++ test/CodeGenCXX/virtual-destructor-synthesis.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s struct box { virtual ~box(); Index: test/CodeGenCXX/virtual-function-calls.cpp =================================================================== --- test/CodeGenCXX/virtual-function-calls.cpp +++ test/CodeGenCXX/virtual-function-calls.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -std=c++11 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -cxx-abi itanium -std=c++11 -emit-llvm -o - | FileCheck %s // PR5021 namespace PR5021 { Index: test/CodeGenCXX/virtual-implicit-copy-assignment.cpp =================================================================== --- test/CodeGenCXX/virtual-implicit-copy-assignment.cpp +++ test/CodeGenCXX/virtual-implicit-copy-assignment.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s struct D; struct B { Index: test/CodeGenCXX/virtual-implicit-move-assignment.cpp =================================================================== --- test/CodeGenCXX/virtual-implicit-move-assignment.cpp +++ test/CodeGenCXX/virtual-implicit-move-assignment.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -std=c++11 -o - %s | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -std=c++11 -o - %s | FileCheck %s struct D; struct B { Index: test/CodeGenCXX/virtual-inherited-destructor.cpp =================================================================== --- test/CodeGenCXX/virtual-inherited-destructor.cpp +++ test/CodeGenCXX/virtual-inherited-destructor.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm-only +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm-only struct A { virtual ~A(); }; struct B : A { Index: test/CodeGenCXX/virtual-pseudo-destructor-call.cpp =================================================================== --- test/CodeGenCXX/virtual-pseudo-destructor-call.cpp +++ test/CodeGenCXX/virtual-pseudo-destructor-call.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s struct A { virtual ~A(); Index: test/CodeGenCXX/visibility-hidden-extern-templates.cpp =================================================================== --- test/CodeGenCXX/visibility-hidden-extern-templates.cpp +++ test/CodeGenCXX/visibility-hidden-extern-templates.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -O1 -emit-llvm -o - -fvisibility hidden %s | FileCheck %s +// RUN: %clang_cc1 -O1 -cxx-abi itanium -emit-llvm -o - -fvisibility hidden %s | FileCheck %s template struct X { Index: test/CodeGenCXX/volatile-1.cpp =================================================================== --- test/CodeGenCXX/volatile-1.cpp +++ test/CodeGenCXX/volatile-1.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -Wno-unused-value -emit-llvm %s -o - | FileCheck %s +// RUN: %clang_cc1 -Wno-unused-value -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s // CHECK: @i = global [[INT:i[0-9]+]] 0 volatile int i, j, k; Index: test/CodeGenCXX/vtable-cast-crash.cpp =================================================================== --- test/CodeGenCXX/vtable-cast-crash.cpp +++ test/CodeGenCXX/vtable-cast-crash.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm-only %s +// RUN: %clang_cc1 -emit-llvm-only -cxx-abi itanium %s struct A { A(); Index: test/CodeGenCXX/weak-extern-typeinfo.cpp =================================================================== --- test/CodeGenCXX/weak-extern-typeinfo.cpp +++ test/CodeGenCXX/weak-extern-typeinfo.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s // rdar://10246395 #define WEAK __attribute__ ((weak)) Index: test/CodeGenCXX/weak-external.cpp =================================================================== --- test/CodeGenCXX/weak-external.cpp +++ test/CodeGenCXX/weak-external.cpp @@ -1,4 +1,4 @@ -// RUN: %clang -fexceptions %s -S -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -cxx-abi itanium %s -S -emit-llvm -o - | FileCheck %s // PR4262 // CHECK-NOT: _ZNSs12_S_constructIPKcEEPcT_S3_RKSaIcESt20forward_iterator_tag Index: test/CodeGenObjC/debug-info-self.m =================================================================== --- test/CodeGenObjC/debug-info-self.m +++ test/CodeGenObjC/debug-info-self.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s +// RUN: %clang_cc1 -emit-llvm -cxx-abi itanium -g %s -o - | FileCheck %s // self and _cmd are marked as DW_AT_artificial. // myarg is not marked as DW_AT_artificial. Index: test/CodeGenObjC/overloadable.m =================================================================== --- test/CodeGenObjC/overloadable.m +++ test/CodeGenObjC/overloadable.m @@ -1,10 +1,12 @@ // rdar://6657613 -// RUN: %clang_cc1 -emit-llvm %s -o %t +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm %s -o - | FileCheck %s @class C; -// RUN: grep _Z1fP11objc_object %t | count 1 +// CHECK: _Z1fP11objc_object +// CHECK-NOT: _Z1fP11objc_object void __attribute__((overloadable)) f(id c) { } -// RUN: grep _Z1fP1C %t | count 1 +// CHECK: _Z1fP1C +// CHECK-NOT: _Z1fP1C void __attribute__((overloadable)) f(C *c) { } Index: test/CodeGenObjCXX/arc-mangle.mm =================================================================== --- test/CodeGenObjCXX/arc-mangle.mm +++ test/CodeGenObjCXX/arc-mangle.mm @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s // CHECK-LABEL: define void @_Z1fPU8__strongP11objc_object(i8**) void f(__strong id *) {} Index: test/CodeGenOpenCL/address-spaces-mangling.cl =================================================================== --- test/CodeGenOpenCL/address-spaces-mangling.cl +++ test/CodeGenOpenCL/address-spaces-mangling.cl @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=yes -emit-llvm -o - | FileCheck -check-prefix=ASMANG %s -// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -emit-llvm -o - | FileCheck -check-prefix=NOASMANG %s +// 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 // We can't name this f as private is equivalent to default // no specifier given address space so we get multiple definition Index: test/CodeGenOpenCL/local.cl =================================================================== --- test/CodeGenOpenCL/local.cl +++ test/CodeGenOpenCL/local.cl @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -ffake-address-space-map -faddress-space-map-mangling=no -cxx-abi itanium -emit-llvm -o - | FileCheck %s __kernel void foo(void) { // CHECK: @foo.i = internal addrspace(2) Index: test/PCH/cxx-reference.cpp =================================================================== --- test/PCH/cxx-reference.cpp +++ test/PCH/cxx-reference.cpp @@ -1,6 +1,6 @@ // Test this without pch. -// RUN: %clang_cc1 -x c++ -std=c++11 -include %S/cxx-reference.h -fsyntax-only -emit-llvm -o - %s +// RUN: %clang_cc1 -x c++ -cxx-abi itanium -std=c++11 -include %S/cxx-reference.h -fsyntax-only -emit-llvm -o - %s // Test with pch. -// RUN: %clang_cc1 -x c++ -std=c++11 -emit-pch -o %t %S/cxx-reference.h -// RUN: %clang_cc1 -x c++ -std=c++11 -include-pch %t -fsyntax-only -emit-llvm -o - %s +// 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 Index: test/PCH/cxx-required-decls.cpp =================================================================== --- test/PCH/cxx-required-decls.cpp +++ test/PCH/cxx-required-decls.cpp @@ -1,9 +1,9 @@ // Test this without pch. -// RUN: %clang_cc1 -include %S/cxx-required-decls.h %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -include %S/cxx-required-decls.h %s -cxx-abi itanium -emit-llvm -o - | FileCheck %s // Test with pch. -// RUN: %clang_cc1 -x c++-header -emit-pch -o %t %S/cxx-required-decls.h -// RUN: %clang_cc1 -include-pch %t %s -emit-llvm -o - | FileCheck %s +// 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 // CHECK: @_ZL5globS = internal global %struct.S zeroinitializer // CHECK: @_ZL3bar = internal global i32 0, align 4 Index: test/PCH/cxx-templates.cpp =================================================================== --- test/PCH/cxx-templates.cpp +++ test/PCH/cxx-templates.cpp @@ -1,21 +1,21 @@ // Test this without pch. -// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include %S/cxx-templates.h -verify %s -ast-dump -o - -// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include %S/cxx-templates.h %s -emit-llvm -o - -DNO_ERRORS | FileCheck %s +// 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 // Test with pch. -// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -x c++-header -emit-pch -o %t %S/cxx-templates.h -// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -include-pch %t -verify %s -ast-dump -o - -// RUN: %clang_cc1 -std=c++11 -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 -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 // Test with modules. -// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -fmodules -x c++-header -emit-pch -o %t %S/cxx-templates.h -// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fexceptions -fmodules -include-pch %t -verify %s -ast-dump -o - -// RUN: %clang_cc1 -std=c++11 -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 -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 // Test with pch and delayed template parsing. -// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fdelayed-template-parsing -fexceptions -x c++-header -emit-pch -o %t %S/cxx-templates.h -// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fdelayed-template-parsing -fexceptions -include-pch %t -verify %s -ast-dump -o - -// RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -fdelayed-template-parsing -fexceptions -include-pch %t %s -emit-llvm -o - -DNO_ERRORS | FileCheck %s +// 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 // CHECK: define weak_odr {{.*}}void @_ZN2S4IiE1mEv // CHECK: define linkonce_odr {{.*}}void @_ZN2S3IiE1mEv Index: test/PCH/irgen-rdar13114142.mm =================================================================== --- test/PCH/irgen-rdar13114142.mm +++ test/PCH/irgen-rdar13114142.mm @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 %s -emit-pch -o %t.pch -// RUN: %clang_cc1 %s -emit-llvm -include-pch %t.pch -o - | FileCheck %s +// 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 #ifndef HEADER #define HEADER Index: test/PCH/objc_literals.mm =================================================================== --- test/PCH/objc_literals.mm +++ test/PCH/objc_literals.mm @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -emit-pch -x objective-c++ -std=c++0x -o %t %s -// RUN: %clang_cc1 -include-pch %t -x objective-c++ -std=c++0x -verify %s -// RUN: %clang_cc1 -include-pch %t -x objective-c++ -std=c++0x -ast-print %s | FileCheck -check-prefix=CHECK-PRINT %s -// RUN: %clang_cc1 -include-pch %t -x objective-c++ -std=c++0x -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-IR %s +// 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 // expected-no-diagnostics Index: test/PCH/objcxx-ivar-class.mm =================================================================== --- test/PCH/objcxx-ivar-class.mm +++ test/PCH/objcxx-ivar-class.mm @@ -1,9 +1,9 @@ // Test this without pch. -// RUN: not %clang_cc1 -include %S/objcxx-ivar-class.h -verify %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -include %S/objcxx-ivar-class.h -cxx-abi itanium %s -emit-llvm -o - | FileCheck %s // Test with pch. -// RUN: %clang_cc1 -x objective-c++-header -emit-pch -o %t %S/objcxx-ivar-class.h -// RUN: not %clang_cc1 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s +// 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 // CHECK: [C position] // CHECK: call {{.*}} @_ZN1SC1ERKS_ Index: test/Sema/empty1.c =================================================================== --- test/Sema/empty1.c +++ test/Sema/empty1.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -fsyntax-only -verify -Wc++-compat +// RUN: %clang_cc1 %s -cxx-abi itanium -fsyntax-only -verify -Wc++-compat struct emp_1 { // expected-warning {{empty struct has size 0 in C, size 1 in C++}} }; Index: test/SemaCXX/deleted-operator.cpp =================================================================== --- test/SemaCXX/deleted-operator.cpp +++ test/SemaCXX/deleted-operator.cpp @@ -13,6 +13,7 @@ } struct DelOpDel { - virtual ~DelOpDel() {} // expected-error {{deleted function}} - void operator delete(void*) = delete; // expected-note {{deleted here}} + // FIXME: In MS ABI, we error twice below. + virtual ~DelOpDel() {} // expected-error 1-2 {{attempt to use a deleted function}} + void operator delete(void*) = delete; // expected-note 1-2 {{deleted here}} }; Index: test/SemaCXX/destructor.cpp =================================================================== --- test/SemaCXX/destructor.cpp +++ test/SemaCXX/destructor.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -std=c++11 -fsyntax-only -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -verify %s +// 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 class A { public: ~A(); @@ -82,10 +83,14 @@ }; } +#ifndef MSABI +// This bug, "Clang instantiates destructor for function argument" is intended +// behaviour in the Microsoft ABI because the callee needs to destruct the arguments. namespace PR6709 { template class X { T v; ~X() { ++*v; } }; void a(X x) {} } +#endif struct X0 { virtual ~X0() throw(); }; struct X1 : public X0 { }; @@ -100,10 +105,16 @@ T::deleteIt(p); // expected-error {{type 'int' cannot be used prior to '::'}} } +#ifdef MSABI + // expected-note@+2 {{in instantiation of member function 'test6::A::operator delete' requested here}} +#endif virtual ~A() {} }; - class B : A { B(); }; // expected-note {{in instantiation of member function 'test6::A::operator delete' requested here}} +#ifndef MSABI + // expected-note@+2 {{in instantiation of member function 'test6::A::operator delete' requested here}} +#endif + class B : A { B(); }; B::B() {} } Index: test/SemaCXX/implicit-virtual-member-functions.cpp =================================================================== --- test/SemaCXX/implicit-virtual-member-functions.cpp +++ test/SemaCXX/implicit-virtual-member-functions.cpp @@ -1,8 +1,10 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -cxx-abi itanium -verify %s +// RUN: %clang_cc1 -fsyntax-only -cxx-abi microsoft -DMSABI -verify %s struct A { virtual ~A(); }; +#ifndef MSABI struct B : A { // expected-error {{no suitable member 'operator delete' in 'B'}} virtual void f(); @@ -11,6 +13,7 @@ void B::f() { // expected-note {{implicit destructor for 'B' first required here}} } +#endif struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}} C(); Index: test/SemaCXX/primary-base.cpp =================================================================== --- test/SemaCXX/primary-base.cpp +++ test/SemaCXX/primary-base.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -cxx-abi itanium -fsyntax-only -verify %s // expected-no-diagnostics class A { virtual void f(); }; class B : virtual A { }; Index: test/SemaCXX/typeid-ref.cpp =================================================================== --- test/SemaCXX/typeid-ref.cpp +++ test/SemaCXX/typeid-ref.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm -o - %s | FileCheck %s namespace std { class type_info; } Index: test/SemaCXX/undefined-internal.cpp =================================================================== --- test/SemaCXX/undefined-internal.cpp +++ test/SemaCXX/undefined-internal.cpp @@ -1,7 +1,7 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -cxx-abi itanium -fsyntax-only -verify %s // Make sure we don't produce invalid IR. -// RUN: %clang_cc1 -emit-llvm-only %s +// RUN: %clang_cc1 -cxx-abi itanium -emit-llvm-only %s namespace test1 { static void foo(); // expected-warning {{function 'test1::foo' has internal linkage but is not defined}} Index: test/SemaCXX/virtual-base-used.cpp =================================================================== --- test/SemaCXX/virtual-base-used.cpp +++ test/SemaCXX/virtual-base-used.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -cxx-abi itanium -verify %s // PR7800 class NoDestroy { ~NoDestroy(); }; // expected-note 3 {{declared private here}} Index: test/SemaCXX/warn-reinterpret-base-class.cpp =================================================================== --- test/SemaCXX/warn-reinterpret-base-class.cpp +++ test/SemaCXX/warn-reinterpret-base-class.cpp @@ -1,5 +1,8 @@ -// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s -// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -fdiagnostics-parseable-fixits -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s 2>&1 | FileCheck %s +// 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: 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 // PR 13824 class A { @@ -288,6 +291,11 @@ (void)reinterpret_cast(f); // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:25}:"static_cast" +#ifdef MSABI + // In MS ABI mode, A is at non-zero offset in H. + // expected-warning@+3 {{'reinterpret_cast' to class 'H *' from its base at non-zero offset 'A *' behaves differently from 'static_cast'}} + // expected-note@+2 {{use 'static_cast'}} +#endif (void)reinterpret_cast(a); // expected-warning@+2 {{'reinterpret_cast' to class 'L' (aka 'const F *volatile') from its base at non-zero offset 'E *' behaves differently from 'static_cast'}} @@ -309,6 +317,12 @@ // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:25}:"static_cast" (void)reinterpret_cast(h); + +#ifdef MSABI + // In MS ABI mode, A is at non-zero offset in H. + // expected-warning@+3 {{'reinterpret_cast' from class 'H *' to its base at non-zero offset 'A *' behaves differently from 'static_cast'}} + // expected-note@+2 {{use 'static_cast'}} +#endif (void)reinterpret_cast(h); // expected-warning@+2 {{'reinterpret_cast' from class 'I *' to its virtual base 'F *' behaves differently from 'static_cast'}} Index: test/SemaCXX/warn-weak-vtables.cpp =================================================================== --- test/SemaCXX/warn-weak-vtables.cpp +++ test/SemaCXX/warn-weak-vtables.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -fsyntax-only -verify -Wweak-vtables -Wweak-template-vtables +// RUN: %clang_cc1 %s -fsyntax-only -verify -cxx-abi itanium -Wweak-vtables -Wweak-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() { } Index: test/SemaTemplate/inject-templated-friend-post.cpp =================================================================== --- test/SemaTemplate/inject-templated-friend-post.cpp +++ test/SemaTemplate/inject-templated-friend-post.cpp @@ -1,12 +1,17 @@ -// RUN: %clang %s -std=c++98 -S -emit-llvm -o - | grep -e "define linkonce_odr.*_ZlsR11std_ostreamRK8StreamerI3FooE" -// RUN: %clang %s -std=c++98 -S -emit-llvm -o - -DPROTOTYPE | grep -e "define linkonce_odr.*_ZlsR11std_ostreamRK8StreamerI3FooE" -// RUN: %clang %s -std=c++98 -S -emit-llvm -o - -DINSTANTIATE | grep -e "define linkonce_odr.*_ZlsR11std_ostreamRK8StreamerI3FooE" -// RUN: %clang %s -std=c++98 -S -emit-llvm -o - -DPROTOTYPE -DINSTANTIATE | grep -e "define linkonce_odr.*_ZlsR11std_ostreamRK8StreamerI3FooE" +// 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 -DREDEFINE -verify // RUN: %clang_cc1 %s -DPROTOTYPE -DREDEFINE -verify // PR8007: friend function not instantiated, reordered version. // Corresponds to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38392 +// CHECK: define linkonce_odr{{.*}}_ZlsR11std_ostreamRK8StreamerI3FooE +// CHECK-PROTOTYPE: define linkonce_odr{{.*}}_ZlsR11std_ostreamRK8StreamerI3FooE +// CHECK-INSTANTIATE: define linkonce_odr{{.*}}_ZlsR11std_ostreamRK8StreamerI3FooE +// CHECK-PROTOTYPE-INSTANTIATE: define linkonce_odr{{.*}}_ZlsR11std_ostreamRK8StreamerI3FooE + struct std_ostream { int dummy; Index: test/SemaTemplate/inject-templated-friend.cpp =================================================================== --- test/SemaTemplate/inject-templated-friend.cpp +++ test/SemaTemplate/inject-templated-friend.cpp @@ -1,7 +1,9 @@ -// RUN: %clang %s -S -emit-llvm -o - | grep -e "define linkonce_odr.*_ZlsR11std_ostreamRK8StreamerI3FooE" +// RUN: %clang_cc1 %s -emit-llvm -cxx-abi itanium -o - | FileCheck %s // RUN: %clang_cc1 %s -DREDEFINE -verify // PR8007: friend function not instantiated. +// CHECK: define linkonce_odr{{.*}}_ZlsR11std_ostreamRK8StreamerI3FooE + struct std_ostream { int dummy; Index: test/SemaTemplate/instantiate-complete.cpp =================================================================== --- test/SemaTemplate/instantiate-complete.cpp +++ test/SemaTemplate/instantiate-complete.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -cxx-abi itanium -fsyntax-only -verify %s +// RUN: %clang_cc1 -cxx-abi microsoft -DMSABI -fsyntax-only -verify %s // Tests various places where requiring a complete type involves // instantiation of that type. @@ -7,6 +8,9 @@ struct X { X(T); +#ifdef MSABI +// expected-error@+2{{data member instantiated with function type 'long (long)'}} +#endif T f; // expected-error{{data member instantiated with function type 'float (int)'}} \ // expected-error{{data member instantiated with function type 'int (int)'}} \ // expected-error{{data member instantiated with function type 'char (char)'}} \ @@ -40,7 +44,11 @@ void test_memptr(X *p1, long X::*pm1, X *p2, +#ifdef MSABI + long (X::*pm2)(long)) { // expected-note{{in instantiation of template class 'X' requested here}} +#else long (X::*pm2)(long)) { +#endif (void)(p1->*pm1); } Index: test/SemaTemplate/instantiate-exception-spec-cxx11.cpp =================================================================== --- test/SemaTemplate/instantiate-exception-spec-cxx11.cpp +++ test/SemaTemplate/instantiate-exception-spec-cxx11.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 -ftemplate-depth 16 -fcxx-exceptions -fexceptions %s +// RUN: %clang_cc1 -fsyntax-only -verify -cxx-abi itanium -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. Index: test/SemaTemplate/virtual-member-functions.cpp =================================================================== --- test/SemaTemplate/virtual-member-functions.cpp +++ test/SemaTemplate/virtual-member-functions.cpp @@ -1,4 +1,5 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -cxx-abi itanium -fsyntax-only -verify %s +// RUN: %clang_cc1 -cxx-abi microsoft -DMSABI -fsyntax-only -verify %s namespace PR5557 { template struct A { @@ -71,8 +72,13 @@ int f() { return B::value; } +#ifdef MSABI + void test_typeid(B::Inner bfi) { // expected-note{{implicit destructor}} + (void)typeid(bfi); +#else void test_typeid(B::Inner bfi) { (void)typeid(bfi); // expected-note{{implicit destructor}} +#endif } template @@ -80,9 +86,11 @@ void f() { } }; +#ifndef MSABI void test_X(X xi, X xf) { xi.f(); } +#endif } namespace DynamicCast {