From: Tom de Vries Date: Thu, 5 Jul 2018 08:19:15 +0000 (+0000) Subject: [testsuite] Simplify dg-final X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ab7f778cee91ecb52fa9cd4594efaca8db8a8951;p=gcc.git [testsuite] Simplify dg-final 2018-07-05 Tom de Vries * lib/gcc-dg.exp (dg-final): Simplify tcl code. From-SVN: r262431 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 61fdea9f95c..d685d81867b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-07-05 Tom de Vries + + * lib/gcc-dg.exp (dg-final): Simplify tcl code. + 2018-07-04 Martin Sebor PR tree-optimization/86274 diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index 9e0b3f4ef95..f5e6bef5dd9 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -123,13 +123,10 @@ proc dg-final { args } { set line [lindex $args 0] set code [lindex $args 1] set directive [lindex $code 0] - set withline \ - [switch $directive { - gdb-test {expr {1}} - default {expr {0}} - }] - if { $withline == 1 } { - set code [linsert $code 1 $line] + switch $directive { + gdb-test { + set code [linsert $code 1 $line] + } } append final-code "$code\n" }