> -----Original Message----- > From: Jeff Law [mailto:l...@redhat.com] > Sent: Monday, June 03, 2013 2:27 PM > To: Steve Ellcey > Cc: Iyer, Balaji V; gcc-patches@gcc.gnu.org > Subject: 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?
I am OK with Steve's changes in most cases. In a few cases, I am using it as a parameter to pass into tests. On a top-level, the main reason why I used argc, and argv is that, I want to make sure the compiler will never do things like constant propagation, and it will pass it as a variable. Thanks, Balaji V. Iyer. > > jeff >