diff options
Diffstat (limited to 'test/CodeGenCXX/delete.cpp')
-rw-r--r-- | test/CodeGenCXX/delete.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/test/CodeGenCXX/delete.cpp b/test/CodeGenCXX/delete.cpp index 7cc264f..87f8698 100644 --- a/test/CodeGenCXX/delete.cpp +++ b/test/CodeGenCXX/delete.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm -o %t +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s void t1(int *a) { delete a; @@ -19,8 +19,11 @@ struct T { int a; }; +// CHECK: define void @_Z2t4P1T void t4(T *t) { - // RUN: grep "call void @_ZN1TD1Ev" %t | count 1 + // CHECK: call void @_ZN1TD1Ev + // CHECK-NEXT: bitcast + // CHECK-NEXT: call void @_ZdlPv delete t; } @@ -35,3 +38,22 @@ void f() { delete a; } + +namespace test0 { + struct A { + void *operator new(__SIZE_TYPE__ sz); + void operator delete(void *p) { ::operator delete(p); } + ~A() {} + }; + + // CHECK: define void @_ZN5test04testEPNS_1AE( + void test(A *a) { + // CHECK: call void @_ZN5test01AD1Ev + // CHECK-NEXT: bitcast + // CHECK-NEXT: call void @_ZN5test01AdlEPv + delete a; + } + + // CHECK: define linkonce_odr void @_ZN5test01AD1Ev + // CHECK: define linkonce_odr void @_ZN5test01AdlEPv +} |