URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/tags/gnu-dev/fsf-gcc-snapshot-1-mar-12/or1k-gcc/libjava/testsuite/libjava.cni
- from Rev 765 to Rev 783
- ↔ Reverse comparison
Rev 765 → Rev 783
/longfield.java
0,0 → 1,22
public class longfield |
{ |
long lval = 232300; |
boolean bval = true; |
String sval = "maude"; |
|
public native void doitc (); |
|
public void doitj() |
{ |
System.out.println(lval); |
System.out.println(bval); |
System.out.println(sval); |
} |
|
public static void main(String[] args) |
{ |
longfield f = new longfield(); |
f.doitc(); |
f.doitj(); |
} |
} |
/PR9577.out
0,0 → 1,22
Hello! |
/shortfield.java
0,0 → 1,21
class shortfieldbase |
{ |
short modCount; |
} |
|
public class shortfield extends shortfieldbase |
{ |
short size__; |
int data; |
|
native void ouch (); |
|
public static void main (String[] s) |
{ |
shortfield f = new shortfield(); |
f.modCount = 99; |
f.size__ = 2; |
f.data = 0x12345678; |
f.ouch(); |
} |
} |
/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__ |
/PR9577.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
PR9577.jar
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: shortfield.h
===================================================================
--- shortfield.h (nonexistent)
+++ shortfield.h (revision 783)
@@ -0,0 +1,33 @@
+
+// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
+
+#ifndef __shortfield__
+#define __shortfield__
+
+#pragma interface
+
+#include
+#include
+
+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__
Index: longfield.h
===================================================================
--- longfield.h (nonexistent)
+++ longfield.h (revision 783)
@@ -0,0 +1,33 @@
+
+// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
+
+#ifndef __longfield__
+#define __longfield__
+
+#pragma interface
+
+#include
+#include
+
+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__
Index: natlongfield.cc
===================================================================
--- natlongfield.cc (nonexistent)
+++ natlongfield.cc (revision 783)
@@ -0,0 +1,15 @@
+#include
+
+#include "longfield.h"
+#include
+#include
+
+void
+longfield::doitc ()
+{
+ java::io::PrintStream *ps = java::lang::System::out;
+
+ ps->println(lval);
+ ps->println(bval);
+ ps->println(sval);
+}
Index: natshortfield.cc
===================================================================
--- natshortfield.cc (nonexistent)
+++ natshortfield.cc (revision 783)
@@ -0,0 +1,10 @@
+#include
+#include "shortfield.h"
+
+void shortfield::ouch ()
+{
+ printf ("list: %d %d 0x%x\n",
+ modCount,
+ size__,
+ data);
+}
Index: PR9577.java
===================================================================
--- PR9577.java (nonexistent)
+++ PR9577.java (revision 783)
@@ -0,0 +1,14 @@
+// Check if a method name is mangled properly in the presence
+// of an array parameter sharing a part of the type name
+// with a subsequent parameter.
+
+public class PR9577
+{
+ private native void sayHello (String[] s, Object o);
+
+ public static void main (String[] args)
+ {
+ PR9577 x = new PR9577( );
+ x.sayHello( null, null);
+ }
+}
Index: PR9577.h
===================================================================
--- PR9577.h (nonexistent)
+++ PR9577.h (revision 783)
@@ -0,0 +1,29 @@
+
+// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
+
+#ifndef __PR9577__
+#define __PR9577__
+
+#pragma interface
+
+#include
+#include
+
+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__
Index: cni.exp
===================================================================
--- cni.exp (nonexistent)
+++ cni.exp (revision 783)
@@ -0,0 +1,124 @@
+# Tests for CNI code.
+
+# Compile a single C++ file and produce a .o file. OPTIONS is a list
+# 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 subdir
+
+ set name [file rootname [file tail $file]]
+ set oname ${name}.o
+
+ # Find the generated header.
+ lappend options "additional_flags=-I. -I.. -I$srcdir/$subdir -fdollars-in-identifiers"
+ # Find libgcj headers.
+ lappend options "additional_flags=-I$srcdir/.."
+
+ set x [libjava_prune_warnings \
+ [target_compile $file $oname object $options]]
+ if {$x != ""} {
+ verbose "target_compile failed: $x" 2
+ fail "[file tail $file] compilation"
+ return 0
+ }
+
+ pass "[file tail $file] compilation"
+ return 1
+}
+
+# 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]
+
+ # 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 $list {
+ set cmd "$gcjh -cni -force -classpath .:$libgcj_jar $file"
+ verbose $cmd
+ set x [string trim [libjava_prune_warnings \
+ [lindex [local_exec $cmd "" "" 300] 1]]]
+ if {$x != ""} {
+ verbose "local_exec failed: $x" 2
+ fail "$main header generation"
+ return 0
+ }
+ }
+
+ pass "$main header generation"
+ return 1
+}
+
+# Do all the work for a single CNI test. Return 0 on failure.
+proc gcj_cni_test_one {file} {
+ global runtests
+
+ # The base name. We use it for several purposes.
+ set main [file rootname [file tail $file]]
+ if {! [runtest_file_p $runtests $main]} {
+ # Simply skip it.
+ 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 {! [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]} {
+ # FIXME
+ return 0
+ }
+
+ if {! [gcj_link $main $main [list $file nat$main.o]]} {
+ # FIXME
+ return 0
+ }
+
+ if {! [gcj_invoke $main [file rootname $file].out {}]} {
+ # FIXME
+ return 0
+ }
+
+ # When we succeed we remove all our clutter.
+ eval gcj_cleanup [glob -nocomplain -- ${main}.*] [list $main nat$main.o]
+
+ return 1
+}
+
+# Run the CNI tests.
+proc gcj_cni_run {} {
+ global srcdir subdir
+ global build_triplet host_triplet
+
+ # For now we only test CNI on native builds.
+ if {$build_triplet == $host_triplet} {
+ catch { lsort [glob -nocomplain ${srcdir}/${subdir}/*.jar] } srcfiles
+
+ foreach x $srcfiles {
+ gcj_cni_test_one $x
+ }
+ } else {
+ verbose "CNI tests not run in cross-compilation environment"
+ }
+}
+
+gcj_cni_run
Index: natPR9577.cc
===================================================================
--- natPR9577.cc (nonexistent)
+++ natPR9577.cc (revision 783)
@@ -0,0 +1,9 @@
+#include
+
+#include "PR9577.h"
+
+void
+PR9577::sayHello (JArray< ::java::lang::String *> *x, ::java::lang::Object *y)
+ {
+ printf( "Hello!\n");
+ }
Index: shortfield.out
===================================================================
--- shortfield.out (nonexistent)
+++ shortfield.out (revision 783)
@@ -0,0 +1 @@
+list: 99 2 0x12345678
Index: longfield.out
===================================================================
--- longfield.out (nonexistent)
+++ longfield.out (revision 783)
@@ -0,0 +1,6 @@
+232300
+true
+maude
+232300
+true
+maude
Index: longfield.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: longfield.jar
===================================================================
--- longfield.jar (nonexistent)
+++ longfield.jar (revision 783)
longfield.jar
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: shortfield.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: shortfield.jar
===================================================================
--- shortfield.jar (nonexistent)
+++ shortfield.jar (revision 783)
shortfield.jar
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property