]> granicus.if.org Git - clang/commitdiff
Switch to the new MingW ABI.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 12 Dec 2013 16:07:11 +0000 (16:07 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 12 Dec 2013 16:07:11 +0000 (16:07 +0000)
GCC 4.7 changed the MingW ABI. On the clang side this means that methods now
have the thiscall calling convention by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197164 91177308-0d34-0410-b5e6-96231b3b80d8

35 files changed:
docs/ReleaseNotes.rst
lib/AST/ItaniumCXXABI.cpp
test/CXX/class.access/p6.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p1.cpp
test/CXX/expr/expr.const/p3-0x.cpp
test/CXX/expr/expr.mptr.oper/p5.cpp
test/CXX/expr/expr.mptr.oper/p6-0x.cpp
test/CXX/expr/expr.prim/expr.prim.lambda/blocks.mm
test/CXX/expr/expr.unary/expr.unary.op/p4.cpp
test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp
test/CodeGenCXX/c-linkage.cpp
test/CodeGenCXX/copy-assign-synthesis-2.cpp
test/CodeGenCXX/microsoft-abi-default-cc.cpp
test/CodeGenCXX/mingw-new-abi.cpp [new file with mode: 0644]
test/CodeGenCXX/noinline-template.cpp
test/CodeGenCXX/pragma-weak.cpp
test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
test/CodeGenCXX/virt-dtor-gen.cpp
test/CodeGenCXX/virtual-function-calls.cpp
test/CodeGenCXX/visibility-hidden-extern-templates.cpp
test/CodeGenCXX/volatile-1.cpp
test/Index/print-type-cxx11.cpp
test/Index/print-type.cpp
test/PCH/chain-pending-instantiations.cpp
test/PCH/cxx-templates.cpp
test/PCH/objcxx-ivar-class.mm
test/SemaCXX/addr-of-overloaded-function.cpp
test/SemaCXX/const-cast.cpp
test/SemaCXX/cstyle-cast.cpp
test/SemaCXX/functional-cast.cpp
test/SemaCXX/reinterpret-cast.cpp
test/SemaCXX/static-cast.cpp
test/SemaTemplate/explicit-instantiation.cpp
test/SemaTemplate/instantiate-method.cpp
test/SemaTemplate/temp_arg_nontype.cpp

index 569d5e8420a0ab4add9836b1a777e5a6d28bed85..6b1b88db52fb864a7983caeff21e469f8cf2913d 100644 (file)
@@ -47,6 +47,11 @@ sections with improvements to Clang's support for those languages.
 Major New Features
 ------------------
 
+- Clang uses the new MingW ABI
+GCC 4.7 changed the mingw ABI. Clang 3.4 and older use the GCC 4.6
+ABI. Clang 3.5 and newer use the GCC 4.7 abi.
+
+
 Improvements to Clang's diagnostics
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
index 578466028ce8feec32c6fe99f6499862e1ad3411..8928e66724eac05baa76867de188a18083a9ca1f 100644 (file)
@@ -59,6 +59,10 @@ public:
   }
 
   CallingConv getDefaultMethodCallConv(bool isVariadic) const {
+    const llvm::Triple &T = Context.getTargetInfo().getTriple();
+    if (!isVariadic && T.getOS() == llvm::Triple::MinGW32 &&
+        T.getArch() == llvm::Triple::x86)
+      return CC_X86ThisCall;
     return CC_C;
   }
 
index 6a93658fc78d0cd6099416fe6efe1d0011c2132d..30a59acfabec6cc1e2726b9adc363d6d6ac14038 100644 (file)
@@ -177,7 +177,7 @@ namespace test8 {
   };
 
   void test(A &a) {
-    if (a) return; // expected-error {{'operator void *(class test8::A::*)(void) const' is a private member of 'test8::A'}}
+    if (a) return; // expected-error-re {{'operator void *(class test8::A::*)(void) {{.*}}const' is a private member of 'test8::A'}}
   }
 }
 
index 7aa3b2f8acd2fffd6d616211cceb04986f8ffb53..a0c12c814142d8b14c586d7eeb6c7efce3ac5e44 100644 (file)
@@ -73,7 +73,7 @@ template <typename T> T gt(T t) { return t; }
 struct S {
   template<typename T> constexpr T f(); // expected-warning {{C++1y}}
   template <typename T>
-  T g() const; // expected-note {{candidate template ignored: could not match 'T () const' against 'char ()'}}
+  T g() const; // expected-note-re {{candidate template ignored: could not match 'T () {{.*}}const' against 'char (){{.*}}'}}
 };
 
 // explicit specialization can differ in constepxr
