summaryrefslogtreecommitdiffstats
path: root/libjava/testsuite/libjava.lang/Divide_1.java
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-20 08:26:55 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-20 08:26:55 +0000
commita5b1e8ad34500f24632c0dbcaa4c0788c0a48d06 (patch)
treec773f8d236cca5c8caaa0578e6211289e6fc850a /libjava/testsuite/libjava.lang/Divide_1.java
parent8f68d3b43cb2436a1faf8f5cf35b20ea3584d65a (diff)
downloadppe42-gcc-a5b1e8ad34500f24632c0dbcaa4c0788c0a48d06.tar.gz
ppe42-gcc-a5b1e8ad34500f24632c0dbcaa4c0788c0a48d06.zip
1999-05-20 Andrew Haley <aph@cygnus.com>
* libjava/prims.cc (catch_fpe): Call to HANDLE_DIVIDE_OVERFLOW added. * include/i386-signal.h (HANDLE_DIVIDE_OVERFLOW): New macro. (INIT_FPE): Exception string made more informative. * include/sparc-signal.h (INIT_FPE): Exception string made more informative. * testsuite/libjava.lang/Divide_1.java: New file. * testsuite/libjava.lang/Divide_1.out: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27056 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/testsuite/libjava.lang/Divide_1.java')
-rw-r--r--libjava/testsuite/libjava.lang/Divide_1.java105
1 files changed, 105 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 ();
+ }
+}
OpenPOWER on IntegriCloud