1*1424dfb3Schristos# Copyright 2015-2020 Free Software Foundation, Inc.
207163879Schristos
307163879Schristos# This program is free software; you can redistribute it and/or modify
407163879Schristos# it under the terms of the GNU General Public License as published by
507163879Schristos# the Free Software Foundation; either version 3 of the License, or
607163879Schristos# (at your option) any later version.
707163879Schristos#
807163879Schristos# This program is distributed in the hope that it will be useful,
907163879Schristos# but WITHOUT ANY WARRANTY; without even the implied warranty of
1007163879Schristos# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1107163879Schristos# GNU General Public License for more details.
1207163879Schristos#
1307163879Schristos# You should have received a copy of the GNU General Public License
1407163879Schristos# along with this program.  If not, see <http://www.gnu.org/licenses/>.
1507163879Schristos
1607163879Schristos# Namespace tests for GDB's C++ compile feature.
1707163879Schristos
1807163879Schristosload_lib compile-support.exp
1907163879Schristos
2007163879Schristosstandard_testfile .cc
2107163879Schristos
2207163879Schristosif {[skip_cplus_tests]} {
2307163879Schristos    untested "skipping C++ tests"
2407163879Schristos    return
2507163879Schristos}
2607163879Schristos
2707163879Schristosif {[prepare_for_testing $testfile $testfile $srcfile \
2807163879Schristos	 {debug nowarnings c++}]} {
2907163879Schristos    return -1
3007163879Schristos}
3107163879Schristos
3207163879Schristosif {![runto_main]} {
3307163879Schristos    untested "could not run to main"
3407163879Schristos    return -1
3507163879Schristos}
3607163879Schristos
3707163879Schristosif {[skip_compile_feature_tests]} {
3807163879Schristos    untested \
3907163879Schristos	"compile command not supported (could not find libcc1 shared library?)"
4007163879Schristos    return -1
4107163879Schristos}
4207163879Schristos
4307163879Schristosgdb_breakpoint [gdb_get_line_number "break here" $srcfile]
4407163879Schristosgdb_continue_to_breakpoint "testing location"
4507163879Schristos
4607163879SchristosCompileExpression::new "var"
4707163879SchristosCompileExpression::test "N1::N2::N3::N4::n4static" 400
4807163879SchristosCompileExpression::test "N1::N2::N3::N4::S4::s4static" 40
4907163879SchristosCompileExpression::test "s4.s4int_" 4
5007163879SchristosCompileExpression::test "N1::N2::N3::N4::S4::get_svar ()" 40
5107163879SchristosCompileExpression::test "s4.get_var ()" 4
52