OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [treelang/] [output/] [output.exp] - Blame information for rev 827

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

Line No. Rev Author Line
1 149 jeremybenn
proc test_treelang_output { testname srcfiles infile resfile args } {
2
    set comp_output [treelang_target_compile $srcfiles $testname executable $args]
3
    if { [treelang_check_compile $testname $args $testname $comp_output] == 0 } {
4
        return 0;
5
    }
6
 
7
    verbose "Expected output is in $resfile"
8
    set id [open $resfile r]
9
    set expected ""
10
    append expected [read $id]
11
    close $id
12
    set output ""
13
    set output [exec $testname $infile]
14
    regsub -all "\r" "$output" "" output
15
    regsub "\n*$" $expected "" expected
16
    regsub "\n*$" $output "" output
17
    regsub "^\n*" $expected "" expected
18
    regsub "^\n*" $output "" output
19
    regsub -all "\[ \t\]\[ \t\]*" $expected " " expected
20
    regsub -all "\[ \t\]*\n\n*" $expected "\n" expected
21
    regsub -all "\[ \t\]\[ \t\]*" $output " " output
22
    regsub -all "\[ \t\]*\n\n*" $output "\n" output
23
    verbose "expected is $expected"
24
    verbose "actual is $output"
25
 
26
    if { $expected == $output } {
27
        pass $testname
28
    } else {
29
        fail $testname
30
    }
31
    exec rm $testname
32
}
33
global srcdir subdir
34
 
35
catch { lsort [glob -nocomplain ${srcdir}/${subdir}/*.out] } outfiles
36
verbose "Output files are $outfiles"
37
 
38
set prefix ""
39
foreach x $outfiles {
40
    regsub "\\.out$" $x "" prefix
41
    set bname [file tail $prefix]
42
 
43
    if [file exists ${prefix}.inp] {
44
        set inpfile ${prefix}.inp
45
    } else {
46
        set inpfile ""
47
    }
48
 
49
    verbose "inpfile is $inpfile"
50
 
51
    set srcfiles [lsort [glob -nocomplain ${prefix}.{c,tree}]]
52
    verbose "source files are $srcfiles"
53
    test_treelang_output "treelang/$bname" $srcfiles $inpfile $x ""
54
}
55
 
56
# Local Variables:
57
# tcl-indent-level:4
58
# End:

powered by: WebSVN 2.1.0

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