diff options
author | John McCall <rjmccall@apple.com> | 2010-04-20 02:18:25 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-04-20 02:18:25 +0000 |
commit | 0f55a035cffbe4da8e4e04e2a60e922da963ec9e (patch) | |
tree | aec75f9928a0c75ebec106d8172b4685adb4fa45 /clang/test/CodeGenCXX/delete.cpp | |
parent | 0c862a86fa0eb18d54901187ace23d75a3972dd9 (diff) | |
download | bcm5719-llvm-0f55a035cffbe4da8e4e04e2a60e922da963ec9e.tar.gz bcm5719-llvm-0f55a035cffbe4da8e4e04e2a60e922da963ec9e.zip |
Restore r101841 without modification. Also mark 'operator delete' as used for
actual delete expressions, not just new expressions.
llvm-svn: 101861
Diffstat (limited to 'clang/test/CodeGenCXX/delete.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/delete.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/clang/test/CodeGenCXX/delete.cpp b/clang/test/CodeGenCXX/delete.cpp index 7cc264f5c5f..87f8698b84c 100644 --- a/clang/test/CodeGenCXX/delete.cpp +++ b/clang/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 +} |