diff options
author | Indu Bhagat <indu.bhagat@oracle.com> | 2021-05-20 10:32:38 -0700 |
---|---|---|
committer | Jose E. Marchesi <jose.marchesi@oracle.com> | 2021-06-28 18:47:20 +0200 |
commit | 532617d6367c29803d5909f2432b1ebfb9ee1886 (patch) | |
tree | cb474de4e1b4b8f3732b63201fe3913c2b0f99da /gcc | |
parent | 5783a0cc78af95940dcb3d1a5d29041c3d8ae3e1 (diff) | |
download | gcc-532617d6367c29803d5909f2432b1ebfb9ee1886.zip gcc-532617d6367c29803d5909f2432b1ebfb9ee1886.tar.gz gcc-532617d6367c29803d5909f2432b1ebfb9ee1886.tar.bz2 |
dejagnu: modularize gcc-dg-debug-runtest a bit
Move some functionality into a procedure of its own. This is only so that when
the patch for ctf comes along, the gcc-dg-debug-runtest procedure looks bit
more uniform.
gcc/testsuite/ChangeLog:
* lib/gcc-dg.exp (gcc-dg-target-supports-debug-format): New procedure.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/lib/gcc-dg.exp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index fce0989..c7722ba 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -621,18 +621,27 @@ proc gcc-dg-runtest { testcases flags default-extra-flags } { } } -proc gcc-dg-debug-runtest { target_compile trivial opt_opts testcases } { +# Check if the target system supports the debug format +proc gcc-dg-target-supports-debug-format { target_compile trivial type } { global srcdir subdir + set comp_output [$target_compile \ + "$srcdir/$subdir/$trivial" "trivial.S" assembly \ + "additional_flags=$type"] + if { ! [string match "*: target system does not support the * debug format*" \ + $comp_output] } { + remove-build-file "trivial.S" + return 1 + } + return 0 +} + +proc gcc-dg-debug-runtest { target_compile trivial opt_opts testcases } { if ![info exists DEBUG_TORTURE_OPTIONS] { set DEBUG_TORTURE_OPTIONS "" foreach type {-gdwarf-2 -gstabs -gstabs+ -gxcoff -gxcoff+} { - set comp_output [$target_compile \ - "$srcdir/$subdir/$trivial" "trivial.S" assembly \ - "additional_flags=$type"] - if { ! [string match "*: target system does not support the * debug format*" \ - $comp_output] } { - remove-build-file "trivial.S" + if [expr [gcc-dg-target-supports-debug-format \ + $target_compile $trivial $type]] { foreach level {1 "" 3} { if { ($type == "-gdwarf-2") && ($level != "") } { lappend DEBUG_TORTURE_OPTIONS [list "${type}" "-g${level}"] |