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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.java/] [jprint.java] - Blame information for rev 833

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
// jprint.java test program.
2
//
3
// Copyright 2004, 2010
4
// Free Software Foundation, Inc.
5
//
6
// Written by Jeff Johnston <jjohnstn@redhat.com> 
7
// Contributed by Red Hat
8
//
9
// This file is part of GDB.
10
//
11
// This program is free software; you can redistribute it and/or modify
12
// it under the terms of the GNU General Public License as published by
13
// the Free Software Foundation; either version 3 of the License, or
14
// (at your option) any later version.
15
//
16
// This program is distributed in the hope that it will be useful,
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
// GNU General Public License for more details.
20
//
21
// You should have received a copy of the GNU General Public License
22
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
 
24
import java.util.Properties;
25
 
26
class jvclass {
27
  public static int k;
28
  static {
29
    k = 77;
30
  }
31
  public static void addprint (int x, int y, int z) {
32
    int sum = x + y + z;
33
    System.out.println ("sum is " + sum);
34
  }
35
 
36
  public int addk (int x) {
37
    int sum = x + k;
38
    System.out.println ("adding k gives " + sum);
39
    return sum;
40
  }
41
}
42
 
43
public class jprint extends jvclass {
44
  public static Properties props = new Properties ();
45
 
46
  public int dothat (int x) {
47
    int y = x + 3;
48
    System.out.println ("new value is " + y);
49
    return y + 4;
50
  }
51
  public static void print (int x) {
52
    System.out.println("x is " + x);
53
  }
54
  public static void print (int x, int y) {
55
    System.out.println("y is " + y);
56
  }
57
  public static void main(String[] args) {
58
    jprint x = new jprint ();
59
    x.dothat (44);
60
    print (k, 33);
61
  }
62
}
63
 
64
 

powered by: WebSVN 2.1.0

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