dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: cscctest/csharp/expr pointer1.cs,NONE,1.1 poi


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: cscctest/csharp/expr pointer1.cs,NONE,1.1 pointer1.err,NONE,1.1 pointer1.il,NONE,1.1 pointer1.jerr,NONE,1.1 pointer2.cs,NONE,1.1 pointer2.err,NONE,1.1 pointer2.jerr,NONE,1.1 Makefile.am,1.23,1.24
Date: Wed, 26 Feb 2003 06:43:31 -0500

Update of /cvsroot/dotgnu-pnet/cscctest/csharp/expr
In directory subversions:/tmp/cvs-serv1324/csharp/expr

Modified Files:
        Makefile.am 
Added Files:
        pointer1.cs pointer1.err pointer1.il pointer1.jerr pointer2.cs 
        pointer2.err pointer2.jerr 
Log Message:


Add test cases for pointer coercions.


--- NEW FILE ---
/*
 * pointer1.cs - Test valid pointer coercions.
 *
 * Copyright (C) 2003  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
 */

unsafe class Test
{
        public void t1(void *x)
        {
        }
        public void t2(int *y)
        {
                t1(y);
                t1(null);
        }
        public void t2(char *y)
        {
                t2((int *)y);
                t2((int *)3);
                t2((int *)7UL);
        }
}

--- NEW FILE ---
./pointer1.cs:21: warning: unsafe class declaration

--- NEW FILE ---
.assembly extern '.library'
{
        .ver 0:0:0:0
}
.assembly '<Assembly>'
{
        .ver 0:0:0:0
        .custom instance void 
[.library]System.Security.Permissions.SecurityPermissionAttribute::.ctor(valuetype
 [.library]System.Security.Permissions.SecurityAction) =
                (01 00 08 00 00 00 01 00 54 02 10 53 6B 69 70 56
                 65 72 69 66 69 63 61 74 69 6F 6E 01)
}
.module '<Module>'
.custom instance void 
[.library]System.Security.UnverifiableCodeAttribute::.ctor() = (01 00 00 00)
.class private auto ansi /* unknown_bits: 0x4000000 */ 'Test' extends 
['.library']'System'.'Object'
{
.method public hidebysig instance void 't1'(void * 'x') cil managed 
{
        ret
        .maxstack 0
} // method t1
.method public hidebysig instance void 't2'(int32 * 'y') cil managed 
{
        ldarg.0
        ldarg.1
        callvirt        instance void 'Test'::'t1'(void *)
        ldarg.0
        ldc.i4.0
        conv.i
        callvirt        instance void 'Test'::'t1'(void *)
        ret
        .maxstack 2
} // method t2
.method public hidebysig instance void 't2'(char * 'y') cil managed 
{
        ldarg.0
        ldarg.1
        callvirt        instance void 'Test'::'t2'(int32 *)
        ldarg.0
        ldc.i4.3
        conv.i
        callvirt        instance void 'Test'::'t2'(int32 *)
        ldarg.0
        ldc.i4.7
        conv.u8
        conv.u
        callvirt        instance void 'Test'::'t2'(int32 *)
        ret
        .maxstack 2
} // method t2
.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 ---
./pointer1.cs:21: unsafe class declaration not permitted with Java output

--- NEW FILE ---
/*
 * pointer2.cs - Test invalid pointer coercions.
 *
 * Copyright (C) 2003  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
 */

unsafe class Test
{
        public void t1(int *x)
        {
        }
        public void t2(void *y)
        {
                t1(y);
        }
        public void t3(void *y)
        {
                int *x = y;
                t2((void *)2.0);
        }
}

--- NEW FILE ---
./pointer2.cs:21: warning: unsafe class declaration
./pointer2.cs:28: no matching method for call to `t1(void *)'
./pointer2.cs:32: incompatible types in assignment: no conversion from `void *' 
to `int *'
./pointer2.cs:33: cannot cast from `double' to `void *'

--- NEW FILE ---
./pointer2.cs:21: unsafe class declaration not permitted with Java output
./pointer2.cs:28: no matching method for call to `t1(void *)'
./pointer2.cs:32: incompatible types in assignment: no conversion from `void *' 
to `int *'
./pointer2.cs:33: cannot cast from `double' to `void *'

Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/cscctest/csharp/expr/Makefile.am,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** Makefile.am 29 Nov 2002 22:00:04 -0000      1.23
--- Makefile.am 26 Feb 2003 11:43:28 -0000      1.24
***************
*** 41,44 ****
--- 41,46 ----
                newarray3.cs \
                newarray4.cs \
+               pointer1.cs \
+               pointer2.cs \
                ref1.cs \
                ref2.cs \





reply via email to

[Prev in Thread] Current Thread [Next in Thread]