summaryrefslogtreecommitdiff
path: root/test/Transforms
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-07-21 23:11:42 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-07-21 23:11:42 +0000
commit72c8331ec1437f8c33fff1dac1ea0ebb11009411 (patch)
tree158b20d33bd16f2e4beb08930321c8c47e053239 /test/Transforms
parent02a1364bf8ede511ad603e5aa99ea7dbf11f0609 (diff)
downloadllvm-72c8331ec1437f8c33fff1dac1ea0ebb11009411.tar.gz
llvm-72c8331ec1437f8c33fff1dac1ea0ebb11009411.tar.bz2
llvm-72c8331ec1437f8c33fff1dac1ea0ebb11009411.tar.xz
Treat nothrow forms of ::operator delete and ::operator delete[] as
deallocation functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186798 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/InstCombine/malloc-free-delete.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/malloc-free-delete.ll b/test/Transforms/InstCombine/malloc-free-delete.ll
index ba294b120c..2085206538 100644
--- a/test/Transforms/InstCombine/malloc-free-delete.ll
+++ b/test/Transforms/InstCombine/malloc-free-delete.ll
@@ -120,3 +120,27 @@ if.then: ; preds = %entry
if.end: ; preds = %entry, %if.then
ret void
}
+
+declare i8* @_ZnwmRKSt9nothrow_t(i64, i8*) nobuiltin
+declare void @_ZdlPvRKSt9nothrow_t(i8*, i8*) nobuiltin
+declare i32 @__gxx_personality_v0(...)
+declare void @_ZN1AC2Ev(i8* %this)
+
+; CHECK-LABEL: @test7(
+define void @test7() {
+entry:
+ %nt = alloca i8
+ ; CHECK-NOT: call {{.*}}@_ZnwmRKSt9nothrow_t(
+ %call.i = tail call i8* @_ZnwmRKSt9nothrow_t(i64 1, i8* %nt) builtin nounwind
+ invoke void @_ZN1AC2Ev(i8* undef)
+ to label %.noexc.i unwind label %lpad.i
+
+.noexc.i: ; preds = %entry
+ unreachable
+
+lpad.i: ; preds = %entry
+ %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) cleanup
+ ; CHECK-NOT: call {{.*}}@_ZdlPvRKSt9nothrow_t(
+ call void @_ZdlPvRKSt9nothrow_t(i8* %call.i, i8* %nt) builtin nounwind
+ resume { i8*, i32 } %0
+}