summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/cxx1y-sized-deallocation.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-11-05 09:12:18 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-11-05 09:12:18 +0000
commit3cebc73895daccea85984d8881b5b45c8f8df9c6 (patch)
tree26dd2d94e349351dd5bfb2a02583ec42a9370542 /test/CodeGenCXX/cxx1y-sized-deallocation.cpp
parent88407bb80311bf95619f80596cb6d5041420814a (diff)
C++1y sized deallocation: if we have a use, but not a definition, of a sized
deallocation function (and the corresponding unsized deallocation function has been declared), emit a weak discardable definition of the function that forwards to the corresponding unsized deallocation. This allows a C++ standard library implementation to provide both a sized and an unsized deallocation function, where the unsized one does not just call the sized one, for instance by putting both in the same object file within an archive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/cxx1y-sized-deallocation.cpp')
-rw-r--r--test/CodeGenCXX/cxx1y-sized-deallocation.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/CodeGenCXX/cxx1y-sized-deallocation.cpp b/test/CodeGenCXX/cxx1y-sized-deallocation.cpp
index 767878365e..642e1e07f6 100644
--- a/test/CodeGenCXX/cxx1y-sized-deallocation.cpp
+++ b/test/CodeGenCXX/cxx1y-sized-deallocation.cpp
@@ -1,5 +1,6 @@
-// RUN: %clang_cc1 -std=c++1y -fsized-deallocation %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s
-// RUN: %clang_cc1 -std=c++1y %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK-UNSIZED
+// RUN: %clang_cc1 -std=c++1y %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -fsized-deallocation %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 %s -emit-llvm -triple x86_64-linux-gnu -o - | FileCheck %s --check-prefix=CHECK-UNSIZED
// CHECK-UNSIZED-NOT: _ZdlPvm
// CHECK-UNSIZED-NOT: _ZdaPvm
@@ -44,6 +45,9 @@ D::D() {}
// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 4)
// CHECK: call void @_ZdaPv(i8* %{{[^ ]*}})
+// CHECK-LABEL: define linkonce void @_ZdlPvm(i8*
+// CHECK: call void @_ZdlPv(i8* %0)
+
// CHECK-LABEL: define weak_odr void @_Z3delI1BEvv()
// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 4)
// CHECK: call void @_ZdaPv(i8* %{{[^ ]*}})
@@ -54,6 +58,9 @@ D::D() {}
// CHECK: add i64 %{{[^ ]*}}, 8
// CHECK: call void @_ZdaPvm(i8* %{{[^ ]*}}, i64 %{{[^ ]*}})
+// CHECK-LABEL: define linkonce void @_ZdaPvm(i8*
+// CHECK: call void @_ZdaPv(i8* %0)
+
// CHECK-LABEL: define weak_odr void @_Z3delI1DEvv()
// CHECK: call void @_ZdlPvm(i8* %{{[^ ]*}}, i64 8)
// CHECK: mul i64 8, %{{[^ ]*}}