summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/new.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-05-31 21:53:59 +0000
committerAnders Carlsson <andersca@mac.com>2009-05-31 21:53:59 +0000
commitcba81fc4de83b0ffa430c94b9ad88b8cf7bb1622 (patch)
tree2ddec7164ec58fdf2fa005bd07735ad812304cff /clang/test/CodeGenCXX/new.cpp
parent96c012ff8b89dc0ae97db225ccee68e862caed59 (diff)
downloadbcm5719-llvm-cba81fc4de83b0ffa430c94b9ad88b8cf7bb1622.tar.gz
bcm5719-llvm-cba81fc4de83b0ffa430c94b9ad88b8cf7bb1622.zip
Improve irgen of 'new' further.
llvm-svn: 72677
Diffstat (limited to 'clang/test/CodeGenCXX/new.cpp')
-rw-r--r--clang/test/CodeGenCXX/new.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/new.cpp b/clang/test/CodeGenCXX/new.cpp
index bf959c95c85..e3d1ec1df6c 100644
--- a/clang/test/CodeGenCXX/new.cpp
+++ b/clang/test/CodeGenCXX/new.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc %s -emit-llvm -o %t
+// RUN: clang-cc %s -emit-llvm -o %t &&
void t1() {
int* a = new int;
@@ -15,6 +15,7 @@ struct S {
int a;
};
+// POD types.
void t3() {
int *a = new int(10);
_Complex int* b = new _Complex int(10i);
@@ -23,3 +24,24 @@ void t3() {
s.a = 10;
S *sp = new S(s);
}
+
+// Non-POD
+struct T {
+ T();
+ int a;
+};
+
+void t4() {
+ // RUN: grep "call void @_ZN1TC1Ev" %t | count 1 &&
+ T *t = new T;
+}
+
+struct T2 {
+ int a;
+ T2(int, int);
+};
+
+void t5() {
+ // RUN: grep "call void @_ZN2T2C1Eii" %t | count 1
+ T2 *t2 = new T2(10, 10);
+}
OpenPOWER on IntegriCloud