]> granicus.if.org Git - clang/commitdiff
Add a test to ensure that pass_object_size is handled properly by a delegate constructor.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 14 Jun 2016 00:48:35 +0000 (00:48 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 14 Jun 2016 00:48:35 +0000 (00:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272605 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/pass-object-size.cpp

index 2c7f9742a8e671b83af1939264090edf32d73e31..0a093c8deacbe6e2cae3467c45f161741fc0959b 100644 (file)
@@ -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{{[^,]*}})
+}