index e3e32dfe0900150765e70fdc650268b713b2f35e..f98af411e0b5a3facb1d32e2f07bba1b21eadab8 100644 (file)
@@ -97,7 +97,7 @@ template <bool B> int f() { return B; } // expected-note {{candidate template ig
 template int f<&S::operator int>(); // expected-error {{does not refer to a function template}}
 template int f<(bool)&S::operator int>();
 
-int n = Val<bool, &S::operator int>::value; // expected-error {{conversion from 'int (S::*)() const' to 'bool' is not allowed in a converted constant expression}}
+int n = Val<bool, &S::operator int>::value; // expected-error-re {{conversion from 'int (S::*)() {{.*}}const' to 'bool' is not allowed in a converted constant expression}}
 
 namespace NonConstLValue {
   struct S {
index 7380b5d4805d6fdb5bb24ccb6fbe44599af4f4d7..3a5e42c36d55585c5a5acdef7a4e1ce94be52166 100644 (file)
@@ -24,19 +24,19 @@ void test_object_cvquals(void (X0::*pm)(),
   (p->*pmv)();
   (p->*pmcv)();
 
-  (pc->*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'const' qualifier}}
+  (pc->*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'const' qualifier}}
   (pc->*pmc)();
-  (pc->*pmv)(); // expected-error{{call to pointer to member function of type 'void () volatile' drops 'const' qualifier}}
+  (pc->*pmv)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}volatile' drops 'const' qualifier}}
   (pc->*pmcv)();
 
-  (pv->*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'volatile' qualifier}}
-  (pv->*pmc)(); // expected-error{{call to pointer to member function of type 'void () const' drops 'volatile' qualifier}}
+  (pv->*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'volatile' qualifier}}
+  (pv->*pmc)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}const' drops 'volatile' qualifier}}
   (pv->*pmv)();
   (pv->*pmcv)();
 
-  (pcv->*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'const volatile' qualifiers}}
-  (pcv->*pmc)(); // expected-error{{call to pointer to member function of type 'void () const' drops 'volatile' qualifier}}
-  (pcv->*pmv)(); // expected-error{{call to pointer to member function of type 'void () volatile' drops 'const' qualifier}}
+  (pcv->*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'const volatile' qualifiers}}
+  (pcv->*pmc)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}const' drops 'volatile' qualifier}}
+  (pcv->*pmv)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}volatile' drops 'const' qualifier}}
   (pcv->*pmcv)();
 
   (o.*pm)();
@@ -44,18 +44,18 @@ void test_object_cvquals(void (X0::*pm)(),
   (o.*pmv)();
   (o.*pmcv)();
 
-  (oc.*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'const' qualifier}}
+  (oc.*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'const' qualifier}}
   (oc.*pmc)();
-  (oc.*pmv)(); // expected-error{{call to pointer to member function of type 'void () volatile' drops 'const' qualifier}}
+  (oc.*pmv)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}volatile' drops 'const' qualifier}}
   (oc.*pmcv)();
 
-  (ov.*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'volatile' qualifier}}
-  (ov.*pmc)(); // expected-error{{call to pointer to member function of type 'void () const' drops 'volatile' qualifier}}
+  (ov.*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'volatile' qualifier}}
+  (ov.*pmc)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}const' drops 'volatile' qualifier}}
   (ov.*pmv)();
   (ov.*pmcv)();
 
-  (ocv.*pm)(); // expected-error{{call to pointer to member function of type 'void ()' drops 'const volatile' qualifiers}}
-  (ocv.*pmc)(); // expected-error{{call to pointer to member function of type 'void () const' drops 'volatile' qualifier}}
-  (ocv.*pmv)(); // expected-error{{call to pointer to member function of type 'void () volatile' drops 'const' qualifier}}
+  (ocv.*pm)(); // expected-error-re{{call to pointer to member function of type 'void (){{.*}}' drops 'const volatile' qualifiers}}
+  (ocv.*pmc)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}const' drops 'volatile' qualifier}}
+  (ocv.*pmv)(); // expected-error-re{{call to pointer to member function of type 'void () {{.*}}volatile' drops 'const' qualifier}}
   (ocv.*pmcv)();
 }
