From: Ian Lance Taylor Date: Wed, 22 Nov 1995 18:19:43 +0000 (+0000) Subject: * lib/utils-lib.exp (prune_system_crud): Discard -g -O warnings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=49c43d0201d2ce37d0d78e147f760b60635914da;p=binutils-gdb.git * lib/utils-lib.exp (prune_system_crud): Discard -g -O warnings from native compilers on OSF/1 and SunOS. --- diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog index f089f63c2bc..16afefc02b2 100644 --- a/binutils/testsuite/ChangeLog +++ b/binutils/testsuite/ChangeLog @@ -1,3 +1,18 @@ +Wed Nov 22 13:18:58 1995 Ian Lance Taylor + + * lib/utils-lib.exp (prune_system_crud): Discard -g -O warnings + from native compilers on OSF/1 and SunOS. + +Fri Nov 17 10:36:09 1995 Ian Lance Taylor + + * lib/utils-lib.exp (default_binutils_compiler: Change error + message to say compilation rather than assembly. + +Wed Nov 15 18:34:42 1995 Ken Raeburn + + * binutils-all/objcopy.exp: Simple copy test does appear to work + on i*86-svr4. + Wed Nov 15 12:19:28 1995 Ian Lance Taylor * binutils-all/objcopy.exp: If assembly fails, call unresolved. diff --git a/binutils/testsuite/lib/utils-lib.exp b/binutils/testsuite/lib/utils-lib.exp index 2ea9f83605b..395e7629109 100644 --- a/binutils/testsuite/lib/utils-lib.exp +++ b/binutils/testsuite/lib/utils-lib.exp @@ -43,6 +43,7 @@ proc binutil_version { prog } { # proc default_binutils_run { prog progargs } { global binutils_run_failed + global host_triplet set binutils_run_failed 0 @@ -67,6 +68,7 @@ proc default_binutils_run { prog progargs } { # language. regsub -all "\\$" $progargs "\\$" progq catch "exec $prog $progq" exec_output + set exec_output [prune_system_crud $host_triplet $exec_output] if {![string match "" $exec_output]} then { send_log "$exec_output\n" verbose "$exec_output" @@ -81,6 +83,7 @@ proc default_binutils_run { prog progargs } { proc default_binutils_assemble { as source object } { global ASFLAGS global srcdir + global host_triplet if {[which $as] == 0} then { perror "$as does not exist" @@ -117,6 +120,46 @@ proc default_binutils_assemble { as source object } { } } +# +# default_binutils_compile +# compile a file +# +proc default_binutils_compile { cc flags source object } { + global CFLAGS + global srcdir + global host_triplet + + if {[which $cc] == 0} then { + perror "$cc does not exist" + return 0 + } + + if ![info exists CFLAGS] { set CFLAGS "" } + + send_log "$cc $flags $CFLAGS -o $object $source\n" + verbose "$cc $flags $CFLAGS -o $object $source" + catch "exec $cc $flags $CFLAGS -o $object $source" exec_output + + set exec_output [prune_system_crud $host_triplet $exec_output] + + if [string match "" $exec_output] then { + return 1 + } else { + send_log "$exec_output\n" + verbose "$exec_output" + perror "$source: compilation failed" + return 0 + } +} + +# +# default_binutils_remove +# remove a file +# +proc default_binutils_remove { file } { + catch "exec rm -f $file" exec_output +} + # This definition is taken from an unreleased version of DejaGnu. Once # that version gets released, and has been out in the world for a few # months at least, it may be safe to delete this copy. @@ -137,6 +180,12 @@ if ![string length [info proc prune_system_crud]] { # The "\\1" is to try to preserve a "\n" but only if necessary. regsub -all "(^|\n)(ld.so: warning:\[^\n\]*\n?)+" $text "\\1" text + # This happens when compiling on Alpha OSF/1 with cc -g -O. + regsub -all "(^|\n)(uopt: Warning: file not optimized; use -g3 if both optimization and debug wanted\n?)+" $text "\\1" text + + # This happens on SunOS with cc -g -O. + regsub -all "(^|\n)(cc: Warning: -O conflicts with -g. -O turned off.\n?)+" $text "\\1" text + # It might be tempting to get carried away and delete blank lines, etc. # Just delete *exactly* what we're ask to, and that's it. return $text