]>
Commit | Line | Data |
---|---|---|
d87bef3a | 1 | # Copyright (C) 2022-2023 Free Software Foundation, Inc. |
dc56ee02 IB |
2 | |
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. | |
7 | # | |
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. | |
12 | # | |
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. | |
16 | ||
17 | if { ![is_elf_format] } then { | |
18 | return | |
19 | } | |
20 | ||
21 | proc gas_sframe_check { } { | |
22 | global check_as_sframe_result | |
23 | global AS | |
24 | global ASFLAGS | |
25 | if [info exists check_as_sframe_result] { | |
26 | return $check_as_sframe_result | |
27 | } | |
28 | ||
29 | set as_file "tmpdir/check_as_sframe.s" | |
30 | set as_fh [open $as_file w 0666] | |
31 | puts $as_fh "# Generated file. DO NOT EDIT" | |
32 | puts $as_fh "\t.cfi_startproc" | |
33 | puts $as_fh "\t.cfi_endproc" | |
34 | close $as_fh | |
35 | remote_download host $as_file | |
36 | verbose -log "Checking SFrame support in AS:" | |
37 | ||
38 | set old_ASFLAGS "$ASFLAGS" | |
39 | set ASFLAGS "$ASFLAGS --gsframe" | |
40 | ||
41 | global comp_output | |
42 | ||
43 | set output_file "tmpdir/check_as_sframe.out" | |
44 | set status [gas_host_run "$AS $ASFLAGS $as_file" "2>$output_file"] | |
45 | set comp_output [file_contents "$output_file"] | |
46 | set ASFLAGS "$old_ASFLAGS" | |
47 | ||
48 | if { ![string match "" $comp_output] | |
49 | || [string match "*sframe not supported for target*" $comp_output] } then { | |
50 | verbose -log "SFrame not supported in AS" | |
51 | return 0 | |
52 | } else { | |
53 | verbose -log "SFrame supported in AS" | |
54 | return 1 | |
55 | } | |
56 | } | |
57 | ||
58 | proc gas_x86_64_check { } { | |
59 | global NM | |
60 | global NMFLAGS | |
61 | ||
62 | set status [gas_host_run "$NM $NMFLAGS --help" ""] | |
63 | return [regexp "targets:.*x86-64" [lindex $status 1]]; | |
64 | } | |
65 | ||
66 | # common tests | |
67 | if { ([istarget "x86_64-*-*"] || [istarget "aarch64*-*-*"]) \ | |
68 | && [gas_sframe_check] } then { | |
69 | ||
70 | global ASFLAGS | |
71 | set old_ASFLAGS "$ASFLAGS" | |
72 | ||
73 | run_dump_test "cfi-sframe-common-1" | |
74 | run_dump_test "cfi-sframe-common-2" | |
75 | run_dump_test "cfi-sframe-common-3" | |
76 | run_dump_test "cfi-sframe-common-4" | |
77 | run_dump_test "cfi-sframe-common-5" | |
78 | run_dump_test "cfi-sframe-common-6" | |
79 | run_dump_test "cfi-sframe-common-7" | |
80 | run_dump_test "cfi-sframe-common-8" | |
81 | ||
82 | run_dump_test "common-empty-1" | |
83 | run_dump_test "common-empty-2" | |
84 | run_dump_test "common-empty-3" | |
dc56ee02 IB |
85 | } |
86 | ||
87 | # x86-64 specific tests | |
88 | if { [istarget "x86_64-*-*"] && [gas_sframe_check] } then { | |
89 | if { [gas_x86_64_check] } then { | |
90 | set ASFLAGS "$ASFLAGS --64" | |
91 | run_dump_test "cfi-sframe-x86_64-1" | |
92 | set ASFLAGS "$old_ASFLAGS" | |
93 | } | |
94 | } | |
95 | ||
96 | # aarch64 specific tests | |
97 | if { [istarget "aarch64*-*-*"] && [gas_sframe_check] } then { | |
98 | run_dump_test "cfi-sframe-aarch64-1" | |
5bec250b | 99 | run_dump_test "cfi-sframe-aarch64-2" |
d429702d | 100 | run_dump_test "cfi-sframe-aarch64-pac-ab-key-1" |
dc56ee02 | 101 | } |