index 917b2dab7c328fa111e5659cfe0fede206e86548..db12a9d7a7e8723ab3a9a803711c777b015ff10f 100644 (file)
@@ -22,13 +22,13 @@ void test(X *xp, int (X::*pmf)(int), int (X::*l_pmf)(int) &,
 
   // Lvalue ref-qualifier.
   (lvalue<X>().*l_pmf)(17);
-  (xvalue<X>().*l_pmf)(17); // expected-error{{pointer-to-member function type 'int (X::*)(int) &' can only be called on an lvalue}}
-  (prvalue<X>().*l_pmf)(17); // expected-error{{pointer-to-member function type 'int (X::*)(int) &' can only be called on an lvalue}}
+  (xvalue<X>().*l_pmf)(17); // expected-error-re{{pointer-to-member function type 'int (X::*)(int) {{.*}}&' can only be called on an lvalue}}
+  (prvalue<X>().*l_pmf)(17); // expected-error-re{{pointer-to-member function type 'int (X::*)(int) {{.*}}&' can only be called on an lvalue}}
   (xp->*l_pmf)(17);
 
   // Rvalue ref-qualifier.
-  (lvalue<X>().*r_pmf)(17); // expected-error{{pointer-to-member function type 'int (X::*)(int) &&' can only be called on an rvalue}}
+  (lvalue<X>().*r_pmf)(17); // expected-error-re{{pointer-to-member function type 'int (X::*)(int) {{.*}}&&' can only be called on an rvalue}}
   (xvalue<X>().*r_pmf)(17);
   (prvalue<X>().*r_pmf)(17);
-  (xp->*r_pmf)(17);  // expected-error{{pointer-to-member function type 'int (X::*)(int) &&' can only be called on an rvalue}}
+  (xp->*r_pmf)(17);  // expected-error-re{{pointer-to-member function type 'int (X::*)(int) {{.*}}&&' can only be called on an rvalue}}
 }
index 0db2bf5646ff4568e3e8f71f9b068f763e27e699..345ea9bb2d63d6eb79674a87022cdbfe47448be2 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -std=c++11 -fblocks %s -verify
+// RUN: %clang_cc1 -triple i686-pc-linux -std=c++11 -fblocks %s -verify
 
 void block_capture_errors() {
   __block int var; // expected-note 2{{'var' declared here}}
index cd55cc2441a23a87d8a69694980657adb00d3a76..575225bfda757e5648ae0b4d668f34d49f3faea4 100644 (file)
@@ -7,7 +7,7 @@ namespace test0 {
     template<typename T> void g(T);
 
     void test() {
-      foo(&g<int>); // expected-error {{can't form member pointer of type 'void (test0::A::*)(int)' without '&' and class name}}
+      foo(&g<int>); // expected-error-re {{can't form member pointer of type 'void (test0::A::*)(int){{.*}}' without '&' and class name}}
     }
   };
 }
index 9b9b532ff13447a9f0346741a042e238c3d4739d..9e5300d4ba3da1cab2d29c4861be99b9628442f2 100644 (file)
@@ -184,7 +184,7 @@ namespace pointer_to_member_function {
   template<int (Y::*)(int)> struct X0 {}; // expected-note{{template parameter is declared here}}
   X0<&Y::f> x0a;
   X0<&Y::g> x0b;
-  X0<&Y::h> x0c; // expected-error{{non-type template argument of type 'float (pointer_to_member_function::Y::*)(float)' cannot be converted to a value of type 'int (pointer_to_member_function::Y::*)(int)'}}
+  X0<&Y::h> x0c; // expected-error-re{{non-type template argument of type 'float (pointer_to_member_function::Y::*)(float){{.*}}' cannot be converted to a value of type 'int (pointer_to_member_function::Y::*)(int){{.*}}'}}
 }
 
 //     -- For a non-type template-parameter of type pointer to data member,
index 1607623c6fea27103b007cbea93fd462bdae2474..a7d018d58dfd2245ae43c30c12cb64592c1247dc 100644 (file)
@@ -10,7 +10,7 @@ extern "C" {
   }
 }
 
