summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Misc/ast-dump-stmt.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Misc/ast-dump-stmt.cpp b/clang/test/Misc/ast-dump-stmt.cpp
index 72205c130e0..472c71365e1 100644
--- a/clang/test/Misc/ast-dump-stmt.cpp
+++ b/clang/test/Misc/ast-dump-stmt.cpp
@@ -38,3 +38,20 @@ void TestCatch2() {
catch (...) {
}
}
+
+void TestAllocationExprs() {
+ int *p;
+ p = new int;
+ delete p;
+ p = new int[2];
+ delete[] p;
+ p = ::new int;
+ ::delete p;
+}
+// CHECK: FunctionDecl {{.*}} TestAllocationExprs
+// CHECK: CXXNewExpr {{.*}} 'int *' Function {{.*}} 'operator new'
+// CHECK: CXXDeleteExpr {{.*}} 'void' Function {{.*}} 'operator delete'
+// CHECK: CXXNewExpr {{.*}} 'int *' array Function {{.*}} 'operator new[]'
+// CHECK: CXXDeleteExpr {{.*}} 'void' array Function {{.*}} 'operator delete[]'
+// CHECK: CXXNewExpr {{.*}} 'int *' global Function {{.*}} 'operator new'
+// CHECK: CXXDeleteExpr {{.*}} 'void' global Function {{.*}} 'operator delete'
OpenPOWER on IntegriCloud