diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/guality/vla-1.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/lib/gcc-dg.exp | 4 |
3 files changed, 13 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d2939c6..d24b0b4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-07-01 Tom de Vries <tdevries@suse.de> + * lib/gcc-dg.exp (get-absolute-line): Handle '.'. + * gcc.dg/guality/vla-1.c: Use relative line numbers. + +2018-07-01 Tom de Vries <tdevries@suse.de> + * gcc.dg-selftests/dg-final.exp (verify_call_1): Factor out of ... (verify_call): ... here. Move to toplevel. (verify_call_np, dg_final_directive_check_utils): New proc. diff --git a/gcc/testsuite/gcc.dg/guality/vla-1.c b/gcc/testsuite/gcc.dg/guality/vla-1.c index 6514654..264b9f3 100644 --- a/gcc/testsuite/gcc.dg/guality/vla-1.c +++ b/gcc/testsuite/gcc.dg/guality/vla-1.c @@ -13,15 +13,15 @@ int __attribute__((noinline)) f1 (int i) { char a[i + 1]; - a[0] = 5; /* { dg-final { gdb-test 17 "i" "5" } } */ - return a[0]; /* { dg-final { gdb-test 17 "sizeof (a)" "6" } } */ + a[0] = 5; /* { dg-final { gdb-test .+1 "i" "5" } } */ + return a[0]; /* { dg-final { gdb-test . "sizeof (a)" "6" } } */ } int __attribute__((noinline)) f2 (int i) { - short a[i * 2 + 7]; /* { dg-final { gdb-test 24 "i" "5" } } */ - bar (a); /* { dg-final { gdb-test 24 "sizeof (a)" "17 * sizeof (short)" } } */ + short a[i * 2 + 7]; /* { dg-final { gdb-test .+1 "i" "5" } } */ + bar (a); /* { dg-final { gdb-test . "sizeof (a)" "17 * sizeof (short)" } } */ return a[i + 4]; } diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 4f17963..9e0b3f4 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -1066,6 +1066,10 @@ proc dg-line { linenr varname } { # Argument 1 is the relative line number or line number variable reference # proc get-absolute-line { useline line } { + if { "$line" == "." } { + return $useline + } + if { [regsub "^\.\[+-\](\[0-9\]+)$" $line "\\1" num] && $useline != "" } { # Handle relative line specification, .+1 or .-1 etc. set num [expr $useline [string index $line 1] $num] |