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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.special/] [special.exp] - Blame information for rev 765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
# Special test cases.  These require tricky build procedures.
2
 
3
proc gcj_special_try_compiler {} {
4
  global srcdir subdir
5
  return [bytecompile_file ${srcdir}/${subdir}/pr21115I.java [pwd]]
6
}
7
 
8
proc gcj_special_pr21115 {} {
9
  global srcdir subdir env
10
 
11
  # ---- PR 21115 -------------------------------------------------------
12
 
13
  if {! [bytecompile_file ${srcdir}/${subdir}/pr21115I.java [pwd]]} {
14
    fail "bytecompile ${srcdir}/${subdir}/libjava.special/pr21115I.java"
15
    # FIXME - should use `untested' on all remaining tests.
16
    # But that is hard.
17
    return 0
18
  }
19
  pass "bytecompile pr21115I.java"
20
 
21
  if {! [gcj_link pr21115 pr21115 [list ${srcdir}/${subdir}/pr21115.java]]} {
22
    fail "compiling/linking pr21115.java"
23
    # FIXME
24
    return 0
25
  }
26
 
27
  if {! [gcj_invoke pr21115 ${srcdir}/${subdir}/pr21115.out ""]} {
28
    # FIXME
29
    return 0
30
  }
31
 
32
  return 1
33
}
34
 
35
# Write a .java file and bytecompile it.  Return 0 on failure.
36
proc gcj_write_and_byte_compile {name contents} {
37
  set fd [open $name w]
38
  puts $fd $contents
39
  close $fd
40
 
41
  if {! [bytecompile_file $name [pwd]]} {
42
    fail "bytecompile $name"
43
    # FIXME - should use `untested' on all remaining tests.
44
    # But that is hard.
45
    return 0
46
  }
47
  pass "bytecompile $name"
48
  return 1
49
}
50
 
51
# Check that BC-compiled code lazily throws IllegalAccessError.
52
proc gcj_special_lazy_illegal_access {} {
53
  global srcdir subdir env
54
 
55
  # Write and compile the initial files.
56
  if {! [gcj_write_and_byte_compile LazyA.java {
57
    public class LazyA {
58
      public static void m() { }
59
    }
60
  }]} {
61
    return 0
62
  }
63
  if {! [gcj_write_and_byte_compile LazyB.java {
64
    public class LazyB {
65
      public static void m() { }
66
      public static void main(String[] args) { }
67
    }
68
  }]} {
69
    return 0
70
  }
71
 
72
  # Create the expected output file.
73
  set fd [open Lazy.out w]
74
  close $fd
75
 
76
  # Now recompile LazyA with different access for m().
77
  if {! [gcj_write_and_byte_compile LazyA.java {
78
    public class LazyA {
79
      private static void m() { }
80
    }
81
  }]} {
82
    return 0
83
  }
84
 
85
  # Link and run... this should still work, since we don't actually
86
  # try to call LazyA.m().
87
  if {! [gcj_link Lazy LazyB {LazyA.class LazyB.class} \
88
           additional_flags=-findirect-dispatch]} {
89
    fail "compiling/linking pr21115.java"
90
    # FIXME
91
    return 0
92
  }
93
 
94
  if {! [gcj_invoke Lazy Lazy.out ""]} {
95
    # FIXME
96
    return 0
97
  }
98
 
99
  return 1
100
}
101
 
102
# For these tests it is simpler to require that gcj work.  So we try
103
# the compiler and if it fails, we simply skip the tests.
104
 
105
if {[gcj_special_try_compiler]} {
106
  gcj_special_pr21115
107
  gcj_special_lazy_illegal_access
108
}

powered by: WebSVN 2.1.0

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