summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/delete.cpp
diff options
context:
space:
mode:
authorPengcheng Wang <wangpengcheng.pp@bytedance.com>2024-04-26 16:59:12 +0800
committerGitHub <noreply@github.com>2024-04-26 16:59:12 +0800
commitcf5a8b489464d09dfdd7a48ce7c8b41d3c9bf819 (patch)
tree4f312f56e5c8f51ed1117f10665724b96c85736c /clang/test/CodeGenCXX/delete.cpp
parent1a343c9b0ff0b38d841a54bdbef130dbdc624451 (diff)
[clang] Enable sized deallocation by default in C++14 onwards (#83774)
Since C++14 has been released for about nine years and most standard libraries have implemented sized deallocation functions, it's time to make this feature default again. This is another try of https://reviews.llvm.org/D112921. Fixes #60061
Diffstat (limited to 'clang/test/CodeGenCXX/delete.cpp')
-rw-r--r--clang/test/CodeGenCXX/delete.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/test/CodeGenCXX/delete.cpp b/clang/test/CodeGenCXX/delete.cpp
index 1a418f48b659..d5b0dc671291 100644
--- a/clang/test/CodeGenCXX/delete.cpp
+++ b/clang/test/CodeGenCXX/delete.cpp
@@ -16,7 +16,7 @@ void t3(S *s) {
// CHECK: icmp {{.*}} null
// CHECK: br i1
- // CHECK: call void @_ZdlPv
+ // CHECK: call void @_ZdlPvm
// Check the delete is inside the 'if !null' check unless we're optimizing
// for size. FIXME: We could omit the branch entirely in this case.
@@ -35,7 +35,7 @@ struct T {
void t4(T *t) {
// CHECK: call void @_ZN1TD1Ev
// CHECK-SIZE-NEXT: br
- // CHECK: call void @_ZdlPv
+ // CHECK: call void @_ZdlPvm
delete t;
}
@@ -93,14 +93,16 @@ namespace test1 {
// CHECK-NEXT: call void @_ZN5test11AD1Ev(ptr {{[^,]*}} [[CUR]])
// CHECK-NEXT: [[ISDONE:%.*]] = icmp eq ptr [[CUR]], [[BEGIN]]
// CHECK-NEXT: br i1 [[ISDONE]]
- // CHECK: call void @_ZdaPv(ptr noundef [[ALLOC]])
+ // CHECK: [[MUL:%.*]] = mul i64 4, [[COUNT]]
+ // CHECK-NEXT: [[SIZE:%.*]] = add i64 [[MUL]], 8
+ // CHECK-NEXT: call void @_ZdaPvm(ptr noundef [[ALLOC]], i64 noundef [[SIZE]])
}
}
namespace test2 {
// CHECK-LABEL: define{{.*}} void @_ZN5test21fEPb
void f(bool *b) {
- // CHECK: call void @_ZdlPv(ptr
+ // CHECK: call void @_ZdlPvm(ptr{{.*}}i64
delete b;
// CHECK: call void @_ZdaPv(ptr
delete [] b;
@@ -137,7 +139,7 @@ namespace test4 {
// CHECK-NEXT: [[DTOR:%.*]] = load ptr, ptr [[T0]]
// CHECK-NEXT: call void [[DTOR]](ptr {{[^,]*}} [[OBJ:%.*]])
// Call the global operator delete.
- // CHECK-NEXT: call void @_ZdlPv(ptr noundef [[ALLOCATED]]) [[NUW:#[0-9]+]]
+ // CHECK-NEXT: call void @_ZdlPvm(ptr noundef [[ALLOCATED]], i64 noundef 8) [[NUW:#[0-9]+]]
::delete xp;
}
}