-// CHECK-LABEL: define void @_ZN1N1X1fEv
+// CHECK-LABEL: define {{.*}}void @_ZN1N1X1fEv
 
 extern "C" {
   static void test2_f() {
index 18e92f98ebdef8789e5aafabe5fe39b9e92ecd9b..3829f383ddee6fffc0007e2e202de8942e9e1c90 100644 (file)
@@ -1,4 +1,4 @@
 // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
 struct A {};
 A& (A::*x)(const A&) = &A::operator=;
-// CHECK-LABEL: define linkonce_odr %struct.A* @_ZN1AaSERKS_
+// CHECK-LABEL: define linkonce_odr {{.*}}%struct.A* @_ZN1AaSERKS_
index d7fba9911e1ba225e6cba146f5387b8c85660621..1254d6adfd21eea401bced8a99ebc55a6d8677ef 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck -check-prefix GCABI %s
+// 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
 
 #ifdef MS_ABI
diff --git a/test/CodeGenCXX/mingw-new-abi.cpp b/test/CodeGenCXX/mingw-new-abi.cpp
new file mode 100644 (file)
index 0000000..2b05253
--- /dev/null
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -emit-llvm -triple i386-pc-mingw32 %s -o - | FileCheck --check-prefix=MINGW %s
+// RUN: %clang_cc1 -emit-llvm -triple i386-pc-cygwin %s -o - | FileCheck --check-prefix=CYGWIN %s
+
+namespace test1 {
+  struct foo {
+    //  MINGW: declare x86_thiscallcc void @_ZN5test13foo1fEv
+    //  CYGWIN: declare void @_ZN5test13foo1fEv
+    void f();
+  };
+  void g(foo *x) {
+    x->f();
+  }
+}
index 51a84f74a650b9a5b6aa84c37a65c063886d9783..c7b547658653b0999bc1e865eef6c111faed30fe 100644 (file)
@@ -3,7 +3,7 @@
 // This was a problem in Sema, but only shows up as noinline missing
 // in CodeGen.
 
-// CHECK: define linkonce_odr void @_ZN6VectorIiE13growStorageByEv(%struct.Vector* %this) [[NI:#[0-9]+]]
+// CHECK: define linkonce_odr {{.*}}void @_ZN6VectorIiE13growStorageByEv(%struct.Vector* %this) [[NI:#[0-9]+]]
 
 template <class Ty> struct Vector  {
   void growStorageBy();
index c033079140405c0bb03124842930acb909171ba8..b12afb20750078154f7f79119c7363ef90ddf48c 100644 (file)
@@ -10,7 +10,7 @@ int zex;
 #pragma weak foo
 struct S {  void foo(); };
 void S::foo() {}
-// CHECK-LABEL: define void @_ZN1S3fooEv(
+// CHECK-LABEL: define {{.*}}void @_ZN1S3fooEv(
 
 #pragma weak zed
 namespace bar {  void zed() {} }
index de86f10f6c30de570d294c90c53ae12e059f90a2..53e6db63710f853c2268163cf10b01a1de870f41 100644 (file)
@@ -2,8 +2,8 @@
 
 // Verify that symbols are hidden.
 // CHECK: @_ZN1CIiE5Inner6Inner26StaticE = weak_odr hidden global
-// CHECK-LABEL: define weak_odr hidden void @_ZN1CIiE5Inner1fEv
-// CHECK-LABEL: define weak_odr hidden void @_ZN1CIiE5Inner6Inner21gEv
+// CHECK-LABEL: define weak_odr hidden {{.*}}void @_ZN1CIiE5Inner1fEv
+// CHECK-LABEL: define weak_odr hidden {{.*}}void @_ZN1CIiE5Inner6Inner21gEv
 
 template<typename T>
 struct C {
index 78a0b8193d74a1f0ffe071cbb75c54a1f8063142..b3041a58a96a071a0f0c0b23e4576474394c2587 100644 (file)
@@ -7,4 +7,4 @@ class Foo {
 };
 Foo::~Foo() {}
 
-// CHECK-LABEL: define void @_ZN3FooD0Ev(%class.Foo* %this) unnamed_addr
+// CHECK-LABEL: define {{.*}}void @_ZN3FooD0Ev(%class.Foo* %this) unnamed_addr
index e1b380fe7369a9431b061e987b034571710a999a..111d1a2193f178ec71adf55a76135c9d12bcb846 100644 (file)
@@ -8,7 +8,7 @@ struct A {
 };
 
 void f(A *a) {
-  // CHECK: call void %
+  // CHECK: call {{.*}}void %
   a->f('c');
 }
 
@@ -45,7 +45,7 @@ namespace VirtualNoreturn {
   // CHECK: @_ZN15VirtualNoreturn1f
   void f(A *p) {
     p->f();
-    // CHECK: call void %{{[^#]*$}}
+    // CHECK: call {{.*}}void %{{[^#]*$}}
     // CHECK-NOT: unreachable
   }
 }
index 549e674740ffa10e8cda2cb26312133a3d5182db..2cbfba9d5f4bc2d5ab9c741ef1727116b4f670a6 100644 (file)
@@ -14,13 +14,13 @@ extern template struct X<char>;
 
 // <rdar://problem/8109763>
 void test_X(X<int> xi, X<char> xc) {
-  // CHECK-LABEL: define weak_odr hidden void @_ZN1XIiE1fEv
+  // CHECK-LABEL: define weak_odr hidden {{.*}}void @_ZN1XIiE1fEv
   xi.f();
-  // CHECK-LABEL: define weak_odr hidden void @_ZN1XIiE1gEv
+  // CHECK-LABEL: define weak_odr hidden {{.*}}void @_ZN1XIiE1gEv
   xi.g();
-  // CHECK: declare void @_ZN1XIcE1fEv
+  // CHECK: declare {{.*}}void @_ZN1XIcE1fEv
   xc.f();
-  // CHECK-LABEL: define available_externally void @_ZN1XIcE1gEv
+  // CHECK-LABEL: define available_externally {{.*}}void @_ZN1XIcE1gEv
   xc.g();
 }
 
index 71ff1ed7d689468f8c085e19e635ddeb6c9f9053..472c01a4e23a24ad24f38b1341bdcb1d1824343c 100644 (file)
@@ -248,11 +248,11 @@ void test() {
   // gcc.
 
   // Not a use.  gcc forgets to do the assignment.
-  // CHECK-NEXT: call
+  // CHECK-NEXT: call {{.*}}void
   ((a=a),a);
 
   // Not a use.  gcc gets this wrong, it doesn't emit the copy!  
-  // CHECK-NEXT: call
+  // CHECK-NEXT: call {{.*}}void
   (void)(a=a);
 
   // Not a use.  gcc got this wrong in 4.2 and omitted the side effects
index 0ad54737746213b0d46b2fe00861a6ddb327da10..1f7522f0a12009c299256400e86812d1c5aedd79 100644 (file)
@@ -4,5 +4,5 @@ struct RefQualifierTest {
 };
 
 // RUN: c-index-test -test-print-type -std=c++11 %s | FileCheck %s
-// CHECK: CXXMethod=f:2:8 (Definition) [type=void () &] [typekind=FunctionProto] lvalue-ref-qualifier [resulttype=void] [resulttypekind=Void] [isPOD=0]
-// CHECK: CXXMethod=f:3:8 (Definition) [type=void () &&] [typekind=FunctionProto] rvalue-ref-qualifier [resulttype=void] [resulttypekind=Void] [isPOD=0]
+// CHECK: CXXMethod=f:2:8 (Definition) [type=void () {{.*}}&] [typekind=FunctionProto] lvalue-ref-qualifier [resulttype=void] [resulttypekind=Void] [isPOD=0]
+// CHECK: CXXMethod=f:3:8 (Definition) [type=void () {{.*}}&&] [typekind=FunctionProto] rvalue-ref-qualifier [resulttype=void] [resulttypekind=Void] [isPOD=0]
index 6324d439a6d5bf1063216bde0b9c2de683f3b8c1..e1b25f2a1a4633b967f7e634718758d43d6168e7 100644 (file)
@@ -47,14 +47,14 @@ int Blob::*member_pointer;
 // CHECK: TypeRef=T:3:19 [type=T] [typekind=Unexposed] [canonicaltype=type-parameter-0-0] [canonicaltypekind=Unexposed] [isPOD=0]
 // CHECK: Namespace=inner:8:11 (Definition) [type=] [typekind=Invalid] [isPOD=0]
 // CHECK: StructDecl=Bar:10:8 (Definition) [type=outer::inner::Bar] [typekind=Record] [isPOD=0]
-// CHECK: CXXConstructor=Bar:11:3 (Definition) [type=void (outer::Foo<bool> *)] [typekind=FunctionProto] [canonicaltype=void (outer::Foo<bool> *)] [canonicaltypekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [args= [outer::Foo<bool> *] [Pointer]] [isPOD=0]
+// CHECK: CXXConstructor=Bar:11:3 (Definition) [type=void (outer::Foo<bool> *){{.*}}] [typekind=FunctionProto] [canonicaltype=void (outer::Foo<bool> *){{.*}}] [canonicaltypekind=FunctionProto] [resulttype=void] [resulttypekind=Void] [args= [outer::Foo<bool> *] [Pointer]] [isPOD=0]
 // CHECK: ParmDecl=foo:11:25 (Definition) [type=outer::Foo<bool> *] [typekind=Pointer] [canonicaltype=outer::Foo<bool> *] [canonicaltypekind=Pointer] [isPOD=1]
 // CHECK: NamespaceRef=outer:1:11 [type=] [typekind=Invalid] [isPOD=0]
 // CHECK: TemplateRef=Foo:4:8 [type=] [typekind=Invalid] [isPOD=0]
 // CHECK: CompoundStmt= [type=] [typekind=Invalid] [isPOD=0]
 // CHECK: TypedefDecl=FooType:13:15 (Definition) [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
 // CHECK: FieldDecl=p:14:8 (Definition) [type=int *] [typekind=Pointer] [isPOD=1]
-// CHECK: CXXMethod=f:15:8 (Definition) [type=int *(int *, char *, FooType)] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int)] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Typedef]] [isPOD=0]
+// CHECK: CXXMethod=f:15:8 (Definition) [type=int *(int *, char *, FooType){{.*}}] [typekind=FunctionProto] [canonicaltype=int *(int *, char *, int){{.*}}] [canonicaltypekind=FunctionProto] [resulttype=int *] [resulttypekind=Pointer] [args= [int *] [Pointer] [char *] [Pointer] [FooType] [Typedef]] [isPOD=0]
 // CHECK: ParmDecl=p:15:15 (Definition) [type=int *] [typekind=Pointer] [isPOD=1]
 // CHECK: ParmDecl=x:15:24 (Definition) [type=char *] [typekind=Pointer] [isPOD=1]
 // CHECK: ParmDecl=z:15:35 (Definition) [type=FooType] [typekind=Typedef] [canonicaltype=int] [canonicaltypekind=Int] [isPOD=1]
index e49abcda4484d59eeadf41e1f03c119e5d2d75b7..e87d3366ecb99bd2aa42775630b60bc6cac5ad96 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -emit-llvm -o - -chain-include %s -chain-include %s | FileCheck %s
+// RUN: %clang_cc1 %s -emit-llvm -triple i686-pc-linux -o - -chain-include %s -chain-include %s | FileCheck %s
 // CHECK: define linkonce_odr %{{[^ ]+}} @_ZN1AI1BE3getEv
 #if !defined(PASS1)
 #define PASS1
index e5ddd86e380270c7b81a6731dd4557b4313101c0..966ffaa5dfa72c361ae6ff0e8ebefafa4814c30e 100644 (file)
@@ -17,8 +17,8 @@
 // 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
 
-// CHECK: define weak_odr void @_ZN2S4IiE1mEv
-// CHECK: define linkonce_odr void @_ZN2S3IiE1mEv
+// CHECK: define weak_odr {{.*}}void @_ZN2S4IiE1mEv
+// CHECK: define linkonce_odr {{.*}}void @_ZN2S3IiE1mEv
 
 struct A {
   typedef int type;
index a83d7e74d75855e845881709f3b74680dfe56234..c6625e65adadf93492dd318940193974a993975c 100644 (file)
@@ -9,7 +9,7 @@
 // CHECK: call {{.*}} @_ZN1SC1ERKS_
 
 // CHECK: [C setPosition:]
-// CHECK: call %struct.S* @_ZN1SaSERKS_
+// CHECK: call {{.*}} %struct.S* @_ZN1SaSERKS_
 
 // CHECK: [C .cxx_destruct]
 // CHECK: [C .cxx_construct]
index 12cc4ed969899cf92b89333242b3318d3d384a60..0249b5706f185c871bb9ffeec8db6657b85e52f9 100644 (file)
@@ -220,20 +220,20 @@ namespace test1 {
 
   void QualifierTest() {
     void (Qualifiers::*X)();
-    X = &Qualifiers::C; // expected-error {{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() const': different qualifiers (none vs const)}}
-    X = &Qualifiers::V; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() volatile': different qualifiers (none vs volatile)}}
-    X = &Qualifiers::R; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() restrict': different qualifiers (none vs restrict)}}
-    X = &Qualifiers::CV; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() const volatile': different qualifiers (none vs const and volatile)}}
-    X = &Qualifiers::CR; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() const restrict': different qualifiers (none vs const and restrict)}}
-    X = &Qualifiers::VR; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() volatile restrict': different qualifiers (none vs volatile and restrict)}}
-    X = &Qualifiers::CVR; // expected-error{{assigning to 'void (test1::Qualifiers::*)()' from incompatible type 'void (test1::Qualifiers::*)() const volatile restrict': different qualifiers (none vs const, volatile, and restrict)}}
+    X = &Qualifiers::C; // expected-error-re {{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}const': different qualifiers (none vs const)}}
+    X = &Qualifiers::V; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}volatile': different qualifiers (none vs volatile)}}
+    X = &Qualifiers::R; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}restrict': different qualifiers (none vs restrict)}}
+    X = &Qualifiers::CV; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}const volatile': different qualifiers (none vs const and volatile)}}
+    X = &Qualifiers::CR; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}const restrict': different qualifiers (none vs const and restrict)}}
+    X = &Qualifiers::VR; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}volatile restrict': different qualifiers (none vs volatile and restrict)}}
+    X = &Qualifiers::CVR; // expected-error-re{{assigning to 'void (test1::Qualifiers::*)(){{.*}}' from incompatible type 'void (test1::Qualifiers::*)() {{.*}}const volatile restrict': different qualifiers (none vs const, volatile, and restrict)}}
   }
 
   struct Dummy {
     void N() {};
   };
 
-  void (Qualifiers::*X)() = &Dummy::N; // expected-error{{cannot initialize a variable of type 'void (test1::Qualifiers::*)()' with an rvalue of type 'void (test1::Dummy::*)()': different classes ('test1::Qualifiers' vs 'test1::Dummy')}}
+  void (Qualifiers::*X)() = &Dummy::N; // expected-error-re{{cannot initialize a variable of type 'void (test1::Qualifiers::*)(){{.*}}' with an rvalue of type 'void (test1::Dummy::*)(){{.*}}': different classes ('test1::Qualifiers' vs 'test1::Dummy')}}
 }
 
 template <typename T> class PR16561 {
index 1fe350d1977a819ea88c050df96e845713109270..b58184fe5a2adb61dfcdd7ebc0cc8ab889898e88 100644 (file)
@@ -60,7 +60,7 @@ short *bad_const_cast_test(char const *volatile *const volatile *var)
   // Function pointers.
   f fp2 = const_cast<f>(fp1); // expected-error {{const_cast to 'f' (aka 'int (*)(int)'), which is not a reference, pointer-to-object, or pointer-to-data-member}}
   void (A::*mfn)() = 0;
-  (void)const_cast<void (A::*)()>(mfn); // expected-error {{const_cast to 'void (A::*)()', which is not a reference, pointer-to-object, or pointer-to-data-member}}
+  (void)const_cast<void (A::*)()>(mfn); // expected-error-re {{const_cast to 'void (A::*)(){{.*}}', which is not a reference, pointer-to-object, or pointer-to-data-member}}
   (void)const_cast<int&&>(0); // expected-error {{const_cast from rvalue to reference type 'int &&'}} expected-warning {{C++11}}
   return **var3;
 }
index 468c8ecb23c425419e2116115761bc90fef0b84e..bd0525f7f48fee633cc316c6b6ffa922c2331ebe 100644 (file)
@@ -227,6 +227,6 @@ void memptrs()
   void (structure::*psf)() = 0;
   (void)(int (structure::*)())(psf);
 
-  (void)(void (structure::*)())(psi); // expected-error {{C-style cast from 'const int structure::*' to 'void (structure::*)()' is not allowed}}
-  (void)(int structure::*)(psf); // expected-error {{C-style cast from 'void (structure::*)()' to 'int structure::*' is not allowed}}
+  (void)(void (structure::*)())(psi); // expected-error-re {{C-style cast from 'const int structure::*' to 'void (structure::*)(){{.*}}' is not allowed}}
+  (void)(int structure::*)(psf); // expected-error-re {{C-style cast from 'void (structure::*)(){{.*}}' to 'int structure::*' is not allowed}}
 }
