Message ID | CAO2gOZU6_0ciDN5eAangX+LNyv33V7wkSFywz=nfomBjnHwiUA@mail.gmail.com |
---|---|
State | New |
Headers | show |
> The attached patch restricts the test only run on linux-gnu targets. Is it ok? Ideally we would restrict the test to those targets where HAVE_AS_DWARF2_DEBUG_LINE is set, but I don't think that can be done in dg. OK if no one suggests a way to do exactly that. -cary > gcc/ChangeLog: > > 2013-05-28 Dehao Chen <dehao@google.com> > testsuite/debug/dwarf2/discriminator.c: Restrict the test to linux only. > > Index: gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c > =================================================================== > --- gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c (revision 199393) > +++ gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c (working copy) > @@ -1,4 +1,4 @@ > -/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */ > +/* { dg-do compile { target { i?86-*-linux-gnu x86_64-*-linux-gnu } } } */ > /* { dg-options "-O0 -gdwarf-2" } */ > /* { dg-final { scan-assembler "loc \[0-9] 9 \[0-9]( is_stmt \[0-9])?\n" } } */ > /* { dg-final { scan-assembler "loc \[0-9] 9 \[0-9]( is_stmt \[0-9])? > discriminator 2\n" } } */
On May 28, 2013, at 3:56 PM, Dehao Chen <dehao@google.com> wrote:
> The attached patch restricts the test only run on linux-gnu targets. Is it ok?
Ok. You can put HAVE_AS_DWARF2_DEBUG_LINE in a comment above it to help explain why the target restriction applies. The idea is, if enough people care, or some x86 target (say, darwin), want to reliably find them all, one can then search for that and fix them all in one go.
Mike Stump <mrs@mrs.kithrup.com> writes: > On May 28, 2013, at 3:56 PM, Dehao Chen <dehao@google.com> wrote: >> The attached patch restricts the test only run on linux-gnu targets. Is it ok? > > Ok. You can put HAVE_AS_DWARF2_DEBUG_LINE in a comment above it to help > explain why the target restriction applies. The idea is, if enough people > care, or some x86 target (say, darwin), want to reliably find them all, one > can then search for that and fix them all in one go. Right, this does work e.g. on Solaris/x86 with gas, but fails with Sun as or Darwin as. Btw., why is this even x86 specific? At least on Solaris/SPARC with gas, HAVE_AS_DWARF2_DEBUG_LINE *is* defined. And why do you add -gdwarf-2 in dg-options? AFAICS all tests in gcc.dg/debug/dwarf2 are built with -gdwarf-2 anyway. Perhaps you need just { dg-additional-options "-O0" } instead? Also, please mention PR testsuite/57413 in the ChangeLog and move the addition of the testcase from gcc/ChangeLog to gcc/testsuite/ChangeLog, removing the testsuite/ prefix in the pathname. Thanks. Rainer
Patch updated and committed as r199412. Thanks, Dehao
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes: > And why do you add -gdwarf-2 in dg-options? AFAICS all tests in > gcc.dg/debug/dwarf2 are built with -gdwarf-2 anyway. Do they? Not here. Executing on host: /daten/aranym/gcc/gcc-20130530/Build/gcc/xgcc -B/daten/aranym/gcc/gcc-20130530/Build/gcc/ /daten/aranym/gcc/gcc-20130530/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c -fno-diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors -O0 -ffat-lto-objects -ffat-lto-objects -ffat-lto-objects -S -o discriminator.s (timeout = 300) spawn /daten/aranym/gcc/gcc-20130530/Build/gcc/xgcc -B/daten/aranym/gcc/gcc-20130530/Build/gcc/ /daten/aranym/gcc/gcc-20130530/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c -fno-diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors -O0 -ffat-lto-objects -ffat-lto-objects -ffat-lto-objects -S -o discriminator.s PASS: gcc.dg/debug/dwarf2/discriminator.c (test for excess errors) FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 [0-9]( is_stmt [0-9])?\n FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 [0-9]( is_stmt [0-9])? discriminator 2\n FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 [0-9]( is_stmt [0-9])? discriminator 1\n Andreas.
On Thu, May 30, 2013 at 1:40 AM, Andreas Schwab <schwab@linux-m68k.org> wrote: > Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes: > >> And why do you add -gdwarf-2 in dg-options? AFAICS all tests in >> gcc.dg/debug/dwarf2 are built with -gdwarf-2 anyway. > > Do they? Not here. > > Executing on host: /daten/aranym/gcc/gcc-20130530/Build/gcc/xgcc -B/daten/aranym/gcc/gcc-20130530/Build/gcc/ /daten/aranym/gcc/gcc-20130530/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c -fno-diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors -O0 -ffat-lto-objects -ffat-lto-objects -ffat-lto-objects -S -o discriminator.s (timeout = 300) > spawn /daten/aranym/gcc/gcc-20130530/Build/gcc/xgcc -B/daten/aranym/gcc/gcc-20130530/Build/gcc/ /daten/aranym/gcc/gcc-20130530/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c -fno-diagnostics-show-caret -fdiagnostics-color=never -ansi -pedantic-errors -O0 -ffat-lto-objects -ffat-lto-objects -ffat-lto-objects -S -o discriminator.s > PASS: gcc.dg/debug/dwarf2/discriminator.c (test for excess errors) > FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 [0-9]( is_stmt [0-9])?\n > FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 [0-9]( is_stmt [0-9])? discriminator 2\n > FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 [0-9]( is_stmt [0-9])? discriminator 1\n That's weird cause in dwarf2.exp: # If a testcase doesn't have special options, use these. global DEFAULT_CFLAGS if ![info exists DEFAULT_CFLAGS] then { set DEFAULT_CFLAGS " -ansi -pedantic-errors -gdwarf-2" } But anyway, shall I add the -gdwarf-2 option back to discriminator.c? Dehao > > Andreas. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 > "And now for something completely different."
> That's weird cause in dwarf2.exp: > > # If a testcase doesn't have special options, use these. > global DEFAULT_CFLAGS > if ![info exists DEFAULT_CFLAGS] then { > set DEFAULT_CFLAGS " -ansi -pedantic-errors -gdwarf-2" > } > > But anyway, shall I add the -gdwarf-2 option back to discriminator.c? I think that gets overridden by dg-options. If you use { dg-additional-options "-O2" } instead, it should still pass -gdwarf-2 (along with the other two). -cary
On Thu, May 30, 2013 at 10:41 AM, Cary Coutant <ccoutant@google.com> wrote: >> That's weird cause in dwarf2.exp: >> >> # If a testcase doesn't have special options, use these. >> global DEFAULT_CFLAGS >> if ![info exists DEFAULT_CFLAGS] then { >> set DEFAULT_CFLAGS " -ansi -pedantic-errors -gdwarf-2" >> } >> >> But anyway, shall I add the -gdwarf-2 option back to discriminator.c? > > I think that gets overridden by dg-options. If you use { > dg-additional-options "-O2" } instead, it should still pass -gdwarf-2 > (along with the other two). In the current test, I didn't use dg-options, but dg-additional-options instead: /* { dg-additional-options "-O0" } */ Dehao > > -cary
Dehao Chen <dehao@google.com> writes: > On Thu, May 30, 2013 at 10:41 AM, Cary Coutant <ccoutant@google.com> wrote: >>> That's weird cause in dwarf2.exp: >>> >>> # If a testcase doesn't have special options, use these. >>> global DEFAULT_CFLAGS >>> if ![info exists DEFAULT_CFLAGS] then { >>> set DEFAULT_CFLAGS " -ansi -pedantic-errors -gdwarf-2" >>> } >>> >>> But anyway, shall I add the -gdwarf-2 option back to discriminator.c? >> >> I think that gets overridden by dg-options. If you use { >> dg-additional-options "-O2" } instead, it should still pass -gdwarf-2 >> (along with the other two). > > In the current test, I didn't use dg-options, but dg-additional-options instead: > > /* { dg-additional-options "-O0" } */ Indeed, and I see -ansi -pedantic-errors -gdwarf-2 -O0 used for the test on both x86_64-unknown-linux-gnu and i386-pc-solaris2.10 (if I augment the target clause). Something unusual seems to be going on with Andreas' testing. Any RUNTESTFLAGS or DEJAGNU options in the environment? Rainer
Andreas Schwab <schwab@linux-m68k.org> writes: > Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes: > >> And why do you add -gdwarf-2 in dg-options? AFAICS all tests in >> gcc.dg/debug/dwarf2 are built with -gdwarf-2 anyway. > > Do they? Not here. > > Executing on host: /daten/aranym/gcc/gcc-20130530/Build/gcc/xgcc > -B/daten/aranym/gcc/gcc-20130530/Build/gcc/ > /daten/aranym/gcc/gcc-20130530/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c > -fno-diagnostics-show-caret -fdiagnostics-color=never -ansi > -pedantic-errors -O0 -ffat-lto-objects -ffat-lto-objects -ffat-lto-objects > -S -o discriminator.s (timeout = 300) > spawn /daten/aranym/gcc/gcc-20130530/Build/gcc/xgcc > -B/daten/aranym/gcc/gcc-20130530/Build/gcc/ > /daten/aranym/gcc/gcc-20130530/gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c > -fno-diagnostics-show-caret -fdiagnostics-color=never -ansi > -pedantic-errors -O0 -ffat-lto-objects -ffat-lto-objects -ffat-lto-objects > -S -o discriminator.s > PASS: gcc.dg/debug/dwarf2/discriminator.c (test for excess errors) > FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 > [0-9]( is_stmt [0-9])?\n > FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 > [0-9]( is_stmt [0-9])? discriminator 2\n > FAIL: gcc.dg/debug/dwarf2/discriminator.c scan-assembler loc [0-9] 11 > [0-9]( is_stmt [0-9])? discriminator 1\n Could you please run just copy site.exp from one of the testsuite/gcc* directories to a new directory and run % runtest --tool gcc dwarf2.exp=discriminator.c there? Maybe this gives a clue. Thanks. Rainer
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes: > Indeed, and I see -ansi -pedantic-errors -gdwarf-2 -O0 used for the test > on both x86_64-unknown-linux-gnu and i386-pc-solaris2.10 (if I augment > the target clause). DEFAULT_CFLAGS is set by many *.exp files. dwarf2.exp will not overwrite an existing definition, so using anthing different from "-ansi -pedantic-errors" will not work. Andreas.
Index: gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c =================================================================== --- gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c (revision 199393) +++ gcc/testsuite/gcc.dg/debug/dwarf2/discriminator.c (working copy) @@ -1,4 +1,4 @@ -/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */ +/* { dg-do compile { target { i?86-*-linux-gnu x86_64-*-linux-gnu } } } */ /* { dg-options "-O0 -gdwarf-2" } */ /* { dg-final { scan-assembler "loc \[0-9] 9 \[0-9]( is_stmt \[0-9])?\n" } } */ /* { dg-final { scan-assembler "loc \[0-9] 9 \[0-9]( is_stmt \[0-9])?