diff options
author | Anders Carlsson <andersca@mac.com> | 2009-11-24 05:08:52 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-11-24 05:08:52 +0000 |
commit | ecf282b0486873309fd58ec4d3ec0dbf983b33d4 (patch) | |
tree | 815a9003c3f355ff6ee8907cb54cdb4628bb1073 /test/CodeGenCXX/virtual-functions-incomplete-types.cpp | |
parent | d02174c1f22974a1f0e2334e393f8345c6d11302 (diff) |
It is common for vtables to contain pointers to functions that have either incomplete return types or incomplete argument types.
Handle this by returning the llvm::OpaqueType for those cases, which CodeGenModule::GetOrCreateLLVMFunction knows about, and treats as being an "incomplete function".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89736 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/virtual-functions-incomplete-types.cpp')
-rw-r--r-- | test/CodeGenCXX/virtual-functions-incomplete-types.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/CodeGenCXX/virtual-functions-incomplete-types.cpp b/test/CodeGenCXX/virtual-functions-incomplete-types.cpp new file mode 100644 index 0000000000..1e1e96286e --- /dev/null +++ b/test/CodeGenCXX/virtual-functions-incomplete-types.cpp @@ -0,0 +1,30 @@ +// RUN: clang-cc %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s + +struct A; + +struct B { + virtual void f(); + virtual A g(); +}; + +void B::f() { } + +// CHECK: declare void @_ZN1B1gEv() + +struct C; + +struct D { + virtual void f(); + virtual C g(); +}; + +void D::f() { } + +struct C { + int a; +}; + +// CHECK: define i64 @_ZN1D1gEv(%struct.B* %this) +C D::g() { + return C(); +} |