index f8e0c465875effa14ec3c69f0f159478a280d8e8..338c957a5f622bd1096864f9165c51734582ba55 100644 (file)
@@ -305,8 +305,8 @@ void memptrs()
   (void)structureimfp(psf);
 
   typedef void (structure::*structurevmfp)();
-  (void)structurevmfp(psi); // expected-error {{functional-style cast from 'const int structure::*' to 'structurevmfp' (aka 'void (structure::*)()') is not allowed}}
-  (void)structureimp(psf); // expected-error {{functional-style cast from 'void (structure::*)()' to 'structureimp' (aka 'int structure::*') is not allowed}}
+  (void)structurevmfp(psi); // expected-error-re {{functional-style cast from 'const int structure::*' to 'structurevmfp' (aka 'void (structure::*)(){{.*}}') is not allowed}}
+  (void)structureimp(psf); // expected-error-re {{functional-style cast from 'void (structure::*)(){{.*}}' to 'structureimp' (aka 'int structure::*') is not allowed}}
 }
 
 // ---------------- misc ------------------
index a4bc4325e65505bcd2e6642a6b99545ee947afa0..b9c53530a72cfa80d7b7ed77da42d890a336b53b 100644 (file)
@@ -96,12 +96,12 @@ void memptrs()
   void (structure::*psf)() = 0;
   (void)reinterpret_cast<int (structure::*)()>(psf);
 
