-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,29 +86,33 @@ struct SomeGenStruct<T> | |
public T o; | ||
public int i; | ||
public long l; | ||
public long l1; | ||
} | ||
|
||
public class GenericType<T> | ||
{ | ||
public static void test() | ||
{ | ||
int[] lengths = {1,2,3}; | ||
int[] lengths = {42,2,3}; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
VSadov
Author
Member
|
||
SomeGenStruct<T>[,,] array = (SomeGenStruct<T>[,,])Array.CreateInstance(typeof(SomeGenStruct<T>), lengths); | ||
|
||
array[0,0,0].o = default(T); | ||
array[0,0,0].i = GetIntPtrOnHeapAsInt(); | ||
array[0,0,0].l = GetIntPtrOnHeapAsInt(); | ||
for (int i = 0; i < 42; i++) | ||
{ | ||
array[i,0,0].o = default(T); | ||
array[i,0,0].i = GetIntPtrOnHeapAsInt(); | ||
array[i,0,0].l = GetIntPtrOnHeapAsInt(); | ||
|
||
array[0,1,2].o = default(T); | ||
array[0,1,2].i = GetIntPtrOnHeapAsInt(); | ||
array[0,1,2].l = GetIntPtrOnHeapAsLong(); | ||
array[i,1,2].o = default(T); | ||
array[i,1,2].i = GetIntPtrOnHeapAsInt(); | ||
array[i,1,2].l = GetIntPtrOnHeapAsLong(); | ||
|
||
array[0,1,1].o = default(T); | ||
array[0,1,1].i = GetIntPtrOnHeapAsInt(); | ||
array[0,1,1].l = GetIntPtrOnHeapAsLong(); | ||
array[i,1,1].o = default(T); | ||
array[i,1,1].i = GetIntPtrOnHeapAsInt(); | ||
array[i,1,1].l = GetIntPtrOnHeapAsLong(); | ||
} | ||
|
||
GC.Collect(); | ||
|
||
GC.KeepAlive(array); | ||
|
||
RuntimeTypeHandle arrayTypeHandle = array.GetType().TypeHandle; | ||
|
Can you copy-paste the existing test instead? I cannot reason whether we're losing test coverage to what bug 282745 was about and it's hard to dig for these in the internal databases.