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

Subversion Repositories openrisc_2011-10-31

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/tags/gnu-src/newlib-1.18.0/newlib-1.18.0-or32-1.0rc1/newlib/testsuite/lib
    from Rev 214 to Rev 345
    Reverse comparison

Rev 214 → Rev 345

/newlibprocs.exp
0,0 → 1,106
# Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
#
# Permission to use, copy, modify, and distribute this software
# is freely granted, provided that this notice is preserved.
#
 
send_user "Loaded newlib.exp\n"
 
# flags.exp overrides the dejagnu versions of libgloss_link_flags,
# newlib_link_flags, and newlib_include_flags.
load_lib flags.exp
 
proc newlib_version { } {
global tool_version
 
verbose "In newlib version...\n"
 
return $tool_version
}
 
set newlib_initialized 0
 
proc newlib_init { args } {
global gluefile wrap_flags
global newlib_initialized
global target_info
# These values are initialized in the local site.exp file.
global srcdir objdir tmpdir
global host_triplet target_triplet
global old_ld_library_path
 
verbose "In newlib_init...\n"
 
if { $newlib_initialized == 1 } { return; }
 
if {[target_info needs_status_wrapper] != "" && \
[target_info needs_status_wrapper] != "0" && \
![info exists gluefile]} {
set gluefile ${tmpdir}/testglue.o;
set result [build_wrapper $gluefile];
if { $result != "" } {
set gluefile [lindex $result 0];
set wrap_flags [lindex $result 1];
} else {
unset gluefile
}
}
 
if [string match $host_triplet $target_triplet] then {
if [string match "i686-pc-linux-gnu" $host_triplet] then {
set old_ld_library_path [getenv LD_LIBRARY_PATH]
setenv LD_LIBRARY_PATH "$objdir/.libs"
}
}
}
 
proc newlib_target_compile { source dest type options } {
global gluefile wrap_flags
global srcdir objdir
global host_triplet target_triplet
 
verbose "In newlib_target_compile...\n"
 
lappend options "libs=-I$srcdir/include"
verbose "srcdir is $srcdir"
if {[target_info needs_status_wrapper] != "" && \
[target_info needs_status_wrapper] != "0" && \
[info exists gluefile] } {
lappend options "libs=$gluefile"
lappend options "ldflags=$wrap_flags"
}
 
if [string match $host_triplet $target_triplet] then {
if [string match "i686-pc-linux-gnu" $host_triplet] then {
lappend options "libs=$objdir/crt0.o -lc -lgcc"
lappend options "ldflags=-nostdlib -L$objdir/.libs [newlib_include_flags]"
}
}
 
return [target_compile $source $dest $type $options]
}
 
proc newlib_finish { } {
global old_ld_library_path
global host_triplet target_triplet
 
verbose "In newlib_finish...\n"
 
if [string match $host_triplet $target_triplet] then {
if [string match "i686-pc-linux-gnu" $host_triplet] then {
setenv LD_LIBRARY_PATH "$old_ld_library_path"
}
}
}
 
proc newlib_exit { } {
global gluefile;
verbose "In newlib_exit...\n"
 
if [info exists gluefile] {
file_on_build delete $gluefile;
unset gluefile;
}
}
/passfail.exp
0,0 → 1,54
# Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
#
# Permission to use, copy, modify, and distribute this software
# is freely granted, provided that this notice is preserved.
#
 
load_lib newlibprocs.exp
 
# newlib_pass_fail_all compiles and runs all the source files in the
# test directory. If flag is -x, then the sources whose basenames are
# listed in exclude_list are not compiled and run.
 
