[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: cscctest/csharp/stmt foreach5.cs,NONE,1.1 for
From: |
Gopal.V <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: cscctest/csharp/stmt foreach5.cs,NONE,1.1 foreach5.il,NONE,1.1 foreach5.jl,NONE,1.1 Makefile.am,1.11,1.12 |
Date: |
Wed, 13 Nov 2002 15:51:12 -0500 |
Update of /cvsroot/dotgnu-pnet/cscctest/csharp/stmt
In directory subversions:/tmp/cvs-serv31647/csharp/stmt
Modified Files:
Makefile.am
Added Files:
foreach5.cs foreach5.il foreach5.jl
Log Message:
tests for foreach on structs
--- NEW FILE ---
/*
* foreach4.cs - Test the handling of "foreach" statements for Collections.
*
* Copyright (C) 2002 Southern Storm Software, Pty Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
namespace System.Collections
{
public interface IEnumerator
{
bool MoveNext();
void Reset();
Object Current { get; }
}
public interface IEnumerable
{
IEnumerator GetEnumerator();
}
}
using System.Collections;
class TestEnumerator: IEnumerator
{
bool IEnumerator.MoveNext()
{
return false;
}
public bool MoveNext()
{
return false;
}
void IEnumerator.Reset()
{
}
public void Reset()
{
}
Object IEnumerator.Current
{
get
{
return 0;
}
}
public byte Current
{
get
{
return 0;
}
}
}
struct TestEnumerable: IEnumerable
{
IEnumerator IEnumerable.GetEnumerator()
{
return null;
}
public TestEnumerator GetEnumerator()
{
return null;
}
}
class Test
{
int m1(TestEnumerable en)
{
String y="";
foreach(char x in en)
{
y=y+x;
}
return 0;
}
}
--- NEW FILE ---
.assembly extern '.library'
{
.ver 0:0:0:0
}
.assembly '<Assembly>'
{
.ver 0:0:0:0
}
.module '<Module>'
.namespace 'System.Collections'
{
.class public auto interface abstract ansi 'IEnumerator'
{
.method public virtual hidebysig newslot abstract instance bool 'MoveNext'()
cil managed
{
} // method MoveNext
.method public virtual hidebysig newslot abstract instance void 'Reset'() cil
managed
{
} // method Reset
.method public virtual hidebysig newslot abstract specialname instance class
['.library']'System'.'Object' 'get_Current'() cil managed
{
} // method get_Current
.property instance class ['.library']'System'.'Object' 'Current'()
{
.get instance class ['.library']'System'.'Object'
'System.Collections'.'IEnumerator'::'get_Current'()
} // property Current
} // class IEnumerator
} // namespace System.Collections
.namespace 'System.Collections'
{
.class public auto interface abstract ansi 'IEnumerable'
{
.method public virtual hidebysig newslot abstract instance class
'System.Collections'.'IEnumerator' 'GetEnumerator'() cil managed
{
} // method GetEnumerator
} // class IEnumerable
} // namespace System.Collections
.class private auto ansi 'TestEnumerator' extends ['.library']'System'.'Object'
implements 'System.Collections'.'IEnumerator'
{
.method private final virtual hidebysig newslot instance bool
'IEnumerator.MoveNext'() cil managed
{
.override 'System.Collections'.'IEnumerator'::'MoveNext'
ldc.i4.0
ret
.maxstack 1
} // method IEnumerator.MoveNext
.method public virtual hidebysig newslot instance bool 'MoveNext'() cil managed
{
ldc.i4.0
ret
.maxstack 1
} // method MoveNext
.method private final virtual hidebysig newslot instance void
'IEnumerator.Reset'() cil managed
{
.override 'System.Collections'.'IEnumerator'::'Reset'
ret
.maxstack 0
} // method IEnumerator.Reset
.method public virtual hidebysig newslot instance void 'Reset'() cil managed
{
ret
.maxstack 0
} // method Reset
.method private final virtual hidebysig newslot specialname instance class
['.library']'System'.'Object' 'IEnumerator.get_Current'() cil managed
{
.override 'System.Collections'.'IEnumerator'::'get_Current'
ldc.i4.0
box ['.library']'System'.'Int32'
ret
.maxstack 1
} // method IEnumerator.get_Current
.property instance class ['.library']'System'.'Object' 'IEnumerator.Current'()
{
.get instance class ['.library']'System'.'Object'
'TestEnumerator'::'IEnumerator.get_Current'()
} // property IEnumerator.Current
.method public hidebysig specialname instance unsigned int8 'get_Current'() cil
managed
{
ldc.i4.0
conv.u1
ret
.maxstack 1
} // method get_Current
.property instance unsigned int8 'Current'()
{
.get instance unsigned int8 'TestEnumerator'::'get_Current'()
} // property Current
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil
managed
{
ldarg.0
call instance void ['.library']'System'.'Object'::'.ctor'()
ret
.maxstack 1
} // method .ctor
} // class TestEnumerator
.class private sequential value sealed serializable ansi 'TestEnumerable'
extends ['.library']'System'.'ValueType' implements
'System.Collections'.'IEnumerable'
{
.method private final virtual hidebysig newslot instance class
'System.Collections'.'IEnumerator' 'IEnumerable.GetEnumerator'() cil managed
{
.override 'System.Collections'.'IEnumerable'::'GetEnumerator'
ldnull
ret
.maxstack 1
} // method IEnumerable.GetEnumerator
.method public hidebysig instance class 'TestEnumerator' 'GetEnumerator'() cil
managed
{
ldnull
ret
.maxstack 1
} // method GetEnumerator
} // class TestEnumerable
.class private auto ansi 'Test' extends ['.library']'System'.'Object'
{
.method private hidebysig instance int32 'm1'(valuetype 'TestEnumerable' 'en')
cil managed
{
.locals (class ['.library']'System'.'String', char)
ldstr ""
stloc.0
.locals (class 'TestEnumerator')
.locals (class ['.library']'System'.'IDisposable')
ldarga.s 1
call instance class 'TestEnumerator'
'TestEnumerable'::'GetEnumerator'()
stloc.2
.try {
br ?L1
?L2:
ldloc.2
call instance unsigned int8 'TestEnumerator'::'get_Current'()
stloc.1
ldloc.0
ldloc.1
call class [.library]System.String
[.library]System.Char::ToString(char)
call class [.library]System.String
[.library]System.String::Concat(class [.library]System.String, class
[.library]System.String)
stloc.0
?L1:
ldloc.2
callvirt instance bool 'TestEnumerator'::'MoveNext'()
brtrue ?L2
?L3:
leave ?L4
}
finally {
ldloc.2
isinst [.library]System.IDisposable
stloc.3
ldloc.3
brfalse ?L5
ldloc.3
callvirt instance void [.library]System.IDisposable::Dispose()
?L5:
endfinally
}
?L4:
ldc.i4.0
ret
.maxstack 2
} // method m1
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil
managed
{
ldarg.0
call instance void ['.library']'System'.'Object'::'.ctor'()
ret
.maxstack 1
} // method .ctor
} // class Test
--- NEW FILE ---
.assembly extern '.library'
{
.ver 0:0:0:0
}
.assembly '<Assembly>'
{
.ver 0:0:0:0
}
.module '<Module>'
.namespace 'System.Collections'
{
.class public auto interface abstract ansi 'IEnumerator'
{
.method public virtual hidebysig newslot abstract instance bool 'MoveNext'()
cil managed java
{
} // method MoveNext
.method public virtual hidebysig newslot abstract instance void 'Reset'() cil
managed java
{
} // method Reset
.method public virtual hidebysig newslot abstract specialname instance class
['.library']'System'.'Object' 'get_Current'() cil managed java
{
} // method get_Current
.property instance class ['.library']'System'.'Object' 'Current'()
{
.get instance class ['.library']'System'.'Object'
'System.Collections'.'IEnumerator'::'get_Current'()
} // property Current
} // class IEnumerator
} // namespace System.Collections
.namespace 'System.Collections'
{
.class public auto interface abstract ansi 'IEnumerable'
{
.method public virtual hidebysig newslot abstract instance class
'System.Collections'.'IEnumerator' 'GetEnumerator'() cil managed java
{
} // method GetEnumerator
} // class IEnumerable
} // namespace System.Collections
.class private auto ansi 'TestEnumerator' extends ['.library']'System'.'Object'
implements 'System.Collections'.'IEnumerator'
{
.method private final virtual hidebysig newslot instance bool
'IEnumerator.MoveNext'() cil managed java
{
.override 'System.Collections'.'IEnumerator'::'MoveNext'
iconst_0
ireturn
.locals 1
.maxstack 1
} // method IEnumerator.MoveNext
.method public virtual hidebysig newslot instance bool 'MoveNext'() cil managed
java
{
iconst_0
ireturn
.locals 1
.maxstack 1
} // method MoveNext
.method private final virtual hidebysig newslot instance void
'IEnumerator.Reset'() cil managed java
{
.override 'System.Collections'.'IEnumerator'::'Reset'
return
.locals 1
.maxstack 0
} // method IEnumerator.Reset
.method public virtual hidebysig newslot instance void 'Reset'() cil managed
java
{
return
.locals 1
.maxstack 0
} // method Reset
.method private final virtual hidebysig newslot specialname instance class
['.library']'System'.'Object' 'IEnumerator.get_Current'() cil managed java
{
.override 'System.Collections'.'IEnumerator'::'get_Current'
iconst_0
invokestatic "System/Int32" "copyIn__" "(I)LSystem/Int32;"
areturn
.locals 1
.maxstack 1
} // method IEnumerator.get_Current
.property instance class ['.library']'System'.'Object' 'IEnumerator.Current'()
{
.get instance class ['.library']'System'.'Object'
'TestEnumerator'::'IEnumerator.get_Current'()
} // property IEnumerator.Current
.method public hidebysig specialname instance unsigned int8 'get_Current'() cil
managed java
{
iconst_0
sipush 255
iand
ireturn
.locals 1
.maxstack 2
} // method get_Current
.property instance unsigned int8 'Current'()
{
.get instance unsigned int8 'TestEnumerator'::'get_Current'()
} // property Current
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil
managed java
{
aload_0
invokespecial instance void ['.library']'System'.'Object'::'.ctor'()
return
.locals 1
.maxstack 1
} // method .ctor
} // class TestEnumerator
.class private sequential value sealed serializable ansi 'TestEnumerable'
extends ['.library']'System'.'ValueType' implements
'System.Collections'.'IEnumerable'
{
.method private final virtual hidebysig newslot instance class
'System.Collections'.'IEnumerator' 'IEnumerable.GetEnumerator'() cil managed
java
{
.override 'System.Collections'.'IEnumerable'::'GetEnumerator'
aconst_null
areturn
.locals 1
.maxstack 1
} // method IEnumerable.GetEnumerator
.method public hidebysig instance class 'TestEnumerator' 'GetEnumerator'() cil
managed java
{
aconst_null
areturn
.locals 1
.maxstack 1
} // method GetEnumerator
} // class TestEnumerable
.class private auto ansi 'Test' extends ['.library']'System'.'Object'
{
.method private hidebysig instance int32 'm1'(valuetype 'TestEnumerable' 'en')
cil managed java
{
ldc ""
invokestatic "System/String" "__FromJavaString"
"(Ljava/lang/String;)LSystem/String;"
astore_2
aload_1
pop
aconst_null
invokespecial instance class 'TestEnumerator'
'TestEnumerable'::'GetEnumerator'()
astore 4
.try {
goto ?L1
aload 4
invokespecial instance unsigned int8 'TestEnumerator'::'get_Current'()
istore_3
aload_2
iload_3
invokestatic "System/Char" "ToString" "(C)LSystem/String;"
invokestatic "System/String" "Concat"
"(LSystem/String;LSystem/String;)LSystem/String;"
astore_2
?L1:
aload 4
invokevirtual instance bool 'TestEnumerator'::'MoveNext'()
ifne ?L2
?L3:
jsr ?L4
goto ?L5
}
catch {
astore 5
jsr ?L4
aload 5
athrow
}
finally {
astore 6
aload 4
ifeq ?L6
aload 4
invokeinterface "System/IDisposable" "Dispose" "()V" 1
?L6:
ret 6
}
?L5:
iconst_0
ireturn
.locals 7
.maxstack 2
} // method m1
.method public hidebysig specialname rtspecialname instance void '.ctor'() cil
managed java
{
aload_0
invokespecial instance void ['.library']'System'.'Object'::'.ctor'()
return
.locals 1
.maxstack 1
} // method .ctor
} // class Test
Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/cscctest/csharp/stmt/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** Makefile.am 20 Oct 2002 20:50:12 -0000 1.11
--- Makefile.am 13 Nov 2002 20:51:10 -0000 1.12
***************
*** 6,9 ****
--- 6,10 ----
foreach3.cs \
foreach4.cs \
+ foreach5.cs \
locals1.cs \
locals2.cs \
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: cscctest/csharp/stmt foreach5.cs,NONE,1.1 foreach5.il,NONE,1.1 foreach5.jl,NONE,1.1 Makefile.am,1.11,1.12,
Gopal.V <address@hidden> <=