From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libjava/testsuite/libjava.lang/Divide_1.java | 203 +++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 libjava/testsuite/libjava.lang/Divide_1.java (limited to 'libjava/testsuite/libjava.lang/Divide_1.java') diff --git a/libjava/testsuite/libjava.lang/Divide_1.java b/libjava/testsuite/libjava.lang/Divide_1.java new file mode 100644 index 000000000..50db00935 --- /dev/null +++ b/libjava/testsuite/libjava.lang/Divide_1.java @@ -0,0 +1,203 @@ +public class Divide_1 +{ + static int b = Integer.parseInt ("-1"); + int b1 = Integer.parseInt ("-1"); + static int zero = Integer.parseInt ("0"); + + void probe_1 () + { + try { + int a = Integer.parseInt ("-80000000", 16); + int c = a/b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = Integer.parseInt ("-80000000", 16); + int c = a/-1; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = Integer.parseInt ("-80000000", 16); + int c = a%b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = Integer.parseInt ("-80000000", 16); + int c = a%b1; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = Integer.parseInt ("-80000000", 16); + int c = a%-1; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = Integer.parseInt ("8000", 16); + int b = Integer.parseInt ("0", 16); + int c = a/b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + int a = Integer.parseInt ("8000", 16); + int b = Integer.parseInt ("0", 16); + int c = a%b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + long a = Long.parseLong ("-8000000000000000", 16); + long c = a/b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + long a = Long.parseLong ("-8000000000000000", 16); + long c = a%b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + long a = Long.parseLong ("8000", 16); + long b = Long.parseLong ("0", 16); + long c = a/b; + System.out.println (c); + } catch (Exception _) { + System.out.println (_); + } + + try { + long a = Long.parseLong ("8000", 16); + long b = Long.parseLong ("0", 16); + long c = a%b; + System.out.println (c); + } catch (Exception _) { + 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) + { + Divide_1 d = new Divide_1 (); + d.probe_1 (); + d.probe_2 (); + } +} -- cgit v1.2.3