This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Understand GCC test process
- From: Mikhail Maltsev <maltsevm at gmail dot com>
- To: Sabrina Souto <sabrinadfs at gmail dot com>, Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 08 Oct 2015 03:04:29 +0300
- Subject: Re: Understand GCC test process
- Authentication-results: sourceware.org; auth=none
- References: <CAA1wpi1MCPPBqmr2iCKmpdiG5gu5zL=MOAx+y1cEtfzxkMajLg at mail dot gmail dot com> <CAH6eHdSaqsn8xDSG46GwMvgVjGOoRoPtkXC5t+AbAvg=_jkkkA at mail dot gmail dot com> <CAA1wpi3y_SO8s_pjaZS-fC6GgfkuDCOnnaQNurDJkZi1kqJY7w at mail dot gmail dot com> <CAH6eHdTwhgLHWQhsdrB9ZUX3=LD3m-m=hBGXswmyT0c2+c5DHQ at mail dot gmail dot com> <CAA1wpi22TZ=awDNWRBtechjamK+T+Z3LiB7GnsnXO1sdMUxp2w at mail dot gmail dot com> <CAH6eHdQhBsu6BfRFpikXEeBsvN=fV9O16ytp-Vb41ke++Zt_iQ at mail dot gmail dot com> <CAA1wpi0om0ZoFPopu0j4YmGM_iFNM4H8-2NwKunu2Ta-SEHuRA at mail dot gmail dot com> <CAH6eHdSytBH4nWEQyRKDN15htwwYd1yfienLS1yn6eZ0EsfF=g at mail dot gmail dot com> <CAA1wpi0o+93pJOaG6XWyJhWfyL83C4gTyESXzO_zQuHb_9rOfA at mail dot gmail dot com>
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