diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/testsuite/libjava.cni | |
parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
download | gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/testsuite/libjava.cni')
-rw-r--r-- | libjava/testsuite/libjava.cni/PR9577.h | 29 | ||||
-rw-r--r-- | libjava/testsuite/libjava.cni/PR9577.jar | bin | 0 -> 629 bytes | |||
-rw-r--r-- | libjava/testsuite/libjava.cni/cni.exp | 55 | ||||
-rw-r--r-- | libjava/testsuite/libjava.cni/longfield.h | 33 | ||||
-rw-r--r-- | libjava/testsuite/libjava.cni/longfield.jar | bin | 0 -> 852 bytes | |||
-rw-r--r-- | libjava/testsuite/libjava.cni/shortfield.h | 33 | ||||
-rw-r--r-- | libjava/testsuite/libjava.cni/shortfield.jar | bin | 0 -> 995 bytes | |||
-rw-r--r-- | libjava/testsuite/libjava.cni/shortfieldbase.h | 25 |
8 files changed, 150 insertions, 25 deletions
diff --git a/libjava/testsuite/libjava.cni/PR9577.h b/libjava/testsuite/libjava.cni/PR9577.h new file mode 100644 index 00000000000..a8d6d19ae6d --- /dev/null +++ b/libjava/testsuite/libjava.cni/PR9577.h @@ -0,0 +1,29 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __PR9577__ +#define __PR9577__ + +#pragma interface + +#include <java/lang/Object.h> +#include <gcj/array.h> + +extern "Java" +{ + class PR9577; +} + +class PR9577 : public ::java::lang::Object +{ + +public: + PR9577(); +private: + void sayHello(JArray< ::java::lang::String * > *, ::java::lang::Object *); +public: + static void main(JArray< ::java::lang::String * > *); + static ::java::lang::Class class$; +}; + +#endif // __PR9577__ diff --git a/libjava/testsuite/libjava.cni/PR9577.jar b/libjava/testsuite/libjava.cni/PR9577.jar Binary files differnew file mode 100644 index 00000000000..6e9f5cee757 --- /dev/null +++ b/libjava/testsuite/libjava.cni/PR9577.jar diff --git a/libjava/testsuite/libjava.cni/cni.exp b/libjava/testsuite/libjava.cni/cni.exp index 22df1462c1d..61fee3b0200 100644 --- a/libjava/testsuite/libjava.cni/cni.exp +++ b/libjava/testsuite/libjava.cni/cni.exp @@ -4,13 +4,13 @@ # of options to pass to the compiler. Returns 0 on failure, 1 on # success. proc gcj_cni_compile_cxx_to_o {file {options {}}} { - global srcdir + global srcdir subdir set name [file rootname [file tail $file]] set oname ${name}.o # Find the generated header. - lappend options "additional_flags=-I. -I.." + lappend options "additional_flags=-I. -I.. -I$srcdir/$subdir" # Find libgcj headers. lappend options "additional_flags=-I$srcdir/.." @@ -28,28 +28,33 @@ proc gcj_cni_compile_cxx_to_o {file {options {}}} { # Build header files given name of .java file. Return 0 on failure. proc gcj_cni_build_headers {file} { + global libgcj_jar + set gcjh [find_gcjh] - set jvscan [find_jvscan] - set class_out [string trim \ - [libjava_prune_warnings \ - [lindex [local_exec "$jvscan --encoding=UTF-8 $file --list-class" "" "" 300] 1]]] - if {[string match "*parse error*" $class_out]} { - fail "$file header generation" - return 0 + # Currently we only build a header file for the main class from the + # .java file, and then others on an ad hoc basis. + set list {} + set main [file rootname [file tail $file]] + lappend list $main + # ... for instance, an obvious hack. + if {$main == "shortfield"} { + lappend list shortfieldbase } - foreach file [split $class_out] { + foreach file $list { + set cmd "$gcjh -cni -force -classpath .:$libgcj_jar $file" + verbose $cmd set x [string trim [libjava_prune_warnings \ - [lindex [local_exec "$gcjh $file" "" "" 300] 1]]] + [lindex [local_exec $cmd "" "" 300] 1]]] if {$x != ""} { verbose "local_exec failed: $x" 2 - fail "$file header generation" + fail "$main header generation" return 0 } } - pass "$file header generation" + pass "$main header generation" return 1 } @@ -64,18 +69,18 @@ proc gcj_cni_test_one {file} { return 1 } - if {! [bytecompile_file $file [pwd]]} { - fail "bytecompile $file" - # FIXME - should use `untested' on all remaining tests. - # But that is hard. - return 0 - } - pass "bytecompile $file" +# if {! [bytecompile_file $file [pwd]]} { +# fail "bytecompile $file" +# # FIXME - should use `untested' on all remaining tests. +# # But that is hard. +# return 0 +# } +# pass "bytecompile $file" - if {! [gcj_cni_build_headers $file]} { - # FIXME - return 0 - } +# if {! [gcj_cni_build_headers $file]} { +# # FIXME +# return 0 +# } set cfile [file join [file dirname $file] nat$main.cc] if {! [gcj_cni_compile_cxx_to_o $cfile]} { @@ -106,7 +111,7 @@ proc gcj_cni_run {} { # For now we only test CNI on native builds. if {$build_triplet == $host_triplet} { - catch { lsort [glob -nocomplain ${srcdir}/${subdir}/*.java] } srcfiles + catch { lsort [glob -nocomplain ${srcdir}/${subdir}/*.jar] } srcfiles foreach x $srcfiles { gcj_cni_test_one $x diff --git a/libjava/testsuite/libjava.cni/longfield.h b/libjava/testsuite/libjava.cni/longfield.h new file mode 100644 index 00000000000..51ea17f44cb --- /dev/null +++ b/libjava/testsuite/libjava.cni/longfield.h @@ -0,0 +1,33 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __longfield__ +#define __longfield__ + +#pragma interface + +#include <java/lang/Object.h> +#include <gcj/array.h> + +extern "Java" +{ + class longfield; +} + +class longfield : public ::java::lang::Object +{ + +public: + longfield(); + virtual void doitc(); + virtual void doitj(); + static void main(JArray< ::java::lang::String * > *); +public: // actually package-private + jlong __attribute__((aligned(__alignof__( ::java::lang::Object)))) lval; + jboolean bval; + ::java::lang::String * sval; +public: + static ::java::lang::Class class$; +}; + +#endif // __longfield__ diff --git a/libjava/testsuite/libjava.cni/longfield.jar b/libjava/testsuite/libjava.cni/longfield.jar Binary files differnew file mode 100644 index 00000000000..aab94677664 --- /dev/null +++ b/libjava/testsuite/libjava.cni/longfield.jar diff --git a/libjava/testsuite/libjava.cni/shortfield.h b/libjava/testsuite/libjava.cni/shortfield.h new file mode 100644 index 00000000000..175a9fd8e5c --- /dev/null +++ b/libjava/testsuite/libjava.cni/shortfield.h @@ -0,0 +1,33 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __shortfield__ +#define __shortfield__ + +#pragma interface + +#include <shortfieldbase.h> +#include <gcj/array.h> + +extern "Java" +{ + class shortfield; +} + +class shortfield : public ::shortfieldbase +{ + +public: + shortfield(); +public: // actually package-private + virtual void ouch(); +public: + static void main(JArray< ::java::lang::String * > *); +public: // actually package-private + jshort __attribute__((aligned(__alignof__( ::shortfieldbase)))) size__; + jint data; +public: + static ::java::lang::Class class$; +}; + +#endif // __shortfield__ diff --git a/libjava/testsuite/libjava.cni/shortfield.jar b/libjava/testsuite/libjava.cni/shortfield.jar Binary files differnew file mode 100644 index 00000000000..f7af1afb7ca --- /dev/null +++ b/libjava/testsuite/libjava.cni/shortfield.jar diff --git a/libjava/testsuite/libjava.cni/shortfieldbase.h b/libjava/testsuite/libjava.cni/shortfieldbase.h new file mode 100644 index 00000000000..171ca3d45a7 --- /dev/null +++ b/libjava/testsuite/libjava.cni/shortfieldbase.h @@ -0,0 +1,25 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __shortfieldbase__ +#define __shortfieldbase__ + +#pragma interface + +#include <java/lang/Object.h> +extern "Java" +{ + class shortfieldbase; +} + +class shortfieldbase : public ::java::lang::Object +{ + +public: // actually package-private + shortfieldbase(); + jshort __attribute__((aligned(__alignof__( ::java::lang::Object)))) modCount; +public: + static ::java::lang::Class class$; +}; + +#endif // __shortfieldbase__ |