Makefile optimized

Some tests changed so they work under all compilers


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1224 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
jochen 25 years ago
parent 7628ebc073
commit 5f8d149b5e
  1. 7
      jode/test/AnonymousClass.java
  2. 2
      jode/test/AnonymousJavac.java
  3. 41
      jode/test/Makefile.am
  4. 4
      jode/test/NestedAnon.java
  5. 38
      jode/test/ResolveConflicts.java
  6. 20
      jode/test/simpletests.sh

@ -20,6 +20,8 @@
import java.util.Vector;
public class AnonymousClass {
///#ifndef JAVAC11
// javac 1.1 is tooooooo broken
class Inner {
int var = 3;
@ -40,7 +42,6 @@ public class AnonymousClass {
Hello(String info) {
System.err.println("construct: "+info);
}
///#ifndef JAVAC11
///#ifndef JAVAC12
///#ifndef JIKES0
Hello(int i) {
@ -48,7 +49,6 @@ public class AnonymousClass {
+" by a recent jikes");
}
///#endif
///#endif
///#endif
private void hello() {
this.hashCode();
@ -105,6 +105,7 @@ public class AnonymousClass {
}
}
///#ifndef JAVAC12
class Huhu extends Hello {
public Huhu(String str) {
super(str);
@ -117,6 +118,7 @@ public class AnonymousClass {
super("What's up");
}
}
///#endif
Vector v = new Vector(hi.var, new Inner("blah").var) {
public String newMethod() {
@ -198,4 +200,5 @@ public class AnonymousClass {
Hi hu = new Hi();
}
///#endif
}

@ -177,7 +177,5 @@ public class AnonymousJavac {
};
Hi hu = new Hi();
}
}

@ -1,6 +1,45 @@
JAVA = @JAVA@
JAVAC = @JAVAC@
CLASSLIB = @CLASSLIB@
JFLAGS =
TESTS_ENVIRONMENT=JAVA=$(JAVA) JAVAC=$(JAVAC) JFLAGS=$(JFLAGS) srcdir=$(srcdir) top_srcdir=$(top_srcdir) top_builddir=$(top_builddir)
TESTS_ENVIRONMENT=JAVA=$(JAVA) JAVAC=$(JAVAC) JFLAGS=$(JFLAGS) srcdir=$(srcdir) top_srcdir=$(top_srcdir) top_builddir=$(top_builddir) CLASSLIB=$(CLASSLIB)
TESTS = simpletests.sh
EXTRA_DIST = \
simpletests.sh \
AnonymousClass.java \
AnonymousJavac.java \
ArrayCloneTest.java \
ArrayTest.java \
AssignOp.java \
Base.j \
Child.j \
ClassOpTest.java \
ConstantTypes.java \
CountOpcodes.java \
EvilTypes.j \
Expressions.java \
Flow.java \
For.java \
HintTypeTest.java \
IfCombine.java \
InlineTest.java \
InlinedAnon.java \
InnerClass.java \
InnerCompat.java \
JavacBug.java \
JsrTest.j \
LocalTypes.java \
MethodScopedClass.java \
NestedAnon.java \
ObfuscateStrings.j \
OptimizeTest.java \
OptimizerTest.java \
PrivateHideTest.java \
RemovePopExample.j \
ResolveConflicts.java \
StackOps.j \
TriadicExpr.java \
TryCatch.java \
Unreach.java

@ -3,12 +3,16 @@ public class NestedAnon {
public NestedAnon(int maxdepth) {
class NestMyself {
int depth;
///#ifndef JAVAC11
NestMyself son;
///#endif
public NestMyself(int d) {
depth = d;
///#ifndef JAVAC11
if (d > 0)
son = new NestMyself(d-1);
///#endif
}
}
new NestMyself(maxdepth);

@ -32,7 +32,11 @@ public class ResolveConflicts
Conflicts Inner;
void Conflicts() {
///#ifndef JAVAC11
///#ifndef JAVAC12
Inner = ResolveConflicts.Conflicts.this;
///#endif
///#endif
}
}
@ -48,9 +52,13 @@ public class ResolveConflicts
void Inner() {
this.Inner.Inner();
ResolveConflicts.Conflicts.Inner.this.Inner.Inner();
this.Conflicts();
///#ifndef JAVAC11
///#ifndef JAVAC12
ResolveConflicts.Conflicts.Inner.this.Inner.Inner();
ResolveConflicts.Conflicts.Inner.this.Conflicts();
///#endif
///#endif
}
Blah() {
@ -67,16 +75,30 @@ public class ResolveConflicts
Conflicts();
new Object() {
void Inner() {
///#ifndef JAVAC11
///#ifndef JAVAC12
ResolveConflicts.Conflicts.this.Inner();
///#endif
///#endif
}
};
this.Conflicts = Conflicts;
Inner();
///#ifndef JAVAC11
///#ifndef JAVAC12
ResolveConflicts.Conflicts.this.Conflicts = this.Conflicts;
///#endif
///#endif
}
Conflicts Conflicts(Inner Conflicts) {
return ResolveConflicts.Conflicts.this;
///#ifndef JAVAC11
///#ifndef JAVAC12
ResolveConflicts.Conflicts Inner
= ResolveConflicts.Conflicts.this;
///#endif
///#endif
return ResolveConflicts.this.new Conflicts();
}
}
@ -90,7 +112,17 @@ public class ResolveConflicts
}
Conflicts.Inner create() {
return ResolveConflicts.Conflicts.this.new Inner();
///#ifndef JAVAC11
///#ifndef JAVAC12
ResolveConflicts.Conflicts.Inner inner
= ResolveConflicts.Conflicts.this.new Inner();
///#endif
///#endif
///#ifdef JAVAC11
return null;
///#else
return ResolveConflicts.this.new Conflicts().new Inner();
///#endif
}
Second(Conflicts.Inner Blah) {

@ -4,18 +4,22 @@ TEMP=`mktemp -d tmp.XXXXXX`
if echo $JAVAC | grep jikes >/dev/null; then
compiler=JIKES;
version=`$JAVAC 2>&1 | grep Version | \
perl -pe's/^.*Version \"?([0-9]+)\.([0-9]+).*$/\1/'`
elif echo $JAVAC | grep javac >/dev/null; then
compiler=`$JAVAC -J-version 2>&1 | grep version | \
perl -pe's/^.*version \"?([0-9]+)\.([0-9]+).*$/JAVAC\1\2/'`
compiler=JAVAC
version=`$JAVAC -J-version 2>&1 | grep version | \
perl -pe's/^.*version \"?([0-9]+)\.([0-9]+).*$/\1\2/'`
else
compiler=UNKNOWN
version=""
fi
echo "detected compiler $compiler"
error=""
EXPECT_FAIL="ResolveConflicts.java AnonymousClass.java InnerClass.java"
EXPECT_FAIL=""
for testclass in \
ArrayCloneTest.java \
@ -36,13 +40,13 @@ Unreach.java \
AnonymousClass.java \
InnerClass.java \
InnerCompat.java \
NestedAnon.java
NestedAnon.java
do
cp $srcdir/$testclass $TEMP
$top_srcdir/jcpp -D$compiler $TEMP/$testclass
$JAVAC $JFLAGS -d $TEMP $TEMP/$testclass
CLASSPATH=$top_builddir:$CLASSPATH $JAVA jode.Decompiler \
--classpath=$TEMP --dest=$TEMP ${testclass%.java} &> $testclass.log
$top_srcdir/jcpp -D$compiler -D$compiler$version $TEMP/$testclass
CLASSPATH=$CLASSPATH:$CLASSLIB $JAVAC $JFLAGS -d $TEMP $TEMP/$testclass
CLASSPATH=$CLASSPATH:$CLASSLIB $JAVA jode.Decompiler \
--classpath=$TEMP --dest=$TEMP ${testclass%.java} > $testclass.log 2>&1
if ! CLASSPATH=$TEMP:$CLASSPATH $JAVAC $JFLAGS -d $TEMP $TEMP/$testclass >> $testclass.log 2>&1 ; then
cat $TEMP/$testclass >> $testclass.log
CLASSPATH=$TEMP:$CLASSPATH javap -c ${testclass%.java} >> $testclass.log

Loading…
Cancel
Save