summaryrefslogtreecommitdiff
path: root/tests/src/Loader/classloader/regressions/421439/Test.il
blob: 93c0c6f3790989a7fc2ad95edd733ab1b9efb32f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

.assembly extern System.Console { }
.assembly extern mscorlib {}
.assembly extern RefX1 {}
.assembly extern ValX1 {}

.assembly Test {}

.class public sequential ansi sealed beforefieldinit Gen<T>
       extends [mscorlib]System.ValueType
{
  .field public !T Fld1
  .method public hidebysig specialname rtspecialname 
          instance void  .ctor(!T fld1) cil managed
  {
    .maxstack  8
    nop
    ldarg.0
    ldarg.1
    stfld      !0 valuetype Gen<!T>::Fld1
    ret
  } 
}


// the below lines cause an AV
// new Gen<ValX1<string>[][][]>(new ValX1<string>[1][][]);
// new Gen<RefX1<RefX1<RefX1<string>>>>(new RefX1<RefX1<RefX1<string>>>());

.class public auto ansi beforefieldinit Test
       extends [mscorlib]System.Object
{
  .method public hidebysig static int32 Main() cil managed
  {
    .entrypoint
    .maxstack  8
    nop
    ldc.i4.1
    newarr     valuetype [ValX1]ValX1<string>[][]
    newobj     instance void valuetype Gen<valuetype [ValX1]ValX1<string>[][][]>::.ctor(!0)
    pop
    newobj     instance void class [RefX1]RefX1<class [RefX1]RefX1<class [RefX1]RefX1<string>>>::.ctor()
    newobj     instance void valuetype Gen<class [RefX1]RefX1<class [RefX1]RefX1<class [RefX1]RefX1<string>>>>::.ctor(!0)
    pop

    ldstr      "PASS"
    call       void [System.Console]System.Console::WriteLine(string)

    ldc.i4 100
    ret
  } 

  .method public hidebysig specialname rtspecialname 
          instance void  .ctor() cil managed
  {
    .maxstack  8
    ldarg.0
    call       instance void [mscorlib]System.Object::.ctor()
    ret
  }

}