fa396aa2526ff21a2cdb8601f086fa130dffef92
[deliverable/binutils-gdb.git] / ld / testsuite / ld-msp430-elf / msp430-elf.exp
1 # Expect script for various MSP430 ELF tests.
2 # Copyright (C) 2002-2015 Free Software Foundation, Inc.
3 #
4 # This file is part of the GNU Binutils.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 #
21
22 if { ![istarget "msp430*elf*"] } {
23 return
24 }
25
26 # List contains test-items with 3 items followed by 2 lists and one more item:
27 # 0:name 1:ld early options 2:ld late options 3:assembler options
28 # 4:filenames of assembler files 5: action and options. 6: name of output file
29
30 # Actions:
31 # objdump: Apply objdump options on result. Compare with regex (last arg).
32 # nm: Apply nm options on result. Compare with regex (last arg).
33 # readelf: Apply readelf options on result. Compare with regex (last arg).
34
35 set msp430regionprefixtests {
36 {"Move main() to .upper.text" "-T msp430.ld --code-region=upper"
37 "" "" {main-with-text-rodata.s} {{objdump -d main-text-upper.d}} "main-upper"}
38 {"Move main() to .upper.text. No .lower.text in ld script" "-T msp430-no-lower.ld --code-region=upper"
39 "" "" {main-with-text-rodata.s} {{objdump -d main-text-upper.d}} "main-upper"}
40 {"Move main() to .lower.text" "-T msp430.ld --code-region=lower"
41 "" "" {main-with-text-rodata.s} {{objdump -d main-text-lower.d}} "main-lower"}
42 {"Move \"either\" main() to .lower.text" "-T msp430.ld --code-region=either"
43 "" "" {main-with-text-rodata.s} {{objdump -d main-text-lower.d}} "main-either"}
44
45 {"Move glob_var to .upper.data" "-T msp430.ld --data-region=upper"
46 "" "" {main-with-data-bss.s} {{objdump -D main-var-upper.d}} "main-var-upper"}
47 {"Move glob_var to .upper.data. No .lower.data in ld script" "-T msp430-no-lower.ld --data-region=upper"
48 "" "" {main-with-data-bss.s} {{objdump -D main-var-upper.d}} "main-var-upper"}
49 {"Move glob_var to .lower.data" "-T msp430.ld --data-region=lower"
50 "" "" {main-with-data-bss.s} {{objdump -D main-var-lower.d}} "main-var-lower"}
51 {"Move \"either\" glob_var to .lower.data" "-T msp430.ld --data-region=lower"
52 "" "" {main-with-data-bss.s} {{objdump -D main-var-lower.d}} "main-var-lower"}
53
54 {"Move glob_zero to .upper.bss" "-T msp430.ld --data-region=upper"
55 "" "" {main-with-data-bss.s} {{objdump -D main-bss-upper.d}} "main-bss-upper"}
56 {"Move glob_zero to .upper.bss. No .lower.bss in ld script." "-T msp430-no-lower.ld --data-region=upper"
57 "" "" {main-with-data-bss.s} {{objdump -D main-bss-upper.d}} "main-bss-upper"}
58 {"Move glob_zero to .lower.bss" "-T msp430.ld --data-region=lower"
59 "" "" {main-with-data-bss.s} {{objdump -D main-bss-lower.d}} "main-bss-lower"}
60 {"Move \"either\" glob_zero to .lower.bss" "-T msp430.ld --data-region=lower"
61 "" "" {main-with-data-bss.s} {{objdump -D main-bss-lower.d}} "main-bss-lower"}
62
63 {"Move glob_const to .upper.rodata" "-T msp430.ld --data-region=upper"
64 "" "" {main-with-text-rodata.s} {{objdump -D main-const-upper.d}} "main-const-upper"}
65 {"Move glob_const to .upper.rodata. No .lower.rodata in ld script." "-T msp430-no-lower.ld --data-region=upper"
66 "" "" {main-with-text-rodata.s} {{objdump -D main-const-upper.d}} "main-const-upper"}
67 {"Move glob_const to .lower.rodata" "-T msp430.ld --data-region=lower"
68 "" "" {main-with-text-rodata.s} {{objdump -D main-const-lower.d}} "main-const-lower"}
69 {"Move \"either\" glob_const to .lower.rodata" "-T msp430.ld --data-region=lower"
70 "" "" {main-with-text-rodata.s} {{objdump -D main-const-lower.d}} "main-const-lower"}
71 }
72
73 set msp430regionprefixuniquesectiontests {
74 {"Move main() to .upper.text, with -ffunction/data-sections" "-T msp430.ld --code-region=upper"
75 "" "" {main-with-text-rodata-unique-sec.s} {{objdump -d main-text-upper.d}} "main-upper"}
76 {"Move main() to .upper.text. No .lower.text in ld script, with -ffunction/data-sections" "-T msp430-no-lower.ld --code-region=upper"
77 "" "" {main-with-text-rodata-unique-sec.s} {{objdump -d main-text-upper.d}} "main-upper"}
78 {"Move main() to .lower.text, with -ffunction/data-sections" "-T msp430.ld --code-region=lower"
79 "" "" {main-with-text-rodata-unique-sec.s} {{objdump -d main-text-lower.d}} "main-lower"}
80 {"Move \"either\" main() to .lower.text, with -ffunction/data-sections" "-T msp430.ld --code-region=either"
81 "" "" {main-with-text-rodata-unique-sec.s} {{objdump -d main-text-lower.d}} "main-either"}
82
83 {"Move glob_var to .upper.data, with -ffunction/data-sections" "-T msp430.ld --data-region=upper"
84 "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-var-upper.d}} "main-var-upper"}
85 {"Move glob_var to .upper.data. No .lower.data in ld script, with -ffunction/data-sections" "-T msp430-no-lower.ld --data-region=upper"
86 "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-var-upper.d}} "main-var-upper"}
87 {"Move glob_var to .lower.data, with -ffunction/data-sections" "-T msp430.ld --data-region=lower"
88 "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-var-lower.d}} "main-var-lower"}
89 {"Move \"either\" glob_var to .lower.data, with -ffunction/data-sections" "-T msp430.ld --data-region=lower"
90 "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-var-lower.d}} "main-var-lower"}
91
92 {"Move glob_zero to .upper.bss, with -ffunction/data-sections" "-T msp430.ld --data-region=upper"
93 "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-bss-upper.d}} "main-bss-upper"}
94 {"Move glob_zero to .upper.bss. No .lower.bss in ld script., with -ffunction/data-sections" "-T msp430-no-lower.ld --data-region=upper"
95 "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-bss-upper.d}} "main-bss-upper"}
96 {"Move glob_zero to .lower.bss, with -ffunction/data-sections" "-T msp430.ld --data-region=lower"
97 "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-bss-lower.d}} "main-bss-lower"}
98 {"Move \"either\" glob_zero to .lower.bss, with -ffunction/data-sections" "-T msp430.ld --data-region=lower"
99 "" "" {main-with-data-bss-unique-sec.s} {{objdump -D main-bss-lower.d}} "main-bss-lower"}
100
101 {"Move glob_const to .upper.rodata, with -ffunction/data-sections" "-T msp430.ld --data-region=upper"
102 "" "" {main-with-text-rodata-unique-sec.s} {{objdump -D main-const-upper.d}} "main-const-upper"}
103 {"Move glob_const to .upper.rodata. No .lower.rodata in ld script., with -ffunction/data-sections" "-T msp430-no-lower.ld --data-region=upper"
104 "" "" {main-with-text-rodata-unique-sec.s} {{objdump -D main-const-upper.d}} "main-const-upper"}
105 {"Move glob_const to .lower.rodata, with -ffunction/data-sections" "-T msp430.ld --data-region=lower"
106 "" "" {main-with-text-rodata-unique-sec.s} {{objdump -D main-const-lower.d}} "main-const-lower"}
107 {"Move \"either\" glob_const to .lower.rodata, with -ffunction/data-sections" "-T msp430.ld --data-region=lower"
108 "" "" {main-with-text-rodata-unique-sec.s} {{objdump -D main-const-lower.d}} "main-const-lower"}
109 }
110
111 set msp430eithershuffletests {
112 {"Move \"either\" main() to .upper.text when it doesn\'t fit in .lower.text"
113 "-T msp430-tiny-rom.ld --code-region=either --data-region=either" "" "" {main-with-text-rodata.s}
114 {{objdump -d main-text-upper.d}} "either-to-upper-text"}
115 {"Move \"either\" glob_var_array to .upper.data when it doesn\'t fit in .lower.data"
116 "-T msp430-tiny-ram.ld --data-region=either" "" "" {main-with-data-bss.s}
117 {{objdump -D main-var-upper.d}} "either-to-upper-data"}
118 {"Move \"either\" glob_bss_array to .upper.bss when it doesn\'t fit in .lower.bss"
119 "-T msp430-tiny-ram.ld --data-region=either" "" "" {main-with-data-bss.s}
120 {{objdump -D main-bss-upper.d}} "either-to-upper-bss"}
121 {"Move \"either\" glob_const_array to .upper.rodata when it doesn\'t fit in .lower.rodata"
122 "-T msp430-tiny-rom.ld --code-region=either --data-region=either" "" "" {main-with-text-rodata.s}
123 {{objdump -D main-const-upper.d}} "either-to-upper-const"}
124
125 {"Move \"either\" main() to .upper.text when it doesn\'t fit in .lower.text, with -ffunction/data-sections"
126 "-T msp430-tiny-rom.ld --code-region=either --data-region=either" "" "" {main-with-text-rodata-unique-sec.s}
127 {{objdump -d main-text-upper.d}} "either-to-upper-text-unique-sec"}
128 {"Move \"either\" glob_var_array to .upper.data when it doesn\'t fit in .lower.data, with -ffunction/data-sections"
129 "-T msp430-tiny-ram.ld --data-region=either" "" "" {main-with-data-bss-unique-sec.s}
130 {{objdump -D main-var-upper.d}} "either-to-upper-data-unique-sec"}
131 {"Move \"either\" glob_bss_array to .upper.bss when it doesn\'t fit in .lower.bss, with -ffunction/data-sections"
132 "-T msp430-tiny-ram.ld --data-region=either" "" "" {main-with-data-bss-unique-sec.s}
133 {{objdump -D main-bss-upper.d}} "either-to-upper-bss-unique-sec"}
134 {"Move \"either\" glob_const_array to .upper.rodata when it doesn\'t fit in .lower.rodata, with -ffunction/data-sections"
135 "-T msp430-tiny-rom.ld --code-region=either --data-region=either" "" "" {main-with-text-rodata-unique-sec.s}
136 {{objdump -D main-const-upper.d}} "either-to-upper-const-unique-sec"}
137 }
138
139 run_ld_link_tests $msp430regionprefixtests
140 run_ld_link_tests $msp430regionprefixuniquesectiontests
141 run_ld_link_tests $msp430eithershuffletests
This page took 0.033216 seconds and 3 git commands to generate.