Commit | Line | Data |
---|---|---|
5bf135a7 NC |
1 | # Copyright 2012 |
2 | # Free Software Foundation, Inc. | |
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 | |
6 | # the Free Software Foundation; either version 3 of the License, or | |
7 | # (at your option) any later version. | |
8 | # | |
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. | |
13 | # | |
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. | |
17 | ||
e0001a05 NC |
18 | # |
19 | # Some generic xtensa tests | |
20 | # | |
21 | if [istarget xtensa*-*-*] then { | |
22 | gas_test_error "j_too_far.s" "" "Check for jump out of range error" | |
23 | ||
24 | set testname "j_too_far.s: error line number reporting" | |
25 | gas_start "j_too_far.s" "" | |
26 | set x1 0 | |
27 | while 1 { | |
28 | expect { | |
43cd72b9 | 29 | -re ":4: Error:.*out of range" { set x1 1 } |
e0001a05 NC |
30 | timeout { perror "timeout\n"; break } |
31 | eof { break } | |
32 | } | |
33 | } | |
34 | gas_finish | |
35 | if [all_ones $x1] then { pass $testname } else { fail $testname } | |
36 | ||
37 | ||
38 | gas_test "entry_misalign.s" "" "" "Xtensa Entry misalignment" | |
39 | set testname "entry_misalign.s: Force entry misalignment" | |
40 | objdump_start_no_subdir "a.out" "-d -j .text" | |
41 | set x1 0 | |
42 | while 1 { | |
43 | expect { | |
44 | -re "^.*2:.*entry" { set x1 1 } | |
45 | timeout { perror "timeout\n"; break } | |
46 | eof { break } | |
47 | } | |
48 | } | |
49 | objdump_finish | |
50 | if [all_ones $x1] then { pass $testname } else { fail $testname } | |
51 | ||
52 | ||
53 | gas_test "entry_misalign2.s" "" "" "Xtensa Entry misalignment(2)" | |
54 | set testname "entry_misalign2.s: Force entry misalignment(2)" | |
55 | objdump_start_no_subdir "a.out" "-d -j .text" | |
56 | set x1 0 | |
57 | while 1 { | |
58 | expect { | |
59 | -re "^.*2:.*entry" { set x1 1 } | |
60 | timeout { perror "timeout\n"; break } | |
61 | eof { break } | |
62 | } | |
63 | } | |
64 | objdump_finish | |
65 | if [all_ones $x1] then { pass $testname } else { fail $testname } | |
66 | ||
43cd72b9 | 67 | gas_test_error "entry_align.s" "" "Xtensa entry alignment error" |
e0001a05 NC |
68 | |
69 | gas_test "loop_misalign.s" "" "" "Xtensa Loop misalignment" | |
70 | set testname "loop_misalign.s: Force loop misalignment" | |
71 | objdump_start_no_subdir "a.out" "-d -j .text" | |
72 | set x1 0 | |
73 | while 1 { | |
74 | expect { | |
75 | -re "^.*0:.*loop" { set x1 1 } | |
76 | timeout { perror "timeout\n"; break } | |
77 | eof { break } | |
78 | } | |
79 | } | |
80 | objdump_finish | |
81 | if [all_ones $x1] then { pass $testname } else { fail $testname } | |
82 | ||
83 | ||
84 | gas_test "loop_align.s" "" "" "Xtensa autoalign loop" | |
85 | set testname "loop_align.s: autoalign loop" | |
86 | objdump_start_no_subdir "a.out" "-d -j .text" | |
87 | set x1 0 | |
88 | while 1 { | |
89 | expect { | |
90 | -re "^.*2:.*loop" { set x1 1 } | |
91 | timeout { perror "timeout\n"; break } | |
92 | eof { break } | |
93 | } | |
94 | } | |
95 | objdump_finish | |
96 | if [all_ones $x1] then { pass $testname } else { fail $testname } | |
97 | ||
a67517f4 | 98 | run_dump_test "short_branch_offset" |
1bbb5f21 | 99 | run_dump_test "pcrel" |
38f9cb7f | 100 | run_dump_test "weak-call" |
19e8f41a | 101 | run_dump_test "jlong" |
e0001a05 NC |
102 | } |
103 | ||
104 | if [info exists errorInfo] then { | |
105 | unset errorInfo | |
a67517f4 | 106 | } |