OSDN Git Service

* testsuite/libjava.jvmti/jvmti.exp (gcj_jvmti_compile_cxx_to_o):
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / libjava.jvmti / jvmti.exp
index 18be872..2d93985 100644 (file)
@@ -11,11 +11,19 @@ proc gcj_jvmti_compile_cxx_to_o {file {options {}}} {
   set oname ${name}.o
 
   # Find the generated header.
-  lappend options "additional_flags=-g -I. -I.."
+  lappend options "additional_flags=-g -I. -I.. -fdollars-in-identifiers"
   # Find libgcj headers.
   lappend options "additional_flags=-I$srcdir/.."
   # Find jvmti.h, jvmti_md.h, jvmti-int.h, jvm.h requirements
-  lappend options "additional_flags=-I$srcdir/../include -I$srcdir/../classpath/include -I$objdir/../include -I$objdir/../../boehm-gc/include"
+  lappend options "additional_flags=-I$srcdir/../include -I$srcdir/../classpath/include -I$objdir/../include -I$objdir/../../boehm-gc/include "
+  # ARM C++ emits an ABI warning for varargs.
+  if { [istarget "arm*"] } {
+      lappend options "additional_flags=-Wno-abi"
+  }
+  # Tru64 UNIX requires <pthread.h> to be compiled with -pthread.
+  if { [istarget "alpha*-dec-osf*"] } {
+      lappend options "additional_flags=-pthread"
+  }
 
   set x [libjava_prune_warnings \
           [target_compile $file $oname object $options]]
@@ -31,27 +39,23 @@ proc gcj_jvmti_compile_cxx_to_o {file {options {}}} {
 
 # Build header files given name of .java file.  Return 0 on failure.
 proc gcj_jvmti_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]} {
+  # Currently we only build a header file for the main class from the
+  # .java file.  If we need more than this, we'll have to figure
+  # something out.
+  set file [file rootname [file tail $file]]
+
+  set x [string trim [libjava_prune_warnings \
+                       [lindex [local_exec "$gcjh -cni -force -classpath .:$libgcj_jar $file" "" "" 300] 1]]]
+  if {$x != ""} {
+    verbose "local_exec failed: $x" 2
     fail "$file header generation"
     return 0
   }
 
-  foreach file [split $class_out] {
-    set x [string trim [libjava_prune_warnings \
-                         [lindex [local_exec "$gcjh $file" "" "" 300] 1]]]
-    if {$x != ""} {
-      verbose "local_exec failed: $x" 2
-      fail "$file header generation"
-      return 0
-    }
-  }
-
   pass "$file header generation"
   return 1
 }
@@ -67,18 +71,18 @@ proc gcj_jvmti_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_jvmti_build_headers $file]} {
-    # FIXME
-    return 0
-  }
+  if {! [gcj_jvmti_build_headers $file]} {
+    # FIXME
+    return 0
+  }
 
   set cfile [file join [file dirname $file] nat$main.cc]
   if {! [gcj_jvmti_compile_cxx_to_o $cfile]} {
@@ -109,7 +113,7 @@ proc gcj_jvmti_run {} {
 
   # For now we only test JVMTI 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_jvmti_test_one $x