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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [err2.java] - Blame information for rev 765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
/*--------------------------------------------------------------------------*/
2
/* File name  : err2.java                                              */
3
/*            :                                                             */
4
/* Cause      : Operator "+=" error in char,byte,short type                 */
5
/*            :                                                             */
6
/* Message    : err2.java: In class `err2':                       */
7
/*            : err2.java: In method `main(java.lang.String[])':       */
8
/*            : err2.java:22: Incompatible type for `='. Explicit cast */
9
/*            :  needed to convert `int' to `byte'.                         */
10
/*            :                 a %= b;                                     */
11
/*            :                   ^                                         */
12
/*            : 1 error                                                     */
13
/*--------------------------------------------------------------------------*/
14
 
15
public class err2 {
16
  public static void main(String[] args) {
17
    byte a = -16;
18
    byte b = 10;
19
 
20
    a %= b;
21
 
22
    if ( a == -6 ) {
23
      System.out.println("OK");
24
    } else {
25
      System.out.println("a = " +a);
26
    }
27
  }
28
}

powered by: WebSVN 2.1.0

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