On Fri, Dec 09, 2011 at 01:45:48PM -0600, Aldy Hernandez wrote: > On 12/09/11 13:19, Jakub Jelinek wrote: >> On Fri, Dec 09, 2011 at 08:17:04PM +0100, Dominique Dhumieres wrote: >>>> +/* { dg-final { scan-assembler "movl.*, (_?var|\\(%)" } } */ >>> >>> It works for me too. >> >> Except that when matching just , (% it doesn't test almost anything. >> IMNSHO you should instead just test it { target !fpic } or similar. >> The _? in there is useful though. >> >> Jakub > > I assume you mean it tests almost anything, in which case I thought the > source tiny enough to not elicit any more loads that could be matched. > But the test is annoyingly system dependent. > > How about the patch below? > > I used nonpic instead of "!fpic", as check_effective_target_fpic tests > whether -fpic/-fPIC is supported in the driver, which will obviously > return true even if we're not generating PIC code. OTOH > check_effective_target_nonpic tests whether we are generating PIC code > by checking "#if __PIC__" which I believe is what we want. > > Does this work for everyone?
This works for x86_64-apple-darwin11 using... make -k check RUNTESTFLAGS="dg.exp=cxxbitfields-3.c --target_board=unix'{-m32,-m64}'" > * c-c++-common/cxxbitfields-3.c: Adjust regexp. > > Index: c-c++-common/cxxbitfields-3.c > =================================================================== > --- c-c++-common/cxxbitfields-3.c (revision 182028) > +++ c-c++-common/cxxbitfields-3.c (working copy) > @@ -18,4 +18,4 @@ void setit() > var.j = 5; > } > > -/* { dg-final { scan-assembler "movl.*, var" } } */ > +/* { dg-final { scan-assembler "movl.*, _?var" { target nonpic } } } */