Commit Graph

169 Commits

Author SHA1 Message Date
Axel Naumann
dcf31e7e39 Skip this test; it is unreliable. 2014-01-23 11:33:54 +01:00
Axel Naumann
10464f6fe1 Add test for recursive static init. 2014-01-22 15:59:56 +01:00
Axel Naumann
4f07ffa888 Refer to license in C files. 2014-01-07 12:02:58 +01:00
Axel Naumann
8aedeca69c Refer to license in CMake files. 2014-01-07 12:02:58 +01:00
Axel Naumann
d240bd5de8 Refer to license in test and demo files. 2014-01-07 12:02:58 +01:00
Axel Naumann
44481ace1e Fix license; remove $Id$ version. 2014-01-07 11:14:04 +01:00
Axel Naumann
5da6e646a5 Correct licenses in Makefiles. 2014-01-07 11:13:56 +01:00
Axel Naumann
47475c9934 Do not run the test at all on 32bit: it might or might not fail. 2013-12-17 15:29:49 +01:00
Axel Naumann
51f03371e1 Aggregate returns do not work on 32bit; see ROOT-5860. 2013-12-17 13:54:53 +01:00
Axel Naumann
020af968f0 Resolve Elab and TemplSpecTypes; use short name for dtor; test (ROOT-5839). 2013-12-12 21:46:51 +01:00
Vassil Vassilev
318427ba99 Reset the diagnostic client on recovery too. 2013-12-12 14:44:53 +01:00
Axel Naumann
b0fe13d878 Test lifetime handling of StoredValue. 2013-12-11 12:14:52 +01:00
Vassil Vassilev
3751cef9a9 Test canonical specialization removal. 2013-12-11 11:33:13 +01:00
Axel Naumann
490f9084d3 Add test for Interpreter::compileFunction(). 2013-12-09 16:35:01 +01:00
Vassil Vassilev
e054a8126b Test enum constant cleanup. 2013-12-06 12:03:34 +01:00
Vassil Vassilev
b41a282ae6 Add error recovery and unloading tests. 2013-12-06 12:03:33 +01:00
Vassil Vassilev
16b82159ea Revert the unintentional change in test. 2013-11-25 13:56:03 +01:00
Vassil Vassilev
26b0a13f81 Use the correct interface to check for emptiness. 2013-11-25 13:56:02 +01:00
CristinaCristescu
4a8b33b878 ErrorRecovery test. 2013-11-25 13:56:01 +01:00
CristinaCristescu
0490caaa99 Macro recovery 2013-11-25 13:56:00 +01:00
Philippe Canal
3daaffb035 Add missing header 2013-11-19 05:33:55 +01:00
Philippe Canal
c423ae3bc8 Add LookupHelper::findDataMember to retrive a field or variable. 2013-11-19 04:37:11 +01:00
Philippe Canal
388271f9e9 Add cling::LookupHelper::findFunctionTemplate
Given a context and a name (and a constness), return the corresponding
function template decl.
2013-11-13 19:46:00 +01:00
Philippe Canal
e0e2df65e5 Allow findAnyFunction to discover a template instance without any argument hints
This allows to find an existing function template instance even based on only
the template name (of course, in this case, no instantiation is done, only already
existing ones can be returned).

This allows add there same features to TListOfFunctions::FindObject and
TViewAllPublicFunctions::FindObject.
2013-11-13 19:45:59 +01:00
Philippe Canal
baebf42627 Add comment clarifying ROOT-4602 2013-11-06 21:39:56 +01:00
Philippe Canal
27b213ed73 Properly handled (partial) desugaring of 'const NS::Something_t'
TClassEdit::ResolveTypedef was not properly handling the leading const
if there is a namespace in the name (and no template).

Transform::GetPartiallyDesugaredType was not keeping the 'const' in case
the target of the typedef was in the global scope (for example being a
fundamental type).

This fixes ROOT-5576
2013-11-06 21:39:55 +01:00
Philippe Canal
1b8795f0c3 In findFunction*, add template instantiation if needed.
Update the test accordingly.
2013-11-04 14:35:07 +01:00
Philippe Canal
66d3abc12c Add instantiation (if needed) to findAnyFunction 2013-11-04 14:35:06 +01:00
Philippe Canal
0adde75bd2 In findAnyFunction, properly handle the template case.
As the other findFunction*, findAnyFunction does not
(yet?) instantiate the function template if has not
yet been instantiated.

Also add test for findAnyFunction.
2013-11-04 14:35:06 +01:00
Philippe Canal
b96f1409ac In GetPartiallyDesugaredType add support for expression as template parameter.
For example:
namespace edm {
  template <int I> class Hash {};
  const int typeN =1;
  typedef Hash<typeN> ParentageID;
}

