11 Commits

Author SHA1 Message Date
Vassil Vassilev
8f257e74d3 Create a virtual file entry for each input line.
This is the only way not to confuse the diagnostics engine of upgraded clang.

Also, this gives us a few advantages:
  * We can compare more precisely the source locations of diagnostics;
  * We can merge the code completion code path which works with file entries;
  * We can rely better when specifying //expected-note-s in different files.
2017-06-08 10:29:13 +02:00
Frederich Munch
be7769aa5d Remove .rawInput from a variety of tests to test unwrapped function input. 2016-09-05 12:44:13 +02:00
Vassil Vassilev
666437108e Replace .U with .undo 2014-03-31 14:03:09 +02:00
Vassil Vassilev
f6f4c707d4 Add a dead code removal pass. The test is expected to succeed now.
Removing a GlobalValue from the module might make other values (referenced only
by the one being removed) available for removal. Those should go as well. The
initial implementation is a bit greedy - it removes more: i.e dtors because they
are not referenced (because IncrementalExecutor takes care of them in an custom
way)
2014-03-14 10:52:29 +01:00
Axel Naumann
d240bd5de8 Refer to license in test and demo files. 2014-01-07 12:02:58 +01:00
Vassil Vassilev
bf03ba5040 Fail the test because of the dead constant leftover. 2013-10-29 20:19:24 +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
Vassil Vassilev
2ce823fbef We don't need -verify. 2013-10-14 09:11:39 +02:00
Vassil Vassilev
38a05dd1df We don't need to add header search path for that particular test.
git-svn-id: http://root.cern.ch/svn/root/trunk@47779 27541ba8-7e3a-0410-8455-c3a389f83636
2012-12-02 19:25:49 +00:00
Axel Naumann
05ba8a3a07 Move cling from cint/ to interpreter/ (Will add a "we have moved" readme to cint/cling.)
git-svn-id: http://root.cern.ch/svn/root/trunk@45844 27541ba8-7e3a-0410-8455-c3a389f83636
2012-09-05 09:37:39 +00:00