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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [lookup/] [java2.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-fdollars-in-identifiers" }
3
// Origin: Giovanni Bajo 
4
// Make sure that Java special functions can be called correctly.
5
// (continue from java1.C)
6
 
7
extern "Java"
8
{
9
  typedef __java_int jint;
10
  namespace java
11
  {
12
    namespace lang
13
    {
14
      class Class;
15
      class Object;
16
      class Throwable {};
17
      class Foo;
18
    }
19
  }
20
}
21
 
22
typedef struct java::lang::Object* jobject;
23
typedef struct java::lang::Throwable* jthrowable;
24
typedef class java::lang::Class* jclass;
25
using java::lang::Foo;
26
 
27
class Foo : public java::lang::Throwable
28
{
29
public:
30
  static ::java::lang::Class class$;
31
};
32
 
33
/*
34
 * Step 4: Manual declaration of _Jv_Throw
35
 *  This is the last case we need to test. In the other file we're testing
36
 *  the compiler is able to generate an artifical declaration for this
37
 *  function, so we need to test here if it works with a normal declaration.
38
 */
39
 
40
extern "C" jobject _Jv_AllocObject (jclass) __attribute__((__malloc__));
41
extern "C" void _Jv_Throw (jthrowable) __attribute__ ((__noreturn__));
42
 
43
void Bar4(void)
44
{
45
  Foo* f = new java::lang::Foo;
46
  throw (f);
47
}

powered by: WebSVN 2.1.0

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