1 # Copyright
(C
) 2016-2022 Free Software Foundation
, Inc.
3 # This
program is free software
; you can redistribute it and
/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation
; either version
3 of the License
, or
6 #
(at your option
) any later version.
8 # This
program is distributed in the hope that it will be useful
,
9 # but WITHOUT
ANY WARRANTY
; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License
for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this
program.
If not
, see
<http
://www.gnu.org
/licenses
/>.
16 # Check the
"quit" command.
20 # Test that a syntax error causes quit to abort.
21 # Regression test
for PR gdb
/20604.
22 gdb_test
"quit()" "A syntax error in expression, near .*" \
23 "quit with syntax error"
25 # Test that an expression can be used to
set the error code.
27 set test
"quit with expression"
28 gdb_test_multiple
"quit 22+1" $test {
30 set result
[wait
-i $gdb_spawn_id
]
32 gdb_assert
{[lindex $result
2] == 0 && [lindex $result
3] == 23} $test