Exemple #1
0
    public static unsafe int test_0_ldobj_stobj()
    {
        byte *dest = stackalloc byte [20];
        byte *src  = stackalloc byte [20];

        for (int i = 0; i < 20; ++i)
        {
            src [i] = (byte)i;
        }

        Intrinsics.UnalignedLdobjStObjPair <short> (dest + 0, src + 0);
        if (dest [0] != src [0] || dest [1] != src [1])
        {
            return(1);
        }

        Intrinsics.UnalignedLdobjStObjPair <short> (dest + 1, src + 0);
        if (dest [1] != src [0] || dest [2] != src [1])
        {
            return(2);
        }

        Intrinsics.UnalignedLdobjStObjPair <short> (dest + 0, src + 1);
        if (dest [0] != src [1] || dest [1] != src [2])
        {
            return(3);
        }

        Intrinsics.UnalignedLdobjStObjPair <short> (dest + 1, src + 1);
        if (dest [1] != src [1] || dest [2] != src [2])
        {
            return(3);
        }

        Intrinsics.UnalignedLdobjStObjPair <int> (dest + 1, src + 1);
        if (dest [1] != src [1] || dest [2] != src [2])
        {
            return(4);
        }

        Intrinsics.UnalignedLdobjStObjPair <long> (dest + 1, src + 1);
        if (dest [1] != src [1] || dest [2] != src [2])
        {
            return(5);
        }


        return(0);
    }