summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/references.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-10-15 00:51:46 +0000
committerAnders Carlsson <andersca@mac.com>2009-10-15 00:51:46 +0000
commit66413c29d395e69219302025203434558e462617 (patch)
treed84e56d8744822d3b571dd5d2330e11978db4907 /clang/test/CodeGenCXX/references.cpp
parent63dce025449eecf17678ce1c5b6fac4a1b582e9e (diff)
downloadbcm5719-llvm-66413c29d395e69219302025203434558e462617.tar.gz
bcm5719-llvm-66413c29d395e69219302025203434558e462617.zip
Handle
struct A { }; struct B : A { }; void f() { const A& a = B(); } correctly. (This now does the offset conversion if necessary and calls the destructor when a goes out of scope). llvm-svn: 84162
Diffstat (limited to 'clang/test/CodeGenCXX/references.cpp')
-rw-r--r--clang/test/CodeGenCXX/references.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/references.cpp b/clang/test/CodeGenCXX/references.cpp
index c235521d43b..32d46b3e104 100644
--- a/clang/test/CodeGenCXX/references.cpp
+++ b/clang/test/CodeGenCXX/references.cpp
@@ -1,4 +1,4 @@
-// RUN: clang-cc -verify -emit-llvm -o %t %s
+// RUN: clang-cc -verify -emit-llvm -o - %s | FileCheck %s
void t1() {
extern int& a;
@@ -100,3 +100,10 @@ void f(A* a) {
void *foo = 0;
void * const & kFoo = foo;
+struct D : C { D(); ~D(); };
+
+void h() {
+ // CHECK: call void @_ZN1DD1Ev
+ const C& c = D();
+}
+
OpenPOWER on IntegriCloud