diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-06 16:32:40 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-06 16:32:40 +0000 |
commit | e773c4476038acfe16dc975ff17ed09489bb5498 (patch) | |
tree | 739e425abafaba188bcd9c1aef6f7cd683f4ce8f /libjava/testsuite/libjava.lang/Divide_1.java | |
parent | 42677d649f5eb8d9135fc078a793008c36d9aedd (diff) | |
download | ppe42-gcc-e773c4476038acfe16dc975ff17ed09489bb5498.tar.gz ppe42-gcc-e773c4476038acfe16dc975ff17ed09489bb5498.zip |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43812 138bc75d-0d04-0410-961f-82ee72b054a4
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 d4e01939aa5..50db00935ba 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 (); } } |