From 3ff15cdce5efeefd0fe4eb0aa1a533bc360937e0 Mon Sep 17 00:00:00 2001 From: tromey Date: Thu, 14 Jun 2001 17:46:53 +0000 Subject: * libjava.jni/jni.exp: New file. * lib/libjava.exp (gcj_link): New proc. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43375 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/testsuite/lib/libjava.exp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libjava/testsuite/lib/libjava.exp') diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp index f6947ccdf3d..ace5f6c2b2d 100644 --- a/libjava/testsuite/lib/libjava.exp +++ b/libjava/testsuite/lib/libjava.exp @@ -336,6 +336,27 @@ proc libjava_arguments {{mode compile}} { return $args } +# Link a bunch of objects into a program. MAIN is the name of the +# class holding `main'. Return 0 on failure. +proc gcj_link {program main files {options {}}} { + set arguments [libjava_arguments link] + if {[llength $options]} { + eval lappend arguments $options + } + lappend arguments "additional_flags=--main=$main" + set x [prune_warnings [libjava_tcompile $files $program executable \ + $arguments]] + if {$x != ""} { + verbose "link failure: $x" 2 + fail "linking $program" + setup_xfail "*-*-*" + fail "running $program" + return 0 + } + + pass "linking $program" + return 1 +} # # Run the test specified by srcfile and resultfile. compile_args and -- cgit v1.2.3