edm::ParentageID should be desugared to edm::Hash<1>.
2013-10-30 13:44:58 +01:00
Vassil Vassilev
a08152d576 Enhance the support for removing global values from the module with JIT lock.
When the machine code was generated the JIT retains a lock to the global values
so they don't go out of sync. In the cases of circular references like:
int g();
int f() {g();}
int g() {f();}
we cannot count on the removal order to get rid of the uses. We need to use the
replaceAllUsesWith. This is however tricky because the JIT already generated the
code for f and g and it doesn't make sense to replace anything with anything else.

Thus in order to support that we need to hack one of the JIT callbacks which
prevents the replace of values of already emitted code.
2013-10-29 20:19:24 +01:00
Vassil Vassilev
bf03ba5040 Fail the test because of the dead constant leftover. 2013-10-29 20:19:24 +01:00
Vassil Vassilev
5765fb83f5 Add test for unloading classes. 2013-10-29 20:19:23 +01:00
Vassil Vassilev
64b1a77356 Fix the case when the decl doesn't need mangling, adapt the test to the new impl. 2013-10-29 20:19:23 +01:00
Vassil Vassilev
9b352aa828 Use store/compare state for detailed verification. 2013-10-29 20:19:17 +01:00
Vassil Vassilev
846aac852c Assert that the reference came from the static initializers and upgrade the test.
The compiled code is unloaded by iterating the AST out of which the compiled code
came. The problem is that C++ supports static initialization. For example:
int a = 5; on the global scope means set the value of a to 5 before the program
starts. To support that clang implicitly generates functions that enforce the
expected initialization order. That can become easily very complex. Let's see
a more "real-life" example:

int f() { printf("I am f()"); return 0; }
int a = f();

Besides the code for a and f clang will emit:
define internal void @__cxx_global_var_init() section "__TEXT,__StaticInit,regular,pure_instructions" {
entry:
  %0 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%"struct.cling::runtime::internal::__trigger__cxa_atexit"*)* @_ZN5cling7runtime8internal21__trigger__cxa_atexitD1Ev to void (i8*)*), i8* getelementptr inbounds (%"struct.cling::runtime::internal::__trigger__cxa_atexit"* @_ZN5cling7runtime8internal1SE, i32 0, i32 0), i8* @__dso_handle) #1
  ret void
}
define internal void @_GLOBAL__I_a() section "__TEXT,__StaticInit,regular,pure_instructions" {
entry:
  call void @__cxx_global_var_init()
  ret void
}

and more importantly:

define internal void @__cxx_global_var_init1() section "__TEXT,__StaticInit,regular,pure_instructions" {
entry:
  %call = call i32 @_Z1fv() ; THAT IS A REFERENCE TO f()
  store i32 %call, i32* undef, align 4
  ret void
}

So when iterating the AST and trying to remove f(), we cannot because it is still
referenced by __cxx_global_var_init1. However we know this is not an issue,
because that __cxx_global_var_init1 was meant to be executed only once and that
already happened. So in first approximation we could drop the references of f
in __cxx_global_var_init1 and remove the rest.
2013-10-29 20:19:12 +01:00
Axel Naumann
4de45c1b85 Add include path. 2013-10-17 12:38:55 +02:00
Axel Naumann
3c7481a11c Not using exceptions anymore thus these now work on 32bit. 2013-10-14 17:10:55 +02:00
Vassil Vassilev
694a0e4c3f Update the CHECK-NOT clause. 2013-10-14 11:48:55 +02:00
Vassil Vassilev
3d7b328517 Add future tests for implicit auto, when it gets fully adopted in cling.
The adoption should be done soon.
2013-10-14 09:11:40 +02:00
Vassil Vassilev
e43a6a6816 Fix broken by construction test. 2013-10-14 09:11:39 +02:00
Vassil Vassilev
2ce823fbef We don't need -verify. 2013-10-14 09:11:39 +02:00
Vassil Vassilev
eade01b61f Check against the new message printed out if there were differences. 2013-10-14 09:11:39 +02:00
Vassil Vassilev
a1395d0401 Revert the right cached files even when there are macros involved.
Fix the semantic of the test.
2013-10-14 09:11:39 +02:00
Vassil Vassilev
a0df2fac1d Add the -I so that Redeclarables.h can be found. 2013-10-14 09:11:39 +02:00
Vassil Vassilev
41b0539819 Don't forget to add FileCheck. 2013-10-14 09:11:39 +02:00
Vassil Vassilev
559b978279 Fix test semantics. 2013-10-14 09:11:39 +02:00
Vassil Vassilev
26eec6ab21 Now expected errors are printed out and filecheck cannot skip them. This is actually an improvement in newest llvm. In that case we don't need to run the test twice. 2013-10-14 09:11:38 +02:00
Vassil Vassilev
ffa77e6521 We cannot forward declare a function inside a function. 2013-10-14 09:11:38 +02:00
Axel Naumann
84b49183f3 Adapt to new diag format. 2013-10-03 09:54:00 +02:00