r272605 - Add a test to ensure that pass_object_size is handled properly by a delegate constructor.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 13 17:48:36 PDT 2016


Author: rsmith
Date: Mon Jun 13 19:48:35 2016
New Revision: 272605

URL: http://llvm.org/viewvc/llvm-project?rev=272605&view=rev
Log:
Add a test to ensure that pass_object_size is handled properly by a delegate constructor.

Modified:
    cfe/trunk/test/CodeGenCXX/pass-object-size.cpp

Modified: cfe/trunk/test/CodeGenCXX/pass-object-size.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/pass-object-size.cpp?rev=272605&r1=272604&r2=272605&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/pass-object-size.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/pass-object-size.cpp Mon Jun 13 19:48:35 2016
@@ -43,3 +43,13 @@ void Test() {
   (&OvlFoo)(nullptr);
 }
 }
+
+namespace delegate {
+  struct A {
+    A(void *const p __attribute__((pass_object_size(0))));
+  };
+  A::A(void *const p __attribute__((pass_object_size(0)))) {}
+  // Ensure that we forward the size through a delegating constructor call.
+  // CHECK: define void @_ZN8delegate1AC1EPvU17pass_object_size0({{[^,]*}}, i8*{{[^,]*}}, i64{{[^,]*}})
+  // CHECK: call void @_ZN8delegate1AC2EPvU17pass_object_size0({{[^,]*}}, i8*{{[^,]*}}, i64{{[^,]*}})
+}




More information about the cfe-commits mailing list