From: Tom de Vries Date: Sun, 1 Jul 2018 18:28:24 +0000 (+0000) Subject: [testsuite/guality] Use @main as bp loc instead of line nrs in const-volatile.c X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=518ab2a0ecc0c3cacb73d8e054e71b78c492e36b;p=gcc.git [testsuite/guality] Use @main as bp loc instead of line nrs in const-volatile.c 2018-07-01 Tom de Vries * lib/gcc-gdb-test.exp (gdb-test): Handle '@' prefix in line number argument. * gcc.dg/guality/const-volatile.c: Replace gdb-test line nrs 50 and 58 with @main. From-SVN: r262288 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b8b00f5f875..df7edd94872 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-07-01 Tom de Vries + + * lib/gcc-gdb-test.exp (gdb-test): Handle '@' prefix in line number + argument. + * gcc.dg/guality/const-volatile.c: Replace gdb-test line nrs 50 and 58 + with @main. + 2018-07-01 Tom de Vries * gcc.dg/guality/prevent-optimization.h (VOLATILE): Define. diff --git a/gcc/testsuite/gcc.dg/guality/const-volatile.c b/gcc/testsuite/gcc.dg/guality/const-volatile.c index d657f48079c..3bfca0d14d3 100644 --- a/gcc/testsuite/gcc.dg/guality/const-volatile.c +++ b/gcc/testsuite/gcc.dg/guality/const-volatile.c @@ -62,33 +62,33 @@ main (int argc, char **argv) return f (argv[0], &dummy, as) - 1; } -/* { dg-final { gdb-test 50 "type:main" "int (int, char **)" } } */ +/* { dg-final { gdb-test "@main" "type:main" "int (int, char **)" } } */ -/* { dg-final { gdb-test 50 "type:i" "int" } } */ -/* { dg-final { gdb-test 50 "type:ci" "const int" } } */ -/* { dg-final { gdb-test 50 "type:vi" "volatile int" } } */ -/* { dg-final { gdb-test 50 "type:cvi" "const volatile int" } } */ +/* { dg-final { gdb-test "@main" "type:i" "int" } } */ +/* { dg-final { gdb-test "@main" "type:ci" "const int" } } */ +/* { dg-final { gdb-test "@main" "type:vi" "volatile int" } } */ +/* { dg-final { gdb-test "@main" "type:cvi" "const volatile int" } } */ -/* { dg-final { gdb-test 50 "type:pi" "int *" } } */ -/* { dg-final { gdb-test 50 "type:pci" "const int *" } } */ -/* { dg-final { gdb-test 50 "type:pvi" "volatile int *" } } */ -/* { dg-final { gdb-test 50 "type:pcvi" "const volatile int *" } } */ +/* { dg-final { gdb-test "@main" "type:pi" "int *" } } */ +/* { dg-final { gdb-test "@main" "type:pci" "const int *" } } */ +/* { dg-final { gdb-test "@main" "type:pvi" "volatile int *" } } */ +/* { dg-final { gdb-test "@main" "type:pcvi" "const volatile int *" } } */ -/* { dg-final { gdb-test 50 "type:cip" "int * const" } } */ -/* { dg-final { gdb-test 50 "type:vip" "int * volatile" } } */ -/* { dg-final { gdb-test 50 "type:cvip" "int * const volatile" } } */ +/* { dg-final { gdb-test "@main" "type:cip" "int * const" } } */ +/* { dg-final { gdb-test "@main" "type:vip" "int * volatile" } } */ +/* { dg-final { gdb-test "@main" "type:cvip" "int * const volatile" } } */ -/* { dg-final { gdb-test 50 "type:vs" "volatile struct { const long cli; const signed char csc; }" } } */ +/* { dg-final { gdb-test "@main" "type:vs" "volatile struct { const long cli; const signed char csc; }" } } */ -/* { dg-final { gdb-test 50 "type:cvip" "int * const volatile" } } */ +/* { dg-final { gdb-test "@main" "type:cvip" "int * const volatile" } } */ -/* { dg-final { gdb-test 50 "type:bar" "struct bar { short s; const short cs; volatile short vs; const volatile short cvs; volatile long long vll; }" } } */ -/* { dg-final { gdb-test 50 "type:foo" "struct foo { const long cli; const signed char csc; }" } } */ -/* { dg-final { gdb-test 50 "type:cfoo" "const struct foo { const long cli; const signed char csc; }" } } */ -/* { dg-final { gdb-test 50 "type:vfoo" "volatile struct foo { const long cli; const signed char csc; }" } } */ -/* { dg-final { gdb-test 50 "type:cvfoo" "const volatile struct foo { const long cli; const signed char csc; }" } } */ +/* { dg-final { gdb-test "@main" "type:bar" "struct bar { short s; const short cs; volatile short vs; const volatile short cvs; volatile long long vll; }" } } */ +/* { dg-final { gdb-test "@main" "type:foo" "struct foo { const long cli; const signed char csc; }" } } */ +/* { dg-final { gdb-test "@main" "type:cfoo" "const struct foo { const long cli; const signed char csc; }" } } */ +/* { dg-final { gdb-test "@main" "type:vfoo" "volatile struct foo { const long cli; const signed char csc; }" } } */ +/* { dg-final { gdb-test "@main" "type:cvfoo" "const volatile struct foo { const long cli; const signed char csc; }" } } */ -/* { dg-final { gdb-test 58 "type:s" "volatile signed char" } } */ -/* { dg-final { gdb-test 50 "type:cs" "const volatile signed char" } } */ +/* { dg-final { gdb-test "@main" "type:s" "volatile signed char" } } */ +/* { dg-final { gdb-test "@main" "type:cs" "const volatile signed char" } } */ -/* { dg-final { gdb-test 50 "type:f" "int (const char *, volatile struct foo *, const score)" } } */ +/* { dg-final { gdb-test "@main" "type:f" "int (const char *, volatile struct foo *, const score)" } } */ diff --git a/gcc/testsuite/lib/gcc-gdb-test.exp b/gcc/testsuite/lib/gcc-gdb-test.exp index c446f5b122d..bb966d43023 100644 --- a/gcc/testsuite/lib/gcc-gdb-test.exp +++ b/gcc/testsuite/lib/gcc-gdb-test.exp @@ -60,7 +60,12 @@ proc gdb-test { useline args } { set cmd_file "[file rootname [file tail $prog]].gdb" set fd [open $cmd_file "w"] - set line [get-absolute-line $useline [lindex $args 0]] + set line [lindex $args 0] + if { [string range $line 0 0] == "@" } { + set line [string range $line 1 end] + } else { + set line [get-absolute-line $useline $line] + } puts $fd "break $line" puts $fd "run" puts $fd "$command $var"