diff options
author | Anders Carlsson <andersca@mac.com> | 2009-10-15 00:51:46 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-10-15 00:51:46 +0000 |
commit | 66413c29d395e69219302025203434558e462617 (patch) | |
tree | d84e56d8744822d3b571dd5d2330e11978db4907 /clang/test/CodeGenCXX/references.cpp | |
parent | 63dce025449eecf17678ce1c5b6fac4a1b582e9e (diff) | |
download | bcm5719-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.cpp | 9 |
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(); +} + |