summaryrefslogtreecommitdiffstats
path: root/libjava/testsuite/libjava.lang
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/testsuite/libjava.lang')
-rw-r--r--libjava/testsuite/libjava.lang/Divide_1.java105
-rw-r--r--libjava/testsuite/libjava.lang/Divide_1.out11
2 files changed, 116 insertions, 0 deletions
diff --git a/libjava/testsuite/libjava.lang/Divide_1.java b/libjava/testsuite/libjava.lang/Divide_1.java
new file mode 100644
index 00000000000..d4e01939aa5
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Divide_1.java
@@ -0,0 +1,105 @@
+public class Divide_1
+{
+ static int b = Integer.parseInt ("-1");
+ int b1 = Integer.parseInt ("-1");
+ static int zero = Integer.parseInt ("0");
+
+ void probe ()
+ {
+ 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 (_);
+ }
+ }
+
+ public static void main (String[] args) {
+ new Divide_1 ().probe ();
+ }
+}
diff --git a/libjava/testsuite/libjava.lang/Divide_1.out b/libjava/testsuite/libjava.lang/Divide_1.out
new file mode 100644
index 00000000000..6e1f87ed4fc
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/Divide_1.out
@@ -0,0 +1,11 @@
+-2147483648
+-2147483648
+0
+0
+0
+java.lang.ArithmeticException: / by zero
+java.lang.ArithmeticException: / by zero
+-9223372036854775808
+0
+java.lang.ArithmeticException: / by zero
+java.lang.ArithmeticException: / by zero
OpenPOWER on IntegriCloud