This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, testsuite, cilk] Fix cilk tests for simulators


On 06/03/2013 11:49 AM, Steve Ellcey wrote:

A number of the new cilk tests in gcc/testsuite/c-c++-common/cilk-plus/AN
fail for me when run via the gnu simulator on mips.  The problem is that
the gnu simulator does not set up argc and argv.  After asking in the gdb
mailing list I believe this is an issue for multiple simulators on multiple
platforms.  Looking through the GCC testsuite I did not see any other tests
that looked at argc/argv so I would like to change these tests to not use
argc/argv either.  In some tests I added a define (IN_GCC_TESTSUITE) that
I set to 1 and then don't check argc if this is set, in others I just used
the constant value 1 instead of using argc and in one (where argc was being
changed) I replaced the use of argc with a local variable.

Tested on mips-mti-elf with the GNU simulator.
Yea, this should have been caught earlier. argc/argv aren't set properly in many simulator environments.

  {
    int x = 0;
-  if (argc == 1)
+  if (argc == 1 || IN_GCC_TESTSUITE)
So why not just eliminate the conditional completely and simplify the test appropriately? The only reason I can think of to keep it as-is would be if the test were from another suite and we wanted to minimize the amount of divergence from that other testsuite.

Balaji, is there a good reason to keep the argc/argv usage in these tests?

jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]