-  (void)reinterpret_cast<void (structure::*)()>(psi); // expected-error {{reinterpret_cast from 'const int structure::*' to 'void (structure::*)()' is not allowed}}
-  (void)reinterpret_cast<int structure::*>(psf); // expected-error {{reinterpret_cast from 'void (structure::*)()' to 'int structure::*' is not allowed}}
+  (void)reinterpret_cast<void (structure::*)()>(psi); // expected-error-re {{reinterpret_cast from 'const int structure::*' to 'void (structure::*)(){{.*}}' is not allowed}}
+  (void)reinterpret_cast<int structure::*>(psf); // expected-error-re {{reinterpret_cast from 'void (structure::*)(){{.*}}' to 'int structure::*' is not allowed}}
 
   // Cannot cast from integers to member pointers, not even the null pointer
   // literal.
-  (void)reinterpret_cast<void (structure::*)()>(0); // expected-error {{reinterpret_cast from 'int' to 'void (structure::*)()' is not allowed}}
+  (void)reinterpret_cast<void (structure::*)()>(0); // expected-error-re {{reinterpret_cast from 'int' to 'void (structure::*)(){{.*}}' is not allowed}}
   (void)reinterpret_cast<int structure::*>(0); // expected-error {{reinterpret_cast from 'int' to 'int structure::*' is not allowed}}
 }
 
