* lib/gdb.exp (skip_altivec_tests, skip_vsx_tests)
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / so-impl-ld.exp
CommitLineData
0b302171
JB
1# Copyright 1997-2001, 2003, 2005, 2007-2012 Free Software Foundation,
2# Inc.
c906108c
SS
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
e22f8b7c 6# the Free Software Foundation; either version 3 of the License, or
c906108c 7# (at your option) any later version.
e22f8b7c 8#
c906108c
SS
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
e22f8b7c 13#
c906108c 14# You should have received a copy of the GNU General Public License
e22f8b7c 15# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c 16
c906108c 17
93f02886
DJ
18if {[skip_shlib_tests]} {
19 return 0
c906108c
SS
20}
21
c906108c 22set testfile "so-impl-ld"
bf7234cf
PG
23set libfile "solib1"
24set srcfile $srcdir/$subdir/$testfile.c
25set libsrc $srcdir/$subdir/$libfile.c
26set binfile $objdir/$subdir/$testfile
27set lib_sl $objdir/$subdir/$libfile.sl
28
29set lib_opts debug
30set exec_opts [list debug shlib=$lib_sl]
c906108c 31
4c93b1db 32if [get_compiler_info] {
c906108c
SS
33 return -1
34}
35
4c93b1db 36if [get_compiler_info] {
c906108c
SS
37 return -1
38}
39
bf7234cf
PG
40if [test_compiler_info "hpcc-*"] {
41 lappend exec_opts "additional_flags=-Ae"
c906108c
SS
42}
43
bf7234cf
PG
44if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
45 || [gdb_compile $srcfile $binfile executable $exec_opts] != ""} {
46 untested "Couldn't compile $libsrc or $srcfile."
c906108c
SS
47 return -1
48}
c906108c
SS
49
50# Start with a fresh gdb
51
52gdb_exit
53gdb_start
54gdb_reinitialize_dir $srcdir/$subdir
55gdb_load ${binfile}
93f02886 56gdb_load_shlibs $lib_sl
c906108c
SS
57
58# This program implicitly loads SOM shared libraries.
59#
60if ![runto_main] then { fail "implicit solibs tests suppressed" }
61
62# Verify that we can step over the first shlib call.
63#
02746bbc
MS
64gdb_test "next" "21\[ \t\]*result = solib_main .result.;" \
65 "step over solib call"
c906108c
SS
66
67# Verify that we can step into the second shlib call.
68#
02746bbc
MS
69gdb_test "step" "solib_main .arg=10000. at.*${libfile}.c:17.*" \
70 "step into solib call"
c906108c
SS
71
72# Verify that we can step within the shlib call.
73#
02746bbc 74gdb_test "next" "18\[ \t\]*\}" "step in solib call"
c906108c
SS
75
76# Verify that we can step out of the shlib call, and back out into
77# the caller.
78#
02746bbc 79gdb_test_multiple "next" "step out of solib call" {
c906108c 80 -re "0x\[0-9a-f\]*\[ \t\]*9\[ \t\]*.*$gdb_prompt $" {
02746bbc
MS
81 gdb_test "next" \
82 "main .. at.*so-impl-ld.c:22.*" \
83 "step out of solib call"
84 }
85 -re "main .. at.*so-impl-ld.c:22.*$gdb_prompt $" {
86 pass "step out of solib call"
c906108c 87 }
c906108c
SS
88}
89
90gdb_exit
91return 0
0d06e24b
JM
92
93
94
95
96
97
This page took 1.447617 seconds and 4 git commands to generate.