Patch: default to -mieee on alpha
Jeff Sturm
jsturm@one-point.com
Mon Feb 17 16:06:00 GMT 2003
On 11 Feb 2003, Tom Tromey wrote:
> Jeff> BTW is this example OK for the testsuite? In libjava.lang?
>
> Sure. Could you add a comment at the top explaining what the test is
> for? Recently I've come to realize that such comments would be pretty
> useful to have...
Here's what I'm committing to HEAD.
2003-02-16 Jeff Sturm <jsturm@one-point.com>
* libjava.lang/CompareNaN.java: New test.
* libjava.lang/CompareNaN.out: New test.
Index: libjava.lang/CompareNaN.java
===================================================================
RCS file: libjava.lang/CompareNaN.java
diff -N libjava.lang/CompareNaN.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libjava.lang/CompareNaN.java 17 Feb 2003 15:51:12 -0000
@@ -0,0 +1,15 @@
+/*
+ * JLS 4.2.3 specifies that (x op y) must be false if either x or y
+ * is NaN and op is one of <, >, <=, >=, or ==.
+ *
+ * Some targets may need specific options wired into libgcj.spec
+ * to pass this test. For example, alpha-linux requires -mieee
+ * to prevent an unrecoverable fp trap.
+ */
+
+public class CompareNaN {
+ public static void main(String[] args) {
+ double x = Double.NaN;
+ System.out.println(x == x);
+ }
+}
Index: libjava.lang/CompareNaN.out
===================================================================
RCS file: libjava.lang/CompareNaN.out
diff -N libjava.lang/CompareNaN.out
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libjava.lang/CompareNaN.out 17 Feb 2003 15:51:12 -0000
@@ -0,0 +1 @@
+false
More information about the Java-patches
mailing list