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.
From-SVN: r262286
+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 ...
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];
}
# 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]