This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PR 5902: Parse errors
Tom Tromey wrote:
>
> Eric> 2002-03-11 Eric Blake <ebb9@email.byu.edu>
> Eric> * libjava.compile/PR5902.java: New file.
>
> This is failing, due to a weirdness in the test suite.
> `gcj -C' generates dead code, and then `gcj' complains about that.
> dejagnu interprets any complaint, even a warning, as a failure.
> Bleah.
>
> I think we can work around this by changing the test so that there is
> no dead code.
Then there is a bug in gcj -C. The expression ((019f == 19) ? 0 : 1) is
a compile-time constant, and should be inlined to 0. I don't see where
any dead code could feasably arise.
>
> However, looking at it makes me wonder: shouldn't this be an execute
> test? If so, it is in the wrong directory. It needs to be in
> libjava.lang. Programs in libjava.compile are compiled (and linked
> unless told otherwise), but not executed.
I think a compiler test is adequate - the PR was not that the compiler
was using the wrong value, but that it wasn't even parsing the
original. Is the patch below appropriate?
>
> Also, ChangeLog entries referencing a PR should say so:
>
> For PR java/5902:
> * libjava.compile/PR5902.java: New file.
>
OK, I'll fix my previous ChangeLog entries when I commit the new
versions.
--
This signature intentionally left boring.
Eric Blake ebb9@email.byu.edu
BYU student, free software programmer
2002-03-15 Eric Blake <ebb9@email.byu.edu>
For PR java/5902:
* libjava.compile/PR5902.java: Does not need to execute.
For PR java/5913:
* libjava.compile/PR5913.java: Ditto.
Index: libjava.compile//PR5902.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.compile/PR5902.java,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 PR5902.java
--- PR5902.java 2002/03/12 07:20:42 1.1.2.1
+++ PR5902.java 2002/03/15 17:32:23
@@ -1,7 +1,4 @@
class PR5902
{
- public static void main(String[] args)
- {
- System.exit((019f == 19) ? 0 : 1);
- }
+ double d = 019f;
}
Index: libjava.compile//PR5913.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.compile/PR5913.java,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 PR5913.java
--- PR5913.java 2002/03/12 07:42:34 1.1.2.2
+++ PR5913.java 2002/03/15 17:32:23
@@ -1,10 +1,6 @@
class PR5913
{
- public static void main(String[] args)
- {
- boolean test1 = ("" + 1) instanceof String;
- // This also tests literal parsing, as mentioned in PR 5902.
- boolean test2 = "" + 0x1instanceof String;
- System.exit((test1 && test2) ? 0 : 1);
- }
+ boolean test1 = ("" + 1) instanceof String;
+ // This also tests literal parsing, as mentioned in PR 5902.
+ boolean test2 = "" + 0x1instanceof String;
}