On 10/07/2015 09:43 PM, Sabrina Souto wrote:
> I'm understanding that the major of code that I instrumented (in the
> first level of ..gcc-version-x.x/gcc/ and the dirs related to C/C++)
> is part of the 'gcc' driver. If so, this explains the great amount of
> common function calls across the tests.
Which binaries did you instrument? If you refer to xgcc and xg++ - they are
indeed drivers (they will be named gcc and g++ resp. when installed). But most
of code in the 'gcc' directory is related to the compiler proper (cc1 for C,
cc1plus for C++).
> 
> 
>>> Do you mean, for example, that the compiler will always build the AST,
>>> translate to intermediary code representations, etc., regardless of
>>> the compilation option... and it corresponds to a lot of common code
>>> across all tests?
>>
Yes, for the majority of tests (with some exceptions like the preprocessor tests
mentioned by Jonathan). Thus, nonuniform coverage is unsurprising. See also
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00765.html - a proposal to add
unit tests to GCC.

> I ran
> make RUNTESTFLAGS='dg.exp=c90-float-1.c -v -v' check-gcc
> And I saw in the log:
> ...
> doing compile
> Invoking the compiler as
> ../gcc-r227092/objdir/gcc/testsuite/g++/../../xg++ -B/...
> ...
> 
> The test ../testsuite/gcc.dg/c90-float-1.c contains the action: /* {
> dg-do preprocess } */
> So, why "doing compile" was in the execution log? I thought that the
> compiler would not be called in this case.
> Am I running the test in a wrong way?
Probably the message is wrong. Nevertheless, IIRC, the preprocessor is also run
as xg++. xg++ will invoke the compiler proper (cc1plus), which will perform
preprocessing.

> Where can I find all the code that implements the compiler and
> preprocessor? In libcpp, libcc1, boehm-gc ?
Mostly in gcc and libcpp directories. Code from include and libiberty is also 
used.

> Please, help me.
Consider looking at https://gcc.gnu.org/onlinedocs/gccint/Source-Tree.html and
gcc/Makefile.in in more detail.

Finally, note that GCC has some means of test coverage analysis: you can
configure/build it with "--disable-bootstrap --enable-coverage", run the tests
and then use gcov.

-- 
Regards,
    Mikhail Maltsev

Reply via email to