summaryrefslogtreecommitdiff
path: root/tests/src/Loader/classloader/regressions/dev10_788724/dev10_788724.il
blob: b2df9c7e02817cd339e45606f63c6270006753e7 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// 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 Generated0 {}
.module Generated0.exe

.class public sequential sealed MyStruct0 extends [mscorlib]System.ValueType
{
	.pack 0
	.size 1
	.method public hidebysig virtual instance bool Equals(object obj) cil managed { ldc.i4.0 ret }
	.method public hidebysig virtual instance int32 GetHashCode() cil managed { ldc.i4.0 ret }
	.method public hidebysig virtual instance string ToString() cil managed { ldstr "ToString()" ret }
}
.class public sequential sealed MyStruct1`1<T0> extends [mscorlib]System.ValueType
{
	.pack 0
	.size 1
	.method public hidebysig virtual instance bool Equals(object obj) cil managed { ldc.i4.0 ret }
	.method public hidebysig virtual instance int32 GetHashCode() cil managed { ldc.i4.0 ret }
	.method public hidebysig virtual instance string ToString() cil managed { ldstr "ToString()" ret }
}
.class private auto ansi beforefieldinit Framework {
	.method public hidebysig static void StructCallvirtVerificationTest() cil managed
	{
		.maxstack  10
		ldstr "========================== Struct Callvirt Verification Test =========================="
		call void [System.Console]System.Console::WriteLine(string)
		
		//Testing with a non-generic struct:
		.locals init (valuetype MyStruct0 V_1)
		ldloca V_1
		initobj valuetype MyStruct0
		.try { 
			ldloca V_1 
			ldnull 
			callvirt instance bool valuetype MyStruct0::Equals(object obj) 
			call void [System.Console]System.Console::WriteLine(bool) 
			leave.s LV6
		} catch [mscorlib]System.Security.VerificationException {
			pop
			ldstr "VerificationException1"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV6
		} LV6:
		.try { 
			ldloca V_1 
			callvirt 
			instance int32 valuetype MyStruct0::GetHashCode() 
			call void [System.Console]System.Console::WriteLine(int32) 
			leave.s LV7
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException2"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV7
		} LV7:
		.try { 
			ldloca V_1 
			callvirt instance string valuetype MyStruct0::ToString() 
			call void [System.Console]System.Console::WriteLine(string) 
			leave.s LV8
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException3"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV8
		} LV8:
		.try { 
			ldloca V_1 
			ldnull 
			constrained. valuetype MyStruct0 
			callvirt instance bool valuetype MyStruct0::Equals(object) 
			call void [System.Console]System.Console::WriteLine(bool) 
			leave.s LV9
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException4"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV9
		} LV9:
		.try { 
			ldloca V_1 
			constrained. valuetype MyStruct0 
			callvirt instance int32 valuetype MyStruct0::GetHashCode() 
			call void [System.Console]System.Console::WriteLine(int32) 
			leave.s LV10
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException5"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV10
		} LV10:
		.try { 
			ldloca V_1 
			constrained. valuetype MyStruct0 
			callvirt instance string valuetype MyStruct0::ToString() 
			call void [System.Console]System.Console::WriteLine(string) 
			leave.s LV11
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException6"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV11
		} LV11:
		
		//Testing with a generic struct:
		.locals init (valuetype MyStruct1`1<string> V_2)
		ldloca V_2
		initobj valuetype MyStruct1`1<string>
		.try { 
			ldloca V_2 
			ldnull 
			callvirt instance bool valuetype MyStruct1`1<string>::Equals(object obj) 
			call void [System.Console]System.Console::WriteLine(bool) 
			leave.s LV14
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException7"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV14
		} LV14:
		.try { 
			ldloca V_2 
			callvirt instance int32 valuetype MyStruct1`1<string>::GetHashCode() 
			call void [System.Console]System.Console::WriteLine(int32) 
			leave.s LV15
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException8"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV15
		} LV15:
		.try { 
			ldloca V_2 
			callvirt instance string valuetype MyStruct1`1<string>::ToString() 
			call void [System.Console]System.Console::WriteLine(string) 
			leave.s LV16
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException9"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV16
		} LV16:
		.try { 
			ldloca V_2 
			ldnull 
			constrained. valuetype MyStruct1`1<string> 
			callvirt instance bool valuetype MyStruct1`1<string>::Equals(object) 
			call void [System.Console]System.Console::WriteLine(bool) 
			leave.s LV17
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException10"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV17
		} LV17:
		.try { 
			ldloca V_2 
			constrained. valuetype MyStruct1`1<string> 
			callvirt instance int32 valuetype MyStruct1`1<string>::GetHashCode() 
			call void [System.Console]System.Console::WriteLine(int32) 
			leave.s LV18
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException11"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV18
		} LV18:
		.try { 
			ldloca V_2 
			constrained. valuetype MyStruct1`1<string> 
			callvirt instance string valuetype MyStruct1`1<string>::ToString() 
			call void [System.Console]System.Console::WriteLine(string) 
			leave.s LV19
		} catch [mscorlib]System.Security.VerificationException { 
			pop
			ldstr "VerificationException12"
			call void [System.Console]System.Console::WriteLine(string)
			leave.s LV19
		} LV19:

		ldstr "=======================================================================================\n\n"
		call void [System.Console]System.Console::WriteLine(string)
		ret
	}
	.method public hidebysig static int32  Main() cil managed
	{
		.entrypoint
		.maxstack  10
		
		call void Framework::StructCallvirtVerificationTest()
		
		ldc.i4 100
		ret
	}
}