proc newlib_pass_fail_all { flag exclude_list } {
global srcdir objdir subdir runtests
 
foreach fullsrcfile [glob -nocomplain $srcdir/$subdir/*.c] {
set srcfile "[file tail $fullsrcfile]"
# If we're only testing specific files and this isn't one of them, skip it.
if ![runtest_file_p $runtests $srcfile] then {
continue
}
 
# Exclude tests listed in exclude_list.
if { $flag == "-x" } then {
if {[lsearch $exclude_list "$srcfile"] != -1} then {
continue
}
}
newlib_pass_fail "$srcfile"
}
}
 
# newlib_pass_fail takes the basename of a test source file, which it
# compiles and runs.
 
proc newlib_pass_fail { srcfile } {
global srcdir tmpdir subdir
 
set fullsrcfile "$srcdir/$subdir/$srcfile"
 
set test_driver "$tmpdir/[file rootname $srcfile].x"
 
set comp_output [newlib_target_compile "$fullsrcfile" "$test_driver" "executable" ""]
 
if { $comp_output != "" } {
fail "$subdir/$srcfile compilation"
unresolved "$subdir/$srcfile execution"
} else {
pass "$subdir/$srcfile compilation"
set result [newlib_load $test_driver ""]
set status [lindex $result 0]
$status "$subdir/$srcfile execution"
}
}
/flags.exp
0,0 → 1,86
# Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
#
# Permission to use, copy, modify, and distribute this software
# is freely granted, provided that this notice is preserved.
#
 
# flags.exp: overrides the dejagnu versions of libgloss_link_flags,
# newlib_link_flags, and newlib_include_flags.
 
# These versions of the procedures generate link and include flags
# by searching for the needed files in the current build and source
# directories, rather than in the build and source paths of the
# compiler being used.
 
if {![llength [info procs saved_libgloss_link_flags]]} {
rename libgloss_link_flags saved_libgloss_link_flags
}
 
proc libgloss_link_flags { args } {
global target_cpu
# These values come from the local site.exp.
global srcdir objdir
global multibuildtop
 
if {![info exists multibuildtop]} {
return [saved_libgloss_link_flags $args]
}
 
verbose "In newlib version of libgloss_link_flags...\n"
 
if [isnative] {
return ""
}
 
if [is_remote host] {
return ""
}
 
set target_build_path "$objdir/$multibuildtop.."
 
set gloss_srcdir [lookfor_file ${srcdir} libgloss/$target_cpu]
 
if { $gloss_srcdir == "" } {
return ""
}
 
if [file exists $target_build_path/libgloss/$target_cpu] {
verbose "libgloss path is $target_build_path/libgloss/$target_cpu" 2
return "-B$target_build_path/libgloss/$target_cpu/ -L$target_build_path/libgloss/$target_cpu -L$gloss_srcdir"
} else {
verbose -log "No libgloss support for this target." 2
return ""
}
}
 
proc newlib_link_flags { args } {
global tool_root_dir
global srcdir objdir
 
verbose "In newlib version of newlib_link_flags...\n"
 
if [is_remote host] {
return ""
}
 
set ld_script_path [lookfor_file ${tool_root_dir} "ld/ldscripts"];
if { $ld_script_path != "" } {
set result "-L[file dirname $ld_script_path]"
} else {
set result ""
}
 
return "$result -B$objdir -L$objdir"
}
 
proc newlib_include_flags { args } {
global srcdir objdir
 
verbose "In newlib version of newlib_include_flags...\n"
 
if [is_remote host] {
return ""
}
 
return " -I$objdir/targ-include"
}
/checkoutput.exp
0,0 → 1,43
# Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
#
# Permission to use, copy, modify, and distribute this software
# is freely granted, provided that this notice is preserved.
#
 
# newlib_check_output takes the basename of the test source file, and
# a list of TCL regular expressions representing the expected output.
# It assumes one line of output per test.
 
proc newlib_check_output { srcfile expectlist } {
global subdir srcdir tmpdir
 
set srcfullname "$srcdir/$subdir/$srcfile"
set test_driver "$tmpdir/[file tail [file rootname $srcfullname].x]"
 
set comp_output [newlib_target_compile "$srcfullname" "$test_driver" "executable" ""]
 
if { $comp_output != "" } {
fail "$subdir/$srcfile compilation"
unresolved "$subdir/$srcfile output"
return
}
pass "$subdir/$srcfile compilation"
 
set result [newlib_load $test_driver ""]
set status [lindex $result 0]
set output [lindex $result 1]
 
set output_lines [split $output "\n"]
 
foreach { expectedval } $expectlist {
set gotval [string trim [lindex $output_lines 0] "\r"]
if { ! [string match $expectedval $gotval] } {
verbose -log "$subdir/$srcfile: Expected: $expectedval Got: $gotval "
fail "$subdir/$srcfile output"
return
}
set output_lines [lrange $output_lines 1 end]
}
 
pass "$subdir/$srcfile output"
}

powered by: WebSVN 2.1.0

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