1 # Copyright (C) 2012-2014 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, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17 if { ![is_elf_format] && ![is_pecoff_format] } then {
21 proc gas_x86_64_check { } {
25 set status [gas_host_run "$NM $NMFLAGS --help" ""]
26 return [regexp "targets:.*x86-64" [lindex $status 1]];
29 proc gas_x86_32_check { } {
33 set status [gas_host_run "$NM $NMFLAGS --help" ""]
34 return [regexp "targets:.*i386" [lindex $status 1]];
37 if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } then {
40 set old_ASFLAGS "$ASFLAGS"
42 if { [gas_x86_64_check] } then {
43 set ASFLAGS "$ASFLAGS --64"
44 run_dump_test "cfi-x86_64"
45 set ASFLAGS "$old_ASFLAGS"
48 if { [gas_x86_32_check] } then {
49 set ASFLAGS "$ASFLAGS --32"
50 run_dump_test "cfi-i386"
51 set ASFLAGS "$old_ASFLAGS"
54 if { [is_pecoff_format] } then {
55 run_dump_test "reloc-pe-i386"
58 } elseif { [istarget alpha*-*-*] } then {
59 run_dump_test "cfi-alpha-1"
60 run_dump_test "cfi-alpha-2"
61 run_dump_test "cfi-alpha-3"
63 } elseif { [istarget powerpc*-*-*] } then {
64 run_dump_test "cfi-ppc-1"
66 } elseif { [istarget s390*-*-*] } then {
67 run_dump_test "cfi-s390-1"
68 if { [istarget s390x*-*-*] } then {
69 run_dump_test "cfi-s390x-1"
72 } elseif { [istarget "m68*-*"] } then {
73 run_dump_test "cfi-m68k"
75 } elseif { [istarget sparc*-*-*] } then {
79 set nm_status [gas_host_run "$NM $NMFLAGS --help" ""]
80 run_dump_test "cfi-sparc-1"
81 if { [regexp "elf64\[_-\]sparc" [lindex $nm_status 1]] } then {
82 run_dump_test "cfi-sparc64-1"
85 } elseif [istarget "sh*-*"] then {
86 if { [istarget sh64*-*-*] || [istarget sh5*-*-*] } then {
88 run_dump_test "cfi-sh-1"
91 } elseif { [istarget "arm*-*"] } then {
92 # Only ELF based ARM targets support CFI.
93 if { [is_pecoff_format] } then {
96 run_dump_test "cfi-arm-1"
98 } elseif { [istarget "mips*-*"] } then {
99 run_dump_test "cfi-mips-1"
100 } elseif { [istarget "hppa*-linux*"] } then {
101 run_dump_test "cfi-hppa-1"
106 run_list_test "cfi-diag-1" ""
108 # HPPA64 uses 64-bit relocations, which results in all of the dump
109 # offset numbers not matching up.
110 if { ![istarget "hppa64*-*"] } then {
111 run_dump_test "cfi-common-1"
112 run_dump_test "cfi-common-2"
113 run_dump_test "cfi-common-3"
114 run_dump_test "cfi-common-4"
115 if { ![is_pecoff_format] } then {
116 # This test uses .subsection/.previous which are elf-specific.
117 run_dump_test "cfi-common-5"
119 # Some targets don't support PC relative cfi directives
120 if { ![istarget "mips*-*"] &&
121 !([istarget powerpc*-*-*] && [is_pecoff_format]) } then {
122 run_dump_test "cfi-common-6"
124 run_dump_test "cfi-common-7"