Add test exposing the problem with the partial code generation.
git-svn-id: http://root.cern.ch/svn/root/trunk@47417 27541ba8-7e3a-0410-8455-c3a389f83636
This commit is contained in:
parent
3a684ca4d6
commit
9fce4384b9
29
test/CodeGeneration/VTables.C
Normal file
29
test/CodeGeneration/VTables.C
Normal file
@ -0,0 +1,29 @@
|
||||
// RUN: cat %s | %cling | FileCheck %s
|
||||
#include "cling/Interpreter/Interpreter.h"
|
||||
#include "cling/Interpreter/LookupHelper.h"
|
||||
#include "cling/Utils/AST.h"
|
||||
#include "clang/AST/Decl.h"
|
||||
#include "llvm/Support/Casting.h"
|
||||
.rawInput
|
||||
|
||||
template <typename T> struct C {
|
||||
virtual void f() {}
|
||||
static int S;
|
||||
};
|
||||
template<typename T> int C<T>::S = 12;
|
||||
template class C<int>;
|
||||
|
||||
.rawInput
|
||||
|
||||
const cling::LookupHelper& lh = gCling->getLookupHelper();
|
||||
const clang::NamedDecl* D = 0;
|
||||
|
||||
clang::DeclContext* DC = 0;
|
||||
DC = llvm::dyn_cast_or_null<clang::DeclContext>(const_cast<clang::Decl*>(lh.findScope("C<int>")));
|
||||
D = cling::utils::Lookup::Named(&gCling->getSema(), "S", DC);
|
||||
gCling->getAddressOfGlobal(D)
|
||||
//CHECK-NOT: (void *) 0x0
|
||||
|
||||
D = cling::utils::Lookup::Named(&S, "f", DC);
|
||||
gCling->getAddressOfGlobal(D)
|
||||
//TODO-CHECK-NOT: (void *) 0x0
|
3
test/CodeGeneration/dg.exp
Normal file
3
test/CodeGeneration/dg.exp
Normal file
@ -0,0 +1,3 @@
|
||||
load_lib llvm.exp
|
||||
|
||||
RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,C,cpp}]]
|
Loading…
x
Reference in New Issue
Block a user