summaryrefslogtreecommitdiff
path: root/gas/testsuite/gas/vtable/vtable.exp
blob: 62d0affff849f3307d33b99a3a4f15854e9bcc8f (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
#
# vtable tests
#
proc run_list_test { name opts } {
    global srcdir subdir
    set testname "vtable $name"
    set file $srcdir/$subdir/$name
    gas_run ${name}.s $opts ">&dump.out"
    if { [regexp_diff "dump.out" "${file}.l"] } then {
	fail $testname
	verbose "output is [file_contents "dump.out"]" 2
	return
    }
    pass $testname
}

# Vtable bits are only supported by ELF targets.
if { (   [istarget "*-*-elf*"] || [istarget "*-*-linux*"])
     && ![istarget *-*-linux*aout*]
     && ![istarget *-*-linux*oldld*] } then {
	 
    # These tests are not (yet) supported on some targets.
    if {   [istarget "ia64-*"]
        || [istarget "hppa*64*-*-*"]
	|| [istarget "i960-*-*"]
	|| [istarget "arc*-*-*"]
	|| [istarget "alpha*-*-*"]
	|| [istarget "sparc64*-*-*"]
	|| [istarget "h8300*-*-*"]
	|| [istarget "d30v-*-*"] } then {
        return
    }

    # not yet supported by ARC
    if {[istarget "arc*-*-*"]} {
      return
    }

    run_dump_test "inherit0" 
    run_list_test "inherit1" "-al"

    # The vtable entry results are different on Rel and Rela targets.
    if {[istarget "i*86-*-*"] 
	|| [istarget "d10v-*-*"] 
	|| [istarget "mips*-*-*"] 
	|| [istarget "strongarm*-*-*"] 
	|| [istarget "xscale*-*-*"] 
	|| [istarget "arm*-*-*"] } then {

	run_dump_test "entry0"

    } else {

	run_dump_test "entry1"

    }
}