index 7fb016ea86d8b1abba100a93129ca15ea6a208a1..8cd27a13a053f8d79dd7359b62b31463655294aa 100644 (file)
@@ -192,6 +192,6 @@ namespace PR6072 {
     (void)static_cast<void (A::*)()>(&B::f);
     (void)static_cast<void (B::*)()>(&B::f);
     (void)static_cast<void (C::*)()>(&B::f);
-    (void)static_cast<void (D::*)()>(&B::f); // expected-error{{address of overloaded function 'f' cannot be static_cast to type 'void (PR6072::D::*)()'}}
+    (void)static_cast<void (D::*)()>(&B::f); // expected-error-re{{address of overloaded function 'f' cannot be static_cast to type 'void (PR6072::D::*)(){{.*}}'}}
   }
 }
index d04046462a04afc4daa65f752c8b414e8e86e1ab..5748f662dc759860699b5b3f46a3df33aeacc572 100644 (file)
@@ -16,7 +16,7 @@ struct X0 {
   } 
   T* f0(T*, T*) { return T(); } // expected-warning{{expression which evaluates to zero treated as a null pointer constant of type 'int *'}}
 
-  template <typename U> T f0(T, U) { return T(); } // expected-note {{candidate template ignored: could not match 'int (int, U)' against 'int (int) const'}} \
+  template <typename U> T f0(T, U) { return T(); } // expected-note-re {{candidate template ignored: could not match 'int (int, U){{.*}}' against 'int (int) {{.*}}const'}} \
                                                    // expected-note {{candidate template ignored: could not match 'int' against 'int *'}}
 };
 
