From: Richard Smith Date: Tue, 14 Jun 2016 00:48:35 +0000 (+0000) Subject: Add a test to ensure that pass_object_size is handled properly by a delegate constructor. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3e511efa3b89495cc2f863c30e72ec6b6b26c3e;p=clang Add a test to ensure that pass_object_size is handled properly by a delegate constructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272605 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGenCXX/pass-object-size.cpp b/test/CodeGenCXX/pass-object-size.cpp index 2c7f9742a8..0a093c8dea 100644 --- a/test/CodeGenCXX/pass-object-size.cpp +++ b/test/CodeGenCXX/pass-object-size.cpp @@ -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{{[^,]*}}) +}