]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/utf8-identifiers.exp
gdb/testsuite: make runto_main not pass no-message to runto
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / utf8-identifiers.exp
CommitLineData
b1b60145
PA
1# -*- coding: utf-8 -*- */
2
3# This testcase is part of GDB, the GNU debugger.
4
3666a048 5# Copyright 2017-2021 Free Software Foundation, Inc.
b1b60145
PA
6
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20# Test GDB's support for UTF-8 C/C++ identifiers.
21
22load_lib completion-support.exp
23
24standard_testfile
25
26# Enable basic use of UTF-8. LC_ALL gets reset for each testfile.
27setenv LC_ALL C.UTF-8
28
29if { [prepare_for_testing "failed to prepare" ${testfile} [list $srcfile]] } {
30 return -1
31}
32
33if ![runto done] {
b1b60145
PA
34 return
35}
36
37# Test expressions.
38gdb_test "print g_s.num_€" " = 1000"
39gdb_test "print num_€" " = 2000"
40
41# Test linespecs/breakpoints.
42gdb_test "break função2" "Breakpoint $decimal at .*$srcfile.*"
43
44set test "info breakpoints"
45gdb_test_multiple $test $test {
46 -re "in função2 at .*$srcfile.*$gdb_prompt $" {
47 pass $test
48 }
49}
50
51gdb_test "continue" \
52 "Breakpoint $decimal, função2 \\(\\) at .*$srcfile.*"
53
54# Unload symbols from shared libraries to avoid random symbol and file
55# names getting in the way of completion.
56gdb_test_no_output "nosharedlibrary"
57
4ee9b0c5
SL
58# Tests below are about tab-completion, which doesn't work if readline
59# library isn't used. Check it first.
60
61if { ![readline_is_used] } {
62 untested "no tab completion support without readline"
63 return -1
64}
65
b1b60145
PA
66# Test linespec completion.
67
68# A unique completion.
69test_gdb_complete_unique "break my_fun" "break my_função"
70
71# A multiple-matches completion:
72
73# kfailed because gdb/readline display the completion match list like
74# this, with no separating space:
75#
76# (gdb) break função[TAB]
77# função1função2
78#
79# ... which is bogus.
80setup_kfail "gdb/23211" "*-*-*"
81test_gdb_complete_multiple "break " "fun" "ção" {"função1" "função2"}
82
83# Test expression completion.
84test_gdb_complete_unique "print g_s.num" "print g_s.num_€"