1 # Copyright 2009-2017 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 # Test multi-exec / multi-process features that work for all configurations,
17 # even ones that cannot run multiple processes simultaneously.
19 set testfile "multi-arch-exec"
21 # The plain remote target can't do multiple inferiors.
22 if [target_info exists use_gdb_stub] {
26 # The 64-bit compile may succeed for i386-linux, but gdb won't be able
28 if [istarget "i?86-*linux*"] {
32 # Can't use standard_testfile, we want executables with specialized
34 set exec1 "multi-arch-exec"
35 set srcfile1 multi-arch-exec.c
36 set binfile1 [standard_output_file ${exec1}]
38 set exec2 "multi-arch-exec-hello"
40 set binfile2 [standard_output_file ${exec2}]
42 # Build two executables, one for each arch.
44 if [istarget "s390*-*-*"] {
47 } elseif { [istarget "aarch64*-*-*"] } {
55 if { [prepare_for_testing "failed to prepare" ${exec1} "${srcfile1}" \
57 additional_flags=${march1}]] } {
61 set options [list debug]
63 if { [istarget "aarch64*-*-*"] } {
64 if {[info exists ARM_CC_FOR_TARGET]} {
65 lappend options "compiler=${ARM_CC_FOR_TARGET}"
67 unsupported "ARM compiler is not known"
71 lappend options "additional_flags=${march2}"
74 if { [prepare_for_testing "failed to prepare" ${exec2} "${srcfile2}" \
79 clean_restart ${exec1}
80 if ![runto_main] then {
81 fail "couldn't run to main"
85 # Test that GDB updates the target description / arch successfuly
87 gdb_test "continue" "Breakpoint 1, main.*" "continue across exec that changes architecture"