summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/new.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/new.cpp')
-rw-r--r--test/CodeGenCXX/new.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/test/CodeGenCXX/new.cpp b/test/CodeGenCXX/new.cpp
index 480bbcefc08d5..c6cee18456701 100644
--- a/test/CodeGenCXX/new.cpp
+++ b/test/CodeGenCXX/new.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -emit-llvm -o %t &&
+// RUN: clang-cc %s -emit-llvm -o - | FileCheck %s
void t1() {
int* a = new int;
@@ -32,7 +32,7 @@ struct T {
};
void t4() {
- // RUN: grep "call void @_ZN1TC1Ev" %t | count 1 &&
+ // CHECK: call void @_ZN1TC1Ev
T *t = new T;
}
@@ -42,7 +42,7 @@ struct T2 {
};
void t5() {
- // RUN: grep "call void @_ZN2T2C1Eii" %t | count 1
+ // CHECK: call void @_ZN2T2C1Eii
T2 *t2 = new T2(10, 10);
}
@@ -54,3 +54,20 @@ int *t6() {
void t7() {
new int();
}
+
+struct U {
+ ~U();
+};
+
+void t8(int n) {
+ new int[10];
+ new int[n];
+
+ // Non-POD
+ new T[10];
+ new T[n];
+
+ // Cookie required
+ new U[10];
+ new U[n];
+}