OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.20.1/] [gas/] [testsuite/] [lib/] [gas-dg.exp] - Blame information for rev 320

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 205 julius
# Define gas callbacks for dg.exp.
2
 
3
load_lib dg.exp
4
 
5
# The use of this function is still in a bit of flux.
6
# It should be theoretically possible to assemble, link, and run a file
7
# but we currently don't support that.  Assembler testcases aren't usually
8
# that elaborate anyway.  :-)
9
 
10
proc gas-dg-test { prog do_what tool_flags } {
11
    # FIXME: the gas testsuite doesn't define tmpdir.  Use outdir?
12
    set output_file "./a.out"
13
 
14
    switch $do_what {
15
        "preprocess" {
16
        }
17
        "assemble" {
18
        }
19
        "link" {
20
        }
21
        "run" {
22
            # This is the only place where we care if an executable was
23
            # created or not.  If it was, dg.exp will try to run it.
24
            remote_file host delete "$output_file"
25
        }
26
        default {
27
            perror "$do_what: not a valid dg-do keyword"
28
            return ""
29
        }
30
    }
31
 
32
    # gas_start prepends $srcdir/$subdir so we must remove it from PROG
33
    # if present.  First remove extraneous //'s.
34
    global srcdir subdir
35
    set dir "$srcdir/$subdir"
36
    regsub -all "//" $dir "/" dir
37
    regsub -all "//" $prog "/" prog
38
    if [string match "$dir/*" $prog] {
39
        # We use (?q) to treat $dir as a literal.
40
        regsub "(?q)$dir" $prog "" prog
41
    }
42
 
43
    # FIXME: This should be gas_start but it doesn't set comp_output.
44
    return [gas_run $prog $tool_flags ""]
45
}
46
 
47
proc gas-dg-prune { system text } {
48
    #send_user "Before:$text\n"
49
    regsub -all "(^|\n)\[^\n\]*: Assembler messages:\[^\n\]*" $text "" text
50
    regsub -all "(^|\n)\[^\n\]*: End of file not at end\[^\n\]*Newline inserted." $text "" text
51
    #send_user "After:$text\n"
52
 
53
    return $text
54
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.