OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.jvmti/] [jvmti.exp] - Blame information for rev 783

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
# Tests for JVMTI code.
2
 
3
# Compile a single C++ file and produce a .o file.  OPTIONS is a list
4
# of options to pass to the compiler.  Returns 0 on failure, 1 on
5
# success.
6
proc gcj_jvmti_compile_cxx_to_o {file {options {}}} {
7
  global srcdir
8
  global objdir
9
 
10
  set name [file rootname [file tail $file]]
11
  set oname ${name}.o
12
 
13
  # Find the generated header.
14
  lappend options "additional_flags=-g -I. -I.. -fdollars-in-identifiers"
15
  # Find libgcj headers.
16
  lappend options "additional_flags=-I$srcdir/.."
17
  # Find jvmti.h, jvmti_md.h, jvmti-int.h, jvm.h requirements
18
  lappend options "additional_flags=-I$srcdir/../include -I$srcdir/../classpath/include -I$objdir/../include -I$objdir/../../boehm-gc/include "
19
  # ARM C++ emits an ABI warning for varargs.
20
  if { [istarget "arm*"] } {
21
      lappend options "additional_flags=-Wno-abi"
22
  }
23
  # Tru64 UNIX requires  to be compiled with -pthread.
24
  if { [istarget "alpha*-dec-osf*"] } {
25
      lappend options "additional_flags=-pthread"
26
  }
27
 
28
  set x [libjava_prune_warnings \
29
           [target_compile $file $oname object $options]]
30
  if {$x != ""} {
31
    verbose "target_compile failed: $x" 2
32
    fail "[file tail $file] compilation"
33
    return 0
34
  }
35
 
36
  pass "[file tail $file] compilation"
37
  return 1
38
}
39
 
40
# Build header files given name of .java file.  Return 0 on failure.
41
proc gcj_jvmti_build_headers {file} {
42
  global libgcj_jar
43
 
44
  set gcjh [find_gcjh]
45
 
46
  # Currently we only build a header file for the main class from the
47
  # .java file.  If we need more than this, we'll have to figure
48
  # something out.
49
  set file [file rootname [file tail $file]]
50
 
51
  set x [string trim [libjava_prune_warnings \
52
                        [lindex [local_exec "$gcjh -cni -force -classpath .:$libgcj_jar $file" "" "" 300] 1]]]
53
  if {$x != ""} {
54
    verbose "local_exec failed: $x" 2
55
    fail "$file header generation"
56
    return 0
57
  }
58
 
59
  pass "$file header generation"
60
  return 1
61
}
62
 
63
# Do all the work for a single JVMTI test.  Return 0 on failure.
64
proc gcj_jvmti_test_one {file} {
65
  global runtests
66
 
67
  # The base name.  We use it for several purposes.
68
  set main [file rootname [file tail $file]]
69
  if {! [runtest_file_p $runtests $main]} {
70
    # Simply skip it.
71
    return 1
72
  }
73
 
74
#   if {! [bytecompile_file $file [pwd]]} {
75
#     fail "bytecompile $file"
76
#     # FIXME - should use `untested' on all remaining tests.
77
#     # But that is hard.
78
#     return 0
79
#   }
80
#   pass "bytecompile $file"
81
 
82
#   if {! [gcj_jvmti_build_headers $file]} {
83
#     # FIXME
84
#     return 0
85
#   }
86
 
87
  set cfile [file join [file dirname $file] nat$main.cc]
88
  if {! [gcj_jvmti_compile_cxx_to_o $cfile]} {
89
    # FIXME
90
    return 0
91
  }
92
 
93
  if {! [gcj_link $main $main [list $file nat$main.o]]} {
94
    # FIXME
95
    return 0
96
  }
97
 
98
  if {! [gcj_invoke $main [file rootname $file].out {}]} {
99
    # FIXME
100
    return 0
101
  }
102
 
103
  # When we succeed we remove all our clutter.
104
  eval gcj_cleanup [glob -nocomplain -- ${main}.*] [list $main nat$main.o]
105
 
106
  return 1
107
}
108
 
109
# Run the JVMTI tests.
110
proc gcj_jvmti_run {} {
111
  global srcdir subdir
112
  global build_triplet host_triplet
113
 
114
  # For now we only test JVMTI on native builds.
115
  if {$build_triplet == $host_triplet} {
116
    catch { lsort [glob -nocomplain ${srcdir}/${subdir}/*.jar] } srcfiles
117
 
118
    foreach x $srcfiles {
119
      gcj_jvmti_test_one $x
120
    }
121
  } else {
122
    verbose "JVMTI tests not run in cross-compilation environment"
123
  }
124
}
125
 
126
gcj_jvmti_run

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.