index 5e9da3f688e8b910d0ea8be2949c188762490dda..55b4c6501b856f202409e55fb9d0e7214f86221d 100644 (file)
@@ -178,7 +178,7 @@ namespace PR7022 {
 namespace SameSignatureAfterInstantiation {
   template<typename T> struct S {
     void f(T *); // expected-note {{previous}}
-    void f(const T*); // expected-error {{multiple overloads of 'f' instantiate to the same signature 'void (const int *)'}}
+    void f(const T*); // expected-error-re {{multiple overloads of 'f' instantiate to the same signature 'void (const int *){{.*}}'}}
   };
   S<const int> s; // expected-note {{instantiation}}
 }
index 8f6cc192fa8b35e2b0f11b6e6703afb8827485e7..2921a055c5a5d9507017542fe98d227a9e085e7f 100644 (file)
@@ -82,7 +82,7 @@ struct Z {
 template<int (Z::*pmf)(int)> struct A6; // expected-note{{template parameter is declared here}}
 A6<&Z::foo> *a17_1;
 A6<&Z::bar> *a17_2;
-A6<&Z::baz> *a17_3; // expected-error{{non-type template argument of type 'double (Z::*)(double)' cannot be converted to a value of type 'int (Z::*)(int)'}}
+A6<&Z::baz> *a17_3; // expected-error-re{{non-type template argument of type 'double (Z::*)(double){{.*}}' cannot be converted to a value of type 'int (Z::*)(int){{.*}}'}}
 
 
 template<int Z::*pm> struct A7;  // expected-note{{template parameter is declared here}}