summaryrefslogtreecommitdiff
path: root/gas/testsuite/gas/ppc/aix.exp
blob: 88f6cc6cdfa397c53128445cdc6e95a49becc44b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright (C) 2001-2019 Free Software Foundation, Inc.
# Contributed by Red Hat

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  
#

#
# Aix on PowerPC tests
#
proc do_align_test {} {
    set testname "align.s: Alignment of symbols part 1"
    set x0 0
    set x1 0
    set x2 0
    set x3 0
    set x4 0

    set testname "align.s (part 2)"

    if [gas_test_old "align.s" "" "Alignment of symbols part 1"] {
	objdump_start_no_subdir "a.out" "-t"

	while 1 {
	    expect {
		-re "AUX val    16 prmhsh 0 snhsh 0 typ 3 algn 2 clss 5 stb 0 snstb 0" { set x0 1 }
		-re "AUX val    32 prmhsh 0 snhsh 0 typ 3 algn 1 clss 5 stb 0 snstb 0" { set x1 1 }
		-re "AUX val    64 prmhsh 0 snhsh 0 typ 3 algn 2 clss 5 stb 0 snstb 0" { set x2 1 }
		-re "AUX val   128 prmhsh 0 snhsh 0 typ 3 algn 3 clss 5 stb 0 snstb 0" { set x3 1 }
		-re "AUX val   256 prmhsh 0 snhsh 0 typ 3 algn 4 clss 5 stb 0 snstb 0" { set x4 1 }
		-re "\[^\n\]*\n"				{ }
		timeout				{ perror "timeout\n"; break }
		eof				{ break }
	    }
	}

	objdump_finish

	if [all_ones $x0 $x1 $x2 $x3 $x4] then {
	    pass $testname
	} else {
	    fail $testname
	}
    }
}


if { [istarget "powerpc*-*-aix*"] || [istarget "rs6000-*-aix*"] } then {

    # Make sure that symbols are correctly aligned 
    do_align_test

    run_dump_test "textalign-xcoff-001"
    run_dump_test "textalign-xcoff-002"
    run_dump_test "xcoff-branch-1-32"
    run_dump_test "xcoff-branch-1-64"
    run_dump_test "xcoff-br16-1"
    run_dump_test "xcoff-br16-2"
    run_dump_test "xcoff-toc-1"

    run_list_test "xcoff-ref-1"

    run_dump_test "xcoff-dwsect-1-32"
    run_dump_test "xcoff-dwsect-1-64"
}