# file      : tests/backtrace/testscript
# license   : MIT; see accompanying LICENSE file

tclass = $cxx.target.class
tsys   = $cxx.target.system

: basic
:
if ($tclass == 'linux'  || \
    $tclass == 'macos'  || \
    $tsys == 'freebsd'  || \
    $tsys == 'netbsd')
{
  # The stack frame line format varies among OSes. The only common thing is
  # the '0x' function address prefix.
  #
  $* 2>>~%EOE%
    %.*
    %.*0x.*%
    %.*
    EOE
}
else
{
  # On OSes where backtrace() is not supported we just check that setting the
  # terminate handler doesn't change the way a process terminates on the
  # unhandled exception (see driver.cxx for details).
  #
  $* -q
}
