Commit | Line | Data |
---|---|---|
9ec59d51 RS |
1 | # Expect script for AIX 5.2+ tests |
2 | # Copyright 2009 Free Software Foundation | |
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 "powerpc*-*-aix\[5-9\]*"] | |
23 | || [istarget "powerpc*-*-aix5.\[01\]*"] } { | |
24 | return | |
25 | } | |
26 | ||
27 | # Run a run_link_tests-style test for AIX. SIZE selects the target size | |
28 | # (32 or 64). The other arguments are elements of a run_link_tests test. | |
29 | # | |
30 | # Make the following changes before running the test: | |
31 | # | |
32 | # - Mention SIZE in the test name. | |
33 | # - Add "-aSIZE --defsym size=SIZE" to the assembler options. | |
34 | # - Add the source directory to any "-bI:" and "-bE:" linker options. | |
35 | # - Add "-bSIZE" to the linker options. | |
36 | # - Add "-XSIZE" to the archiver options. | |
37 | # - Replace "SIZE" with SIZE in TOOLS. | |
38 | # - When testing 64-bit targets: | |
39 | # - Turn tmpdir/aix-* into tmpdir/aix64-*. | |
40 | # - Turn tmpdir/libaix-* into tmpdir/libaix64-*. | |
41 | # - Turn -laix* into -laix64*, to compensate for the above. | |
42 | proc run_aix_test { size name ldopts asopts sources tools output } { | |
43 | global srcdir subdir | |
44 | ||
45 | if { $size == 64 } { | |
46 | regsub -all {tmpdir/aix-} $ldopts {tmpdir/aix64-} ldopts | |
47 | regsub {^aix} $output {aix64} output | |
48 | ||
49 | regsub -all -- {-laix-} $ldopts {-laix64-} ldopts | |
50 | regsub {^libaix} $output {libaix64} output | |
51 | } | |
52 | if { [regexp {.a$} $output] } { | |
53 | append ldopts " -X$size" | |
54 | } else { | |
55 | regsub -all {(-b[IE]):} $ldopts "\\1:$srcdir/$subdir/" ldopts | |
56 | append ldopts " -b$size" | |
57 | } | |
58 | regsub -all {SIZE} $tools $size tools | |
59 | run_ld_link_tests [list [list "$name ($size-bit)" \ | |
60 | $ldopts \ | |
61 | "$asopts -a$size --defsym size=$size" \ | |
62 | $sources \ | |
63 | $tools \ | |
64 | $output]] | |
65 | } | |
66 | ||
67 | set aix52tests { | |
0e3212ad RS |
68 | {"Relocations against absolute symbols 1" |
69 | "-shared -bI:aix-abs-reloc-1.im -bE:aix-abs-reloc-1.ex" | |
70 | {} {aix-abs-reloc-1.s} | |
71 | {{objdump -sRj.data aix-abs-reloc-1.od}} | |
72 | "aix-abs-reloc-1.so"} | |
73 | ||
9ec59d51 RS |
74 | {"Core sections test 1" "-shared -bE:aix-core-sec-1.ex" |
75 | "" {aix-core-sec-1.s} | |
76 | {{objdump -h aix-core-sec-1.hd}} | |
77 | "aix-core-sec-1.so"} | |
78 | ||
79 | {"Core sections test 2" "-shared -bE:aix-core-sec-2.ex" | |
80 | "" {aix-core-sec-2.s} | |
81 | {{objdump -h aix-core-sec-2.hd}} | |
82 | "aix-core-sec-2.so"} | |
83 | ||
84 | {"Core sections test 3" "-shared -bE:aix-core-sec-3.ex" | |
85 | "" {aix-core-sec-3.s} | |
86 | {{objdump -h aix-core-sec-3.hd}} | |
87 | "aix-core-sec-3.so"} | |
88 | } | |
89 | ||
90 | foreach test $aix52tests { | |
91 | foreach { name ldopts asopts sources tools output } $test { | |
92 | run_aix_test 32 $name $ldopts $asopts $sources $tools $output | |
93 | run_aix_test 64 $name $ldopts $asopts $sources $tools $output | |
94 | } | |
95 | } |