diff options
author | Andrew Haley <aph@cambridge.redhat.com> | 2001-07-06 16:32:40 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2001-07-06 16:32:40 +0000 |
commit | b32685987f0b05b642646bf613f1c9b9853ac97a (patch) | |
tree | 739e425abafaba188bcd9c1aef6f7cd683f4ce8f /libjava/testsuite/libjava.lang/Divide_1.java | |
parent | 936031411fb5b1709d8d09d06dd4a4739e1b5c6a (diff) | |
download | gcc-b32685987f0b05b642646bf613f1c9b9853ac97a.zip gcc-b32685987f0b05b642646bf613f1c9b9853ac97a.tar.gz gcc-b32685987f0b05b642646bf613f1c9b9853ac97a.tar.bz2 |
Divide_1.java: Add may more test cases.
2001-07-06 Andrew Haley <aph@cambridge.redhat.com>
* libjava.lang/Divide_1.java: Add may more test cases.
* libjava.lang/Divide_1.out: Likewise.
From-SVN: r43812
Diffstat (limited to 'libjava/testsuite/libjava.lang/Divide_1.java')
-rw-r--r-- | libjava/testsuite/libjava.lang/Divide_1.java | 104 |
1 files changed, 101 insertions, 3 deletions
diff --git a/libjava/testsuite/libjava.lang/Divide_1.java b/libjava/testsuite/libjava.lang/Divide_1.java index d4e0193..50db009 100644 --- a/libjava/testsuite/libjava.lang/Divide_1.java +++ b/libjava/testsuite/libjava.lang/Divide_1.java @@ -4,7 +4,7 @@ public class Divide_1 int b1 = Integer.parseInt ("-1"); static int zero = Integer.parseInt ("0"); - void probe () + void probe_1 () { try { int a = Integer.parseInt ("-80000000", 16); @@ -98,8 +98,106 @@ public class Divide_1 System.out.println (_); } } + + void probe_2 () + { + try { + int a = -0x80000000; + int c = a/b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = -0x80000000; + int c = a/-1; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = -0x80000000; + int c = a%b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = -0x80000000; + int c = a%b1; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = -0x80000000; + int c = a%-1; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = 0x8000; + int b = 0; + int c = a/b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = 0x8000; + int b = 0; + int c = a%b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + long a = -0x7fffffffffffffffL - 1; + long c = a/b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + long a = -0x7fffffffffffffffL - 1; + long c = a%b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + long a = 0x8000; + long b = 0; + long c = a/b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + long a = 0x8000; + long b = 0; + long c = a%b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + } - public static void main (String[] args) { - new Divide_1 ().probe (); + public static void main (String[] args) + { + Divide_1 d = new Divide_1 (); + d.probe_1 (); + d.probe_2 (); } } |