repo_name
stringclasses
6 values
pr_number
int64
512
78.9k
pr_title
stringlengths
3
144
pr_description
stringlengths
0
30.3k
author
stringlengths
2
21
date_created
timestamp[ns, tz=UTC]
date_merged
timestamp[ns, tz=UTC]
previous_commit
stringlengths
40
40
pr_commit
stringlengths
40
40
query
stringlengths
17
30.4k
filepath
stringlengths
9
210
before_content
stringlengths
0
112M
after_content
stringlengths
0
112M
label
int64
-1
1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/mono/mono/tests/verifier/make_type_visibility_test.sh
#! /bin/sh SED="sed" if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi TEST_NAME=$1 TEST_VALIDITY=$2 TEST_OP=$3 TEST_INIT=$4 TEST_EXTRA_LOC=$5 if [ -n "$TEST_EXTRA_LOC" ]; then EXTRA_LOC=", $TEST_EXTRA_LOC V_1" fi TEST_NAME=${TEST_VALIDITY}_${TEST_NAME} TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE TEST_TYPE=`echo $TEST_TYPE | $SED -s 's/&/\\\&/'` $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/INIT/${TEST_INIT}/g" > $TEST_FILE <<//EOF // VALIDITY CIL which breaks the ECMA-335 rules. // this CIL should fail verification by a conforming CLI verifier. .assembly '${TEST_NAME}_generated' { .hash algorithm 0x00008004 .ver 0:0:0:0 } .assembly extern 'test_lib' { .ver 0:0:0:0 } .class public auto ansi beforefieldinit SimpleClass extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } .method public hidebysig static void Generic<T>() cil managed { .maxstack 8 ret } } .class public auto ansi beforefieldinit Foo<T> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } .class public auto ansi beforefieldinit Test<T> extends class Foo<!0> { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 ldarg.0 call instance void class Foo<!0>::.ctor() ret } } .method public static int32 Main() cil managed { .entrypoint .maxstack 8 .locals init (object V_0 $EXTRA_LOC ) ldloc.0 INIT OPCODE // VALIDITY. leave END END: ldc.i4.0 ret } //EOF
#! /bin/sh SED="sed" if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi TEST_NAME=$1 TEST_VALIDITY=$2 TEST_OP=$3 TEST_INIT=$4 TEST_EXTRA_LOC=$5 if [ -n "$TEST_EXTRA_LOC" ]; then EXTRA_LOC=", $TEST_EXTRA_LOC V_1" fi TEST_NAME=${TEST_VALIDITY}_${TEST_NAME} TEST_FILE=${TEST_NAME}_generated.il echo $TEST_FILE TEST_TYPE=`echo $TEST_TYPE | $SED -s 's/&/\\\&/'` $SED -e "s/VALIDITY/${TEST_VALIDITY}/g" -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/INIT/${TEST_INIT}/g" > $TEST_FILE <<//EOF // VALIDITY CIL which breaks the ECMA-335 rules. // this CIL should fail verification by a conforming CLI verifier. .assembly '${TEST_NAME}_generated' { .hash algorithm 0x00008004 .ver 0:0:0:0 } .assembly extern 'test_lib' { .ver 0:0:0:0 } .class public auto ansi beforefieldinit SimpleClass extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } .method public hidebysig static void Generic<T>() cil managed { .maxstack 8 ret } } .class public auto ansi beforefieldinit Foo<T> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } .class public auto ansi beforefieldinit Test<T> extends class Foo<!0> { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { .maxstack 8 ldarg.0 call instance void class Foo<!0>::.ctor() ret } } .method public static int32 Main() cil managed { .entrypoint .maxstack 8 .locals init (object V_0 $EXTRA_LOC ) ldloc.0 INIT OPCODE // VALIDITY. leave END END: ldc.i4.0 ret } //EOF
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./docs/design/coreclr/botr/images/virtualstubdispatch-fig4.png
PNG  IHDRZ3N pHYs  ~ -IDATx/lWׇ#TU؛Rb)0 aL Š*,,E/ 4dٰp姜ܙ;wfyޝsϽdtA@tA@\^ؿ&6XՎpPA+<y;k/ߕ+Cׯ_*.L@mlGDޞ;V}cgsAtA:8Nc{7':C`PU*룃ïEAtG|`BO=um0:зd6cۂB_WjhL&խ^4u yҠJq)+zEVFt[ k`՞8ӧOqˠAjPy,⵽`0FNNNb&N1,@bM 1sR=wb?+.BIE0nC )7]zy,NmeHmYtɾAk,E=[ㅻWc^.S {;n_ uݯD*-(RTԤJw X=Gb&N_LAO8T84Ǝ2gKQiȼӍSY T`):h2>f(A6F.|:ד$V q`m kqb*6Ebg*H[55ZToOLFPnhhczEjOۏ{dܳ'Í,TN]BLΠX驃Gr*:XiuklS%~\{B m7fHwuKݲeVs`9T%0X*L[_ _󢼽0FFVFl g5+-[;֩iHD"v`GqfDj,p"J K$pjHNҏuЛ:X=Y`اX U5 +"+;ʘR:*+Y-m̬MD$xi -~w&aIX 4S;#qQZIf'ZLsꃃ6Ɣm"0 ~a2OpJy6S0LbsA~n+Pp{V,$7&Ft@} sHtvrR|MGZ[Y#Q!'xQS_ ,|XE0R߫3GCt0Ƶ֏QR}ZeRUUJt0ۍwAoj4kJHx<TN eӸy2ѩOW$i " j-PxXD,[x5ӦHCM-:+M%ӸT`,+Yo/S-&iPE#fZ7TE!eġ m"icO^ IcmmU,6@wA8g+|yl*>͞ϋbmUeR|1' AeB˫c=H/1/+mS~ de`9<V>5u.=Y!Ba=(g\Q]3ET4 /.W{d%,.'ĤK_Gʱi4^`6mRL5r.`Y:86zIB|{_L쫏({Ӿ=MP&W˺vJ\Вf+ }ŝnbRe{Jk+ =苍E>j aD*T|š􎂺"g@Xr?,J kˇ-# st2A@tA@D@`s?~ttgRMANj//_, l:/_<==!}Dt^zuvvPl:%NP[[[I7t0B.CX,{?}_2ա/_|0*^xqxx8juPO~g &z^L*iD9ϟ,l\:h驢pE`\Xt@遼f~tD\={vtttyyutAtߍtDƭi)++>| :0b_%ZP M up۷V>̽.): :UM>} Xup!: :UNOOA@A@A AADD6TR ::V}: zB/=l'''mmc"@DQ_`=i,pAt# noo_r=@\j}t6PONN7m|{{k+T.d;Kr}}lK~fOӱ\&vV,*YӸ޷Nquu_mc} X^ .[5 mZ}oSeRN(S;*+EbEǻl#ʍ{6Q/ rqZtotS `!/[F@;]J tPe[TH+xh{+īH楶@zǿ M DT㌿F頳o?qww(lL~kT+%I_daҙ{=C&\tA%Ͻ~qZt^&m:VDP:dLwveS8T9PM*+ViUZel8:GWFTZ"f([F٪QJu%J|O[Q[;|TdžAgaNDvY"])ׇy˪ѵST~ϽWvRm/0qZ,.ڛ\R߄+9頔7nEt01*b NZobLc9-1ET7{R٘QݦޛSVoEtI1WRC :<}~Ç.Srl{ :|((3uى2yaukѧnSlAb:Sy19i ~+7}ݎ@8M2Ie'#*S\¤^Z`?rW:m t={vxxBSUVXOWt0&87ʙd;YޣZpi <Jv^>EY̖$^8t^m[׳@gmeA]kźQOq9nq e n嵈WRm[%xGGG}t>GW"ضYڛhss8EEj>9$fزAru0KF4/f ZijZ_c c`[=uG5~x2vvv~tpny dŻgas80[86-qf :ΩudWOKo7MѨ$JaRk :n/g{u2uP7s`X,{U=^EXq1atiY\ܫsP9]oMϸ :Ω}k\=ų'fay[yxR^M?b{TCwU]8t0g&o*Iԅu0]z}+ b=U%6&KH:cqqy-:YT8V0%%N%INGզv :8z,4rQm:sɪ ,5(6A=.4|'E\5#-|tPgggO.Ќ3K2ͭiM.4Ӗ{}tE2S.Q6=}ELZR'Om:2QB3t0{`2ԩWOqj l[WmV:uhSCEo;VE/\/^?7298 붪36}Ť*u¦fDsFgEz\.C8':hRCfʉ :8ΪVDžOhZ{pdiE+o{Yq)_lZ\y}Wbg zV4?G ňZ'Cƛ>:X9>qZԋ ^fCYQY{^O_?ηWFFADI.A-+x~~~>, Z tV|K}Ǐ::8 Z PGO9xѤ:AGD\ tt}ņ(Z :@AtAtDA@Attt@A@A@Attp:x{{{qq$IxR=N*(*A5FY磖cJAt`z4vqY/˸4>AcnyÇ?^.1 :vL'''_A&='k?&-At@W iy:*YDAUe7P;q~ &ʬVxUA7^t⻻* RcsɕU%ִ[PT- Wf&Ij{@8=iwtNN<%KJt? )i{~+tp:r.exuV rQDLPz*mWꋥgR^jX),^R{l_z96gu=}aVVͧ:q'bOgtp\:XY <'M3yX<q9] a:S5I*@g^@6Zw*OEUT"xuPu2T#'Miei׶oMuRA=e&u5IԸn %7>\<acq #FJUWg3*L7P-t^ҹO ^?E}L;Q%򪡃Sa*A9z`2^>u0nAQG1:~'4u{vbEܵi:<VXž`{[ӪQ&cؠt0 MSUY"XI …`}$Ţ O~M4$`z1kT>u:8:ll֛%Xd:b0L0|@{ fVڮTWm0B&ֳ MLY۹OSF*T' :`-~;fVQ؍Q:7ԴV6RHI ::6kq]AZ+Uw߱ia*^4dt4ZUW⽝ltPҍoc|Xǘ>Qlimtqϵꯃ@Kը[X::wVږ>NTm!lCtP'nS*ŚFu*grYȲ O=[hzo\Wkop'~jht`uЬ.=t$`Ek!:XR㛕#ǖ*ʑk)՞+:b%l, :DrRUSMk+uS^6,h kfi6S xuj~oJL54>+6.kzӶTkqYff0((87Neb*OǠӖ?At(tAtp}tpwwW(W~0&ptǢ_W/:yh K4%|BZAHytA|:84u!At`uAtt@@AX윟 DtAtp)֧XczKAJd2988e梌T?~::8PLO݅(ñd;Y}t ttp: ,Uonn, A@A@i젽M{}}}mo^z#umV)ћJƶtn{.ߴ#)?Bt\j7ONN޽,mTLJΨ|:G4^z*`jz4xϾF={=t*4 jd2݇|fɷ¤Va^g+gk'!&/IkntЍz蠅˗/8Zt|<4R_l2ɋ WM\#^jDiƴrum\"}oUS/&󝝝 : :x:'oyr( (ڿӇExOz }>.Qs ڋ : :x:+4.LX`l66:詡сO<`2`mQ$}Ҏ/|6'|ǏլzBADc7rG:ؘP4L6'ޞR,tAt\t5Z瞒-Rs\mNȑync_%uPr`J( LXZh&GZnЗ6DAtAtp:F3!#A_Ljpreo9iM7 : :htP Q԰57+4>Qٞ&E/Fml羐2[C<:T+񖭑"sW{g#>nQ&tqL FrE@'''kz*F\0mSI}Z>wtt82՜_{+ioJ(a3L+5v0m)PO1"upf$R8,V[`|x A9`gjTet :[}bl :(k6DA5AT{`NN&8vAtttp: :: : :: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :rE@At@At@At@At@At@At@At@At@At@At@At@@A@AtAtt@@A@AtAtt@@A@AtAa'Q͛A(s3(+ꠇ꠹+b )! jV.C2HtA@tA@upqPIENDB`
PNG  IHDRZ3N pHYs  ~ -IDATx/lWׇ#TU؛Rb)0 aL Š*,,E/ 4dٰp姜ܙ;wfyޝsϽdtA@tA@\^ؿ&6XՎpPA+<y;k/ߕ+Cׯ_*.L@mlGDޞ;V}cgsAtA:8Nc{7':C`PU*룃ïEAtG|`BO=um0:зd6cۂB_WjhL&խ^4u yҠJq)+zEVFt[ k`՞8ӧOqˠAjPy,⵽`0FNNNb&N1,@bM 1sR=wb?+.BIE0nC )7]zy,NmeHmYtɾAk,E=[ㅻWc^.S {;n_ uݯD*-(RTԤJw X=Gb&N_LAO8T84Ǝ2gKQiȼӍSY T`):h2>f(A6F.|:ד$V q`m kqb*6Ebg*H[55ZToOLFPnhhczEjOۏ{dܳ'Í,TN]BLΠX驃Gr*:XiuklS%~\{B m7fHwuKݲeVs`9T%0X*L[_ _󢼽0FFVFl g5+-[;֩iHD"v`GqfDj,p"J K$pjHNҏuЛ:X=Y`اX U5 +"+;ʘR:*+Y-m̬MD$xi -~w&aIX 4S;#qQZIf'ZLsꃃ6Ɣm"0 ~a2OpJy6S0LbsA~n+Pp{V,$7&Ft@} sHtvrR|MGZ[Y#Q!'xQS_ ,|XE0R߫3GCt0Ƶ֏QR}ZeRUUJt0ۍwAoj4kJHx<TN eӸy2ѩOW$i " j-PxXD,[x5ӦHCM-:+M%ӸT`,+Yo/S-&iPE#fZ7TE!eġ m"icO^ IcmmU,6@wA8g+|yl*>͞ϋbmUeR|1' AeB˫c=H/1/+mS~ de`9<V>5u.=Y!Ba=(g\Q]3ET4 /.W{d%,.'ĤK_Gʱi4^`6mRL5r.`Y:86zIB|{_L쫏({Ӿ=MP&W˺vJ\Вf+ }ŝnbRe{Jk+ =苍E>j aD*T|š􎂺"g@Xr?,J kˇ-# st2A@tA@D@`s?~ttgRMANj//_, l:/_<==!}Dt^zuvvPl:%NP[[[I7t0B.CX,{?}_2ա/_|0*^xqxx8juPO~g &z^L*iD9ϟ,l\:h驢pE`\Xt@遼f~tD\={vtttyyutAtߍtDƭi)++>| :0b_%ZP M up۷V>̽.): :UM>} Xup!: :UNOOA@A@A AADD6TR ::V}: zB/=l'''mmc"@DQ_`=i,pAt# noo_r=@\j}t6PONN7m|{{k+T.d;Kr}}lK~fOӱ\&vV,*YӸ޷Nquu_mc} X^ .[5 mZ}oSeRN(S;*+EbEǻl#ʍ{6Q/ rqZtotS `!/[F@;]J tPe[TH+xh{+īH楶@zǿ M DT㌿F頳o?qww(lL~kT+%I_daҙ{=C&\tA%Ͻ~qZt^&m:VDP:dLwveS8T9PM*+ViUZel8:GWFTZ"f([F٪QJu%J|O[Q[;|TdžAgaNDvY"])ׇy˪ѵST~ϽWvRm/0qZ,.ڛ\R߄+9頔7nEt01*b NZobLc9-1ET7{R٘QݦޛSVoEtI1WRC :<}~Ç.Srl{ :|((3uى2yaukѧnSlAb:Sy19i ~+7}ݎ@8M2Ie'#*S\¤^Z`?rW:m t={vxxBSUVXOWt0&87ʙd;YޣZpi <Jv^>EY̖$^8t^m[׳@gmeA]kźQOq9nq e n嵈WRm[%xGGG}t>GW"ضYڛhss8EEj>9$fزAru0KF4/f ZijZ_c c`[=uG5~x2vvv~tpny dŻgas80[86-qf :ΩudWOKo7MѨ$JaRk :n/g{u2uP7s`X,{U=^EXq1atiY\ܫsP9]oMϸ :Ω}k\=ų'fay[yxR^M?b{TCwU]8t0g&o*Iԅu0]z}+ b=U%6&KH:cqqy-:YT8V0%%N%INGզv :8z,4rQm:sɪ ,5(6A=.4|'E\5#-|tPgggO.Ќ3K2ͭiM.4Ӗ{}tE2S.Q6=}ELZR'Om:2QB3t0{`2ԩWOqj l[WmV:uhSCEo;VE/\/^?7298 붪36}Ť*u¦fDsFgEz\.C8':hRCfʉ :8ΪVDžOhZ{pdiE+o{Yq)_lZ\y}Wbg zV4?G ňZ'Cƛ>:X9>qZԋ ^fCYQY{^O_?ηWFFADI.A-+x~~~>, Z tV|K}Ǐ::8 Z PGO9xѤ:AGD\ tt}ņ(Z :@AtAtDA@Attt@A@A@Attp:x{{{qq$IxR=N*(*A5FY磖cJAt`z4vqY/˸4>AcnyÇ?^.1 :vL'''_A&='k?&-At@W iy:*YDAUe7P;q~ &ʬVxUA7^t⻻* RcsɕU%ִ[PT- Wf&Ij{@8=iwtNN<%KJt? )i{~+tp:r.exuV rQDLPz*mWꋥgR^jX),^R{l_z96gu=}aVVͧ:q'bOgtp\:XY <'M3yX<q9] a:S5I*@g^@6Zw*OEUT"xuPu2T#'Miei׶oMuRA=e&u5IԸn %7>\<acq #FJUWg3*L7P-t^ҹO ^?E}L;Q%򪡃Sa*A9z`2^>u0nAQG1:~'4u{vbEܵi:<VXž`{[ӪQ&cؠt0 MSUY"XI …`}$Ţ O~M4$`z1kT>u:8:ll֛%Xd:b0L0|@{ fVڮTWm0B&ֳ MLY۹OSF*T' :`-~;fVQ؍Q:7ԴV6RHI ::6kq]AZ+Uw߱ia*^4dt4ZUW⽝ltPҍoc|Xǘ>Qlimtqϵꯃ@Kը[X::wVږ>NTm!lCtP'nS*ŚFu*grYȲ O=[hzo\Wkop'~jht`uЬ.=t$`Ek!:XR㛕#ǖ*ʑk)՞+:b%l, :DrRUSMk+uS^6,h kfi6S xuj~oJL54>+6.kzӶTkqYff0((87Neb*OǠӖ?At(tAtp}tpwwW(W~0&ptǢ_W/:yh K4%|BZAHytA|:84u!At`uAtt@@AX윟 DtAtp)֧XczKAJd2988e梌T?~::8PLO݅(ñd;Y}t ttp: ,Uonn, A@A@i젽M{}}}mo^z#umV)ћJƶtn{.ߴ#)?Bt\j7ONN޽,mTLJΨ|:G4^z*`jz4xϾF={=t*4 jd2݇|fɷ¤Va^g+gk'!&/IkntЍz蠅˗/8Zt|<4R_l2ɋ WM\#^jDiƴrum\"}oUS/&󝝝 : :x:'oyr( (ڿӇExOz }>.Qs ڋ : :x:+4.LX`l66:詡сO<`2`mQ$}Ҏ/|6'|ǏլzBADc7rG:ؘP4L6'ޞR,tAt\t5Z瞒-Rs\mNȑync_%uPr`J( LXZh&GZnЗ6DAtAtp:F3!#A_Ljpreo9iM7 : :htP Q԰57+4>Qٞ&E/Fml羐2[C<:T+񖭑"sW{g#>nQ&tqL FrE@'''kz*F\0mSI}Z>wtt82՜_{+ioJ(a3L+5v0m)PO1"upf$R8,V[`|x A9`gjTet :[}bl :(k6DA5AT{`NN&8vAtttp: :: : :: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :rE@At@At@At@At@At@At@At@At@At@At@At@@A@AtAtt@@A@AtAtt@@A@AtAa'Q͛A(s3(+ꠇ꠹+b )! jV.C2HtA@tA@upqPIENDB`
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_conv_ovf_i4_i2.il
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } // //====================================== //---- CLASS ---------------- .class public conv_ovf_i2 { //---- GLOBAL DATA ---------- //---- METHODS -------------- .method public static int32 conv_0(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_0(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_1(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_1(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_2(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_2(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_3(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_3(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_4(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_4(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_5(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_5(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_6(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_6(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_7(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_7(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_8(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_8(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_9(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_9(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_10(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_10(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_11(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_11(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_12(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_12(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_13(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_13(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_14(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_14(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_15(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_15(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_16(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_16(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_17(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_17(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_18(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_18(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_19(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_19(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } //---- CONSTRUCTOR ---------- .method public void conv_ovf_i2() { .maxstack 1 ret } //---- MAIN ----------------- .method public static int32 main(class [mscorlib]System.String[]) { .entrypoint .maxstack 5 //====== begin testing ====== //-- min i4 -- ldc.i4 0x80000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_0(int32,int32) ldc.i4 0xEEEEEEEE ceq brfalse FAIL //-- -1 i4 -- ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF call int32 conv_ovf_i2::conv_1(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- 0 i4 -- ldc.i4 0x00000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_2(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- +1 i4 -- ldc.i4 0x00000001 ldc.i4 0x00000001 call int32 conv_ovf_i2::conv_3(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- max i4 -- ldc.i4 0x7FFFFFFF ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_4(int32,int32) ldc.i4 0xEEEEEEEE ceq brfalse FAIL //-- min i2 -- ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 call int32 conv_ovf_i2::conv_5(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- -1 i2 -- ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF call int32 conv_ovf_i2::conv_6(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- 0 i2 -- ldc.i4 0x00000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_7(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- +1 i2 -- ldc.i4 0x00000001 ldc.i4 0x00000001 call int32 conv_ovf_i2::conv_8(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- max i2 -- ldc.i4 0x00007FFF ldc.i4 0x00007FFF call int32 conv_ovf_i2::conv_9(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //====== conv_un testing ====== //-- min i4 -- /* ldc.i4 0x80000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_un_10(unsigned int32,unsigned int32) ldc.i4 0xEEEEEEEE ceq brfalse FAIL //-- -1 i4 -- ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF call int32 conv_ovf_i2::conv_un_11(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL *///-- 0 i4 -- ldc.i4 0x00000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_un_12(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- +1 i4 -- ldc.i4 0x00000001 ldc.i4 0x00000001 call int32 conv_ovf_i2::conv_un_13(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- max i4 -- ldc.i4 0x7FFFFFFF ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_un_14(unsigned int32,unsigned int32) ldc.i4 0xEEEEEEEE ceq brfalse FAIL //-- min i2 -- /* ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 call int32 conv_ovf_i2::conv_un_15(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- -1 i2 -- ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF call int32 conv_ovf_i2::conv_un_16(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL *///-- 0 i2 -- ldc.i4 0x00000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_un_17(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- +1 i2 -- ldc.i4 0x00000001 ldc.i4 0x00000001 call int32 conv_ovf_i2::conv_un_18(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- max i2 -- ldc.i4 0x00007FFF ldc.i4 0x00007FFF call int32 conv_ovf_i2::conv_un_19(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //====== end testing ======== //---- branch here on pass -- PASS: ldc.i4 100 br END //---- branch here on fail -- FAIL: ldc.i4 101 //---- return the result ---- END: ret //---- END OF METHOD -------- } //---- EOF ------------------ } .assembly ldc_conv_ovf_i4_i2{}
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } // //====================================== //---- CLASS ---------------- .class public conv_ovf_i2 { //---- GLOBAL DATA ---------- //---- METHODS -------------- .method public static int32 conv_0(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_0(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_1(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_1(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_2(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_2(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_3(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_3(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_4(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_4(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_5(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_5(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_6(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_6(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_7(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_7(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_8(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_8(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_9(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_9(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_10(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_10(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_11(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_11(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_12(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_12(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_13(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_13(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_14(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_14(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_15(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_15(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_16(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_16(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_17(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_17(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_18(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_18(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } .method public static int32 conv_19(int32,int32) { .locals (class [mscorlib]System.OverflowException, int32) .maxstack 2 try_start: ldarg 0 conv.ovf.i2 //- No exception ldarg 1 ceq stloc.1 leave.s try_end try_end: ldloc.1 brfalse FAIL ldc.i4 0x11111111 br END aHandler: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i4 0xEEEEEEEE br END FAIL: ldc.i4 0x00000000 br END END: ret .try try_start to try_end catch [mscorlib]System.ArithmeticException handler aHandler to HEnd } .method public static int32 conv_un_19(unsigned int32,unsigned int32) { .locals (class [mscorlib]System.ArithmeticException,unsigned int16) .maxstack 2 try_start2: ldarg 0 conv.ovf.i2.un stloc.1 leave.s try_end2 try_end2: //- No exception ldloc.1 ldarg 1 ceq brfalse FAIL2 ldc.i4 0x11111111 br END2 aHandler2: //- Got an ArithmeticException isinst [mscorlib]System.ArithmeticException stloc 0 leave HEnd2 HEnd2: ldloc 0 brfalse FAIL2 ldc.i4 0xEEEEEEEE br END2 FAIL2: ldc.i4 0x00000000 br END2 END2: ret .try try_start2 to try_end2 catch [mscorlib]System.ArithmeticException handler aHandler2 to HEnd2 } //---- CONSTRUCTOR ---------- .method public void conv_ovf_i2() { .maxstack 1 ret } //---- MAIN ----------------- .method public static int32 main(class [mscorlib]System.String[]) { .entrypoint .maxstack 5 //====== begin testing ====== //-- min i4 -- ldc.i4 0x80000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_0(int32,int32) ldc.i4 0xEEEEEEEE ceq brfalse FAIL //-- -1 i4 -- ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF call int32 conv_ovf_i2::conv_1(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- 0 i4 -- ldc.i4 0x00000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_2(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- +1 i4 -- ldc.i4 0x00000001 ldc.i4 0x00000001 call int32 conv_ovf_i2::conv_3(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- max i4 -- ldc.i4 0x7FFFFFFF ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_4(int32,int32) ldc.i4 0xEEEEEEEE ceq brfalse FAIL //-- min i2 -- ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 call int32 conv_ovf_i2::conv_5(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- -1 i2 -- ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF call int32 conv_ovf_i2::conv_6(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- 0 i2 -- ldc.i4 0x00000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_7(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- +1 i2 -- ldc.i4 0x00000001 ldc.i4 0x00000001 call int32 conv_ovf_i2::conv_8(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- max i2 -- ldc.i4 0x00007FFF ldc.i4 0x00007FFF call int32 conv_ovf_i2::conv_9(int32,int32) ldc.i4 0x11111111 ceq brfalse FAIL //====== conv_un testing ====== //-- min i4 -- /* ldc.i4 0x80000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_un_10(unsigned int32,unsigned int32) ldc.i4 0xEEEEEEEE ceq brfalse FAIL //-- -1 i4 -- ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF call int32 conv_ovf_i2::conv_un_11(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL *///-- 0 i4 -- ldc.i4 0x00000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_un_12(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- +1 i4 -- ldc.i4 0x00000001 ldc.i4 0x00000001 call int32 conv_ovf_i2::conv_un_13(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- max i4 -- ldc.i4 0x7FFFFFFF ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_un_14(unsigned int32,unsigned int32) ldc.i4 0xEEEEEEEE ceq brfalse FAIL //-- min i2 -- /* ldc.i4 0xFFFF8000 ldc.i4 0xFFFF8000 call int32 conv_ovf_i2::conv_un_15(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- -1 i2 -- ldc.i4 0xFFFFFFFF ldc.i4 0xFFFFFFFF call int32 conv_ovf_i2::conv_un_16(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL *///-- 0 i2 -- ldc.i4 0x00000000 ldc.i4 0x00000000 call int32 conv_ovf_i2::conv_un_17(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- +1 i2 -- ldc.i4 0x00000001 ldc.i4 0x00000001 call int32 conv_ovf_i2::conv_un_18(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //-- max i2 -- ldc.i4 0x00007FFF ldc.i4 0x00007FFF call int32 conv_ovf_i2::conv_un_19(unsigned int32,unsigned int32) ldc.i4 0x11111111 ceq brfalse FAIL //====== end testing ======== //---- branch here on pass -- PASS: ldc.i4 100 br END //---- branch here on fail -- FAIL: ldc.i4 101 //---- return the result ---- END: ret //---- END OF METHOD -------- } //---- EOF ------------------ } .assembly ldc_conv_ovf_i4_i2{}
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./docs/design/features/localization-options.md
# Localization: .NET Core host and runtime The .NET Core host and runtime contain messages that can be displayed to both end-users and developers. Currently, all such messages are displayed in English. Other managed components built on top of .NET Runtime (e.g. SDK, WinForms, WPF) have already been localized, so a process already exists for handling translation and localizing assets, while the runtime handles satellite assembly loading. The host and runtime are different in that they have messages that originate from native components and must continue to do so. While the runtime does contain some managed resources, this document focusses on localization of native resources. The goal is to support: - Windows, Linux, and OSX - Windows was identified as the highest priority due to WPF and WinForms scenarios - 14 languages (same languages supported by Visual Studio): `cs`, `de`, `en`, `es`, `fr`, `it`, `ja`, `ko`, `pl`, `pt-BR`, `ru`, `tr`, `zh-Hans`, `zh-Hant` - All the target languages are left-to-right ## String localization on different platforms ### Windows On Windows, [resource script (.rc) files](https://docs.microsoft.com/cpp/windows/resource-files-visual-studio) are used to create resources that will be embedded into a binary. These files define [`STRINGTABLE`](https://docs.microsoft.com/windows/win32/menurc/stringtable-resource) resources containing the resource strings. Each string has a resource identifier - a symbol name mapped to an integer value - which can be used to look up the string value. The [`LoadString`](https://docs.microsoft.com/windows/win32/api/winuser/nf-winuser-loadstringw) and [`FormatMessage`](https://docs.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessage) APIs retrieve a string resources based on a specified identifier (the integer value of the resource identifier) from a specified module. These APIs leave it to their consumer to find and load the appropriate module containing the desired resources. While resources for all languages can be included in the main binary itself, it is common to separate language-specific resources into resource-only libraries. ### Linux The [GNU `gettext` APIs and tools](https://www.gnu.org/software/gettext/manual/gettext.html) are the standard for internationalization and localization on Linux. The tools provide a way to extract strings from C/C++ sources into separate source string ([.po](https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files)) files (which could then be translated) and produce binary ([.mo](https://www.gnu.org/software/gettext/manual/gettext.html#MO-Files)) files from those source string files. The APIs allow retrieval of the translated strings through a `msgid` (string), where the convention is to use the untranslated string as the `msgid`. The `gettext` API looks for the binary files in a folder of the format: <directory_name>/<locale>/LC_MESSAGES/<domain_name>.mo The `<directory_name>` and `<domain_name>` can be [configured](https://www.gnu.org/software/gettext/manual/gettext.html#Ambiguities) via the `dgettext` and `bindtextdomain` APIs. The `<locale>` is that of the current process. Users can configure the locale through [environment variables](https://www.gnu.org/software/gettext/manual/gettext.html#Locale-Environment-Variables). ### OSX For OSX bundles, separate [strings resource (.strings) files](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) are used for string localization. The platform provides a tool to extract strings from sources into .strings files and APIs for retrieving the strings from the .strings files. The .strings files are a mapping key strings to corresponding value strings, where it is common to use the untranslated string as the key. The Core Foundation framework provides [`CFCopyLocalizedString*` macros](https://developer.apple.com/documentation/corefoundation/cfcopylocalizedstring) for loading string resources. They will look for the strings files in a folder of the format: <bundle_folder>/<locale>.lproj/<table_name>.strings The `<bundle_folder>` and `<table_name>` are based on the bundle specified in the API call. The `<locale>` is that of the system. Bundles are a concept applied to directories laid out in a known structure. Without an actual bundle, [`CFBundleCreate`](https://developer.apple.com/documentation/corefoundation/1537154-cfbundlecreate) can still be used to create a bundle from any specified directory and [`CFCopyLocalizedStringFromTableInBundle`](https://developer.apple.com/documentation/corefoundation/cfcopylocalizedstringfromtableinbundle) can be used to retrieve the localized strings. ## Current state ### Host All strings are currently hard-coded in the hosting components directly where they will be displayed. There are no utilities or infrastructure around resource strings. All strings that would require localization are from native components. #### Hosting components The host has multiple components that are deployed in different ways, live in separate places, and can be of different versions. This means that there will need to be separation between their resources as well. The approach to localization may also vary based on the different use cases for each component. ### Runtime On Windows, the English resource strings are in separate `mscorrc.debug` and `mscorrc` libraries. On Linux and OSX, the English resource strings are compiled into `coreclr` itself (as string constants, not an embedded resource). String resources exist in both native (.rc) and managed (.resx). Some infrastructure is in place for loading of resources on Windows, but is not fully tested. Infrastructure for resource loading on Linux existed (recently removed), but was also untested. There was never any attempt at support for resource loading on OSX. ## Proposed ### Host Each host component will include English resource strings by default. If the resource for the appropriate locale could not be found, the host components can always fall back to English. `dotnet`, `hostfxr`, and `hostpolicy` will each have separate resources that will be installed by the .NET runtime. These components can be different versions, so their resources must be separate. `apphost` will have a single localized message. All languages will be included in the executable itself. The message will direct the user to a URL that will contain localized content. `ijwhost`, and `nethost` intentionally do not show messages by default. They will not be localized. `comhost` also intentionally does not show messages, but it does populate an `IErrorInfo` with an error string, allowing consumers to access any error messages. This can take the same approach as `apphost`, but would be a lower priority for localization. #### Hosting components `dotnet`, `hostfxr`, and `hostpolicy` are all included as part of a .NET Core install. They can each carry their own separate resources in a known path relative next to their current install locations. The other entry-point hosts (`apphost`, `comhost`, `ijwhost`, `nethost`) add some complication as they represent and ship as part of the developer's application or component. They are also the most impactful in terms of file size, as they are not shared across applications the way that other components can be. The messaging coming from the hosts themselves is a small portion of the host messaging. They are mostly around: - Failure to find `hostfxr` (all hosts) - Failure to load `hostfxr` (all hosts) - Single-file bundle reading and extraction issues (`apphost` only) Possible options for hosts: *Deploy resources with each host* - Every host comes with its own resources, so compatibility will not be a problem - Hosts will still be localized when there is no runtime - Issues: - SDK/deployment logic around including the appropriate resources and gestures for choosing those resources - Options: 1. Embedded resources for hosts - Size bloat could be impactful, since it would be for each host and one app can be comprised of multiple hosts - Deployment would not strictly have to change if everything is always embedded, but it would likely be desirable to have at least two versions (only English and all languages embedded) and allow users to choose - The canonical way of doing native localization is having separate resource files, so embedding everything would mean having to come up with a different, special method - This would also be necessary for [single-file](#single-file) support 2. Separate resource for each host - Number of files on disk would increase greatly (each host x each language) - Deployment becomes very complicated, since the hosts represent the user's app/component and are acquired through building with the SDK (`nethost` adds more complication as it is up to the users to acquire and deploy it) - Developers would need some way of choosing languages to include *Install resources with .NET Core* - If the runtime is not installed/found, hosts will not have localized resources - If the hosts are newer than installed runtime, new messages would not be localized - Issues: - Compatibility concerns for resource IDs / format values - Awkward split deployment since `*host` components are not normally part of the .NET runtime install - Options: 1. Separate resource for each host - Resource for each host would still need to be backwards compatible, since there is no guarantee that the host is the same version as the resource installed with the runtime - Some messages are used for all hosts, so they would be duplicated across resource libraries 2. Option: Shared resource for all hosts (except `dotnet`) - Compatibility requirement for resource shared between hosts `comhost`, `ijwhost`, and `nethost` are designed to be consumed by a component that .NET Core does not own and intentionally do not show messages to the user. As such, they sit at a low priority for localization support. `apphost` is the end-user-facing host. The amount of logic and messaging in `apphost` is intentionally limited. The most important message it contains for an end-user is for the missing .NET runtime scenario, so it should not rely on resources installed via the .NET runtime. Embedding resources in the `apphost` would make for the most stream-lined user experience (particularly around deployment). Since the `apphost` is sensitive to size, the number of messages will be pared down to one generic localized message which directs the user to a URL. Options: 1. No localization - Main user-facing message already has a URL, which could be updated to include user locale such that it would direct to a page based on the user locale 2. Single localized message pointing to a URL for error details - Show English error message. Show localized message pointing the user to some URL to get details (which would direct to a page based on the user locale). - If this experience is acceptable, it would be applicable for all future error messages in the host - Need to own or partner more closely with server / docs 3. Single localized message indicating an error and pointing to a URL for error details - Show localized message indicating error occurred running the application and pointing to a URL (which would direct to a page based on the user locale). Additional error details in English. - Need to own or partner more closely with server / docs Both (2) and (3) represent similar amounts of work. (2) would ensure that the single message would not need to change and no other messages would need to be added in the future. (3) provides a slightly nicer user experience. In all cases, the user would be shown a URL that would direct to localized content. ### Runtime The `mscorrc.debug` and `mscorrc` resource libraries will be combined into one. All native components use resources from `mscorrc`. `System.Private.CoreLib` will have `System.Private.CoreLib.resources` satellite assemblies and rely on the satellite assembly loading infrastructure in .NET Core to work. ### Locale Localization for native components will be based on the user's locale. Standard methods for native localization use the user's locale. However, managed satellite assemblies also respect the thread's current culture. If the managed thread's current culture is not the same as the user's locale, this could result in mixed languages. Attempting to have the native components also follow the managed thread's culture would introduce issues and add significant complexity: - Managed code may not be callable at the time a message needs to be displayed - Some messages propagate up from the host (e.g. errors in `AssemblyDependencyResolver`) and host components do not have a simple way to access the managed thread's culture - Not all platforms have a standard way to choose a specific language outside of process-wide configuration (e.g. `gettext` on Linux always uses the locale based on environment variables) ### Translated assets All localizable resources need to be in the XLIFF file format (.xlf). New tooling will be required to convert from an untranslated base format to language-specific .xlf files and from the language-specific .xlf files to a format (.rc/.po/.strings, UTF-8/UTF-16) that will be compiled into resource libraries (or deployed directly) for each platform. The existing [xliff-tasks](https://github.com/dotnet/xliff-tasks) tooling supports conversion between managed resource files (.resx) and .xlf files and building satellite resource libraries. It is all MSBuild-based and has no concept of native resources or build processes. Extending it in a way that works naturally with CMake builds across platforms would be non-trivial. It is also an option to create tooling directly integrated in the dotnet/runtime repo itself. This would not be a generic and reusable component outside of the dotnet/runtime repo and its build system. ### Platforms Each platform has its own standard way and file formats for handling localization. There are two main approaches that can be taken here: 1. Convert a base format to platform-specific localization formats and use platform-specific localization support - Requires a tool/script to convert file formats at build time - Uses platform support and standard localization methods that the .NET team will not need to maintain - Different method for handling localized resources on each platform 2. Create a custom solution: storage format for string resources, tools for generation from the [translated assets (.xlf)](#translated-assets), and implementation for reading - Requires design of completely custom support that will need to be maintained by the .NET team on all platforms - Allows support for both string resources from file or memory - All platforms could use the same method for handling localized resources For [single-file](#single-file) support without any separate files, (1) would not be sufficient and a custom solution (2) would be required. For single-file support where localized resources can be included as separate files, the platform-specific solutions could be used. #### Windows-specific Resource script (.rc) files will be used as the main source of string values written in the development language (English). These base .rc files will be used to update [.xlf files](#translated-assets). Those which will then be compiled into language-specific resource libraries. The host and runtime will follow the typical [Windows method](#windows) for localization of native string resources. Resources for each language will be compiled into a resource-only library, laid out in a language-specific subfolder. For example: ``` host/fxr/<version> hostfxr.dll fr hostfxr.resources.dll shared/Microsoft.NETCore.App/<version> coreclr.dll hostpolicy.dll fr hostpolicy.resources.dll mscorrc.dll ``` At run time, the .NET Core host/runtime will find and load the resource DLL from the subfolder corresponding to the user's current locale. If the resource cannot be found, English will be the fallback. #### Linux-specific The development language (English) strings will be compiled into the host and runtime directly. The langage-specific .xlf files will be converted into .po files and then .mo files. Those binary .mo files will be laid out in a language-specific subfolder. For example: ``` host/fxr/<version> libhostfxr.so fr LC_MESSAGES hostfxr.mo shared/Microsoft.NETCore.App/<version> libcoreclr.so libhostpolicy.so fr LC_MESSAGES hostpolicy.mo mscorrc.mo ``` The `gettext` APIs will be used to retrieve the appropriate message using the development language strings as the `msgid`. #### OSX-specific The development language (English) strings will be compiled into the host and runtime directly. The language-specific .xlf files will be converted into .strings files. Those .strings files will be laid out in a language-specific subfolder. For example: ``` host/fxr/<version> libhostfxr.dylib fr.lproj hostfxr.strings shared/Microsoft.NETCore.App/<version> libcoreclr.dylib libhostpolicy.dylib fr.lproj hostpolicy.strings mscorrc.strings ``` The `CFCopyLocalizedStringFromTableInBundle` API will be used to retrieve the appropriate message using the development language strings as the key. #### Custom solution The development language (English) strings will be compiled into the host and runtime directly. The langage-specific `.xlf` files will be converted into a chosen storage format. Those files will be laid out in a language-specific subfolder. For example: ``` host/fxr/<version> hostfxr.dll (.so/.dylib) fr hostfxr.resources shared/Microsoft.NETCore.App/<version> coreclr.dll (.so/.dylib) hostpolicy.dll (.so/.dylib) fr hostpolicy.resources mscorrc.resources ``` For single file, the language-specific resources will be bundled into the application's executable. Cross-platform utilities will be created for resource loading. The reader/parser will support both reading from a file and memory. ### Shared utilities between host and runtime Both the host and runtime require support for native localization. Since (with the exception of `apphost`) they would use the same approach, rather than each having their own copy, it would make sense for them to share utilities around finding and loading resources. Ideally, the host and runtime could use the same static lib. However, even though they are now in the same repo, their builds are still fairly partitioned. A reasonable middle ground could be to have source files that are compiled into both the host and runtime components. This does have the complication that the host and runtime have separate PALs, so any shared code would need to work properly with both sides. ### Packaging and deployment Installers and packages will need to include the language-specific resource files. This could involve updating all existing installers or could mean the creation of multiple new installers. Exactly how resources should be delivered is an [open question](#packaging-and-deployment-1). ## Open questions ### Language override Messages from the host and runtime can be user-facing or developer-facing. Some developers do not want to have localized messages, so there should be some way to override localizing to the user's locale. This would need to be a setting that both the host and runtime could easily check. On Windows, the native component fully controls which resource library to load, so it would be able to check for an override (like an environment variable). The `gettext` APIs on Linux essentially allow this kind of override through environment variables. There is not a clear way to configure the APIs on OSX to override the locale; the .strings files can be loaded/read as a dictionary directly through the [`CFPropertyListCreateWithStream`](https://developer.apple.com/documentation/corefoundation/1430023-cfpropertylistcreatewithstream) API. The SDK already allows overriding of the locale through the `DOTNET_CLI_UI_LANGUAGE` environment variable. Any automated testing would likely also require some form of language override. ### Single-file The standard way of doing native localization is based on having separate resources files. On Windows, it is possible to embed resources for multiple languages into one library and use [`FormatMessage`](https://docs.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessage) or a combination of [`FindResourceEx`](https://docs.microsoft.com/windows/win32/api/winbase/nf-winbase-findresourceexa) and [`LoadResource`](https://docs.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-loadresource) to load the resource for a specific language. On Linux and OSX, no such platform support exists. Extracting files to disk has proven to be extremely problematic across all platforms (permissions, anti-virus, clean up). Adding native resources to that extraction would only exacerbate the existing issues. This means that localized resources would need be read from memory. A custom solution would need to be created and maintained: - Format for storing identifiers and their corresponding strings for every language - Tooling to generate the format based on [translated assets](#translation-and-localized-assets) - Reader/parser for the custom format to retrieve the appropriate string If support for localization of native components in single-file scenarios without separate resource files is a priority, it would make sense to just use the custom solution (that could handle both reading from files and memory) for non-single-file scenarios as well. Since localization would not be needed by all applications, localized resources could also be considered an add-on to single-file and not part of the single-file itself. To support localization, the developer would need to include separate localized resources alongside the single-file executable. In this case, the platform-specific solution would be used. Since Windows does provide a supported way to handle multiple embedded localized resources, the experience for localization could also be improved on Windows such that it does embed all resources into one library. ### Packaging and deployment WPF and WinForms always include all languanges in an install. Does the host/runtime do the same or have separate language packs? How are they delivered (e.g. single installer with runtime and options for different languages, separate installer for languages with options for different languanges, separate installer per language)? ### SDK Self-contained applications would need to include resources for all languages they support. Some developer input would be required to specify the desired language support and the SDK would need to be updated to handle the different options: - All supported languages - One specific language - A subset of supported languages (more than one) Note: Building WPF self-contained applications currently includes resources for all languages.
# Localization: .NET Core host and runtime The .NET Core host and runtime contain messages that can be displayed to both end-users and developers. Currently, all such messages are displayed in English. Other managed components built on top of .NET Runtime (e.g. SDK, WinForms, WPF) have already been localized, so a process already exists for handling translation and localizing assets, while the runtime handles satellite assembly loading. The host and runtime are different in that they have messages that originate from native components and must continue to do so. While the runtime does contain some managed resources, this document focusses on localization of native resources. The goal is to support: - Windows, Linux, and OSX - Windows was identified as the highest priority due to WPF and WinForms scenarios - 14 languages (same languages supported by Visual Studio): `cs`, `de`, `en`, `es`, `fr`, `it`, `ja`, `ko`, `pl`, `pt-BR`, `ru`, `tr`, `zh-Hans`, `zh-Hant` - All the target languages are left-to-right ## String localization on different platforms ### Windows On Windows, [resource script (.rc) files](https://docs.microsoft.com/cpp/windows/resource-files-visual-studio) are used to create resources that will be embedded into a binary. These files define [`STRINGTABLE`](https://docs.microsoft.com/windows/win32/menurc/stringtable-resource) resources containing the resource strings. Each string has a resource identifier - a symbol name mapped to an integer value - which can be used to look up the string value. The [`LoadString`](https://docs.microsoft.com/windows/win32/api/winuser/nf-winuser-loadstringw) and [`FormatMessage`](https://docs.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessage) APIs retrieve a string resources based on a specified identifier (the integer value of the resource identifier) from a specified module. These APIs leave it to their consumer to find and load the appropriate module containing the desired resources. While resources for all languages can be included in the main binary itself, it is common to separate language-specific resources into resource-only libraries. ### Linux The [GNU `gettext` APIs and tools](https://www.gnu.org/software/gettext/manual/gettext.html) are the standard for internationalization and localization on Linux. The tools provide a way to extract strings from C/C++ sources into separate source string ([.po](https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files)) files (which could then be translated) and produce binary ([.mo](https://www.gnu.org/software/gettext/manual/gettext.html#MO-Files)) files from those source string files. The APIs allow retrieval of the translated strings through a `msgid` (string), where the convention is to use the untranslated string as the `msgid`. The `gettext` API looks for the binary files in a folder of the format: <directory_name>/<locale>/LC_MESSAGES/<domain_name>.mo The `<directory_name>` and `<domain_name>` can be [configured](https://www.gnu.org/software/gettext/manual/gettext.html#Ambiguities) via the `dgettext` and `bindtextdomain` APIs. The `<locale>` is that of the current process. Users can configure the locale through [environment variables](https://www.gnu.org/software/gettext/manual/gettext.html#Locale-Environment-Variables). ### OSX For OSX bundles, separate [strings resource (.strings) files](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) are used for string localization. The platform provides a tool to extract strings from sources into .strings files and APIs for retrieving the strings from the .strings files. The .strings files are a mapping key strings to corresponding value strings, where it is common to use the untranslated string as the key. The Core Foundation framework provides [`CFCopyLocalizedString*` macros](https://developer.apple.com/documentation/corefoundation/cfcopylocalizedstring) for loading string resources. They will look for the strings files in a folder of the format: <bundle_folder>/<locale>.lproj/<table_name>.strings The `<bundle_folder>` and `<table_name>` are based on the bundle specified in the API call. The `<locale>` is that of the system. Bundles are a concept applied to directories laid out in a known structure. Without an actual bundle, [`CFBundleCreate`](https://developer.apple.com/documentation/corefoundation/1537154-cfbundlecreate) can still be used to create a bundle from any specified directory and [`CFCopyLocalizedStringFromTableInBundle`](https://developer.apple.com/documentation/corefoundation/cfcopylocalizedstringfromtableinbundle) can be used to retrieve the localized strings. ## Current state ### Host All strings are currently hard-coded in the hosting components directly where they will be displayed. There are no utilities or infrastructure around resource strings. All strings that would require localization are from native components. #### Hosting components The host has multiple components that are deployed in different ways, live in separate places, and can be of different versions. This means that there will need to be separation between their resources as well. The approach to localization may also vary based on the different use cases for each component. ### Runtime On Windows, the English resource strings are in separate `mscorrc.debug` and `mscorrc` libraries. On Linux and OSX, the English resource strings are compiled into `coreclr` itself (as string constants, not an embedded resource). String resources exist in both native (.rc) and managed (.resx). Some infrastructure is in place for loading of resources on Windows, but is not fully tested. Infrastructure for resource loading on Linux existed (recently removed), but was also untested. There was never any attempt at support for resource loading on OSX. ## Proposed ### Host Each host component will include English resource strings by default. If the resource for the appropriate locale could not be found, the host components can always fall back to English. `dotnet`, `hostfxr`, and `hostpolicy` will each have separate resources that will be installed by the .NET runtime. These components can be different versions, so their resources must be separate. `apphost` will have a single localized message. All languages will be included in the executable itself. The message will direct the user to a URL that will contain localized content. `ijwhost`, and `nethost` intentionally do not show messages by default. They will not be localized. `comhost` also intentionally does not show messages, but it does populate an `IErrorInfo` with an error string, allowing consumers to access any error messages. This can take the same approach as `apphost`, but would be a lower priority for localization. #### Hosting components `dotnet`, `hostfxr`, and `hostpolicy` are all included as part of a .NET Core install. They can each carry their own separate resources in a known path relative next to their current install locations. The other entry-point hosts (`apphost`, `comhost`, `ijwhost`, `nethost`) add some complication as they represent and ship as part of the developer's application or component. They are also the most impactful in terms of file size, as they are not shared across applications the way that other components can be. The messaging coming from the hosts themselves is a small portion of the host messaging. They are mostly around: - Failure to find `hostfxr` (all hosts) - Failure to load `hostfxr` (all hosts) - Single-file bundle reading and extraction issues (`apphost` only) Possible options for hosts: *Deploy resources with each host* - Every host comes with its own resources, so compatibility will not be a problem - Hosts will still be localized when there is no runtime - Issues: - SDK/deployment logic around including the appropriate resources and gestures for choosing those resources - Options: 1. Embedded resources for hosts - Size bloat could be impactful, since it would be for each host and one app can be comprised of multiple hosts - Deployment would not strictly have to change if everything is always embedded, but it would likely be desirable to have at least two versions (only English and all languages embedded) and allow users to choose - The canonical way of doing native localization is having separate resource files, so embedding everything would mean having to come up with a different, special method - This would also be necessary for [single-file](#single-file) support 2. Separate resource for each host - Number of files on disk would increase greatly (each host x each language) - Deployment becomes very complicated, since the hosts represent the user's app/component and are acquired through building with the SDK (`nethost` adds more complication as it is up to the users to acquire and deploy it) - Developers would need some way of choosing languages to include *Install resources with .NET Core* - If the runtime is not installed/found, hosts will not have localized resources - If the hosts are newer than installed runtime, new messages would not be localized - Issues: - Compatibility concerns for resource IDs / format values - Awkward split deployment since `*host` components are not normally part of the .NET runtime install - Options: 1. Separate resource for each host - Resource for each host would still need to be backwards compatible, since there is no guarantee that the host is the same version as the resource installed with the runtime - Some messages are used for all hosts, so they would be duplicated across resource libraries 2. Option: Shared resource for all hosts (except `dotnet`) - Compatibility requirement for resource shared between hosts `comhost`, `ijwhost`, and `nethost` are designed to be consumed by a component that .NET Core does not own and intentionally do not show messages to the user. As such, they sit at a low priority for localization support. `apphost` is the end-user-facing host. The amount of logic and messaging in `apphost` is intentionally limited. The most important message it contains for an end-user is for the missing .NET runtime scenario, so it should not rely on resources installed via the .NET runtime. Embedding resources in the `apphost` would make for the most stream-lined user experience (particularly around deployment). Since the `apphost` is sensitive to size, the number of messages will be pared down to one generic localized message which directs the user to a URL. Options: 1. No localization - Main user-facing message already has a URL, which could be updated to include user locale such that it would direct to a page based on the user locale 2. Single localized message pointing to a URL for error details - Show English error message. Show localized message pointing the user to some URL to get details (which would direct to a page based on the user locale). - If this experience is acceptable, it would be applicable for all future error messages in the host - Need to own or partner more closely with server / docs 3. Single localized message indicating an error and pointing to a URL for error details - Show localized message indicating error occurred running the application and pointing to a URL (which would direct to a page based on the user locale). Additional error details in English. - Need to own or partner more closely with server / docs Both (2) and (3) represent similar amounts of work. (2) would ensure that the single message would not need to change and no other messages would need to be added in the future. (3) provides a slightly nicer user experience. In all cases, the user would be shown a URL that would direct to localized content. ### Runtime The `mscorrc.debug` and `mscorrc` resource libraries will be combined into one. All native components use resources from `mscorrc`. `System.Private.CoreLib` will have `System.Private.CoreLib.resources` satellite assemblies and rely on the satellite assembly loading infrastructure in .NET Core to work. ### Locale Localization for native components will be based on the user's locale. Standard methods for native localization use the user's locale. However, managed satellite assemblies also respect the thread's current culture. If the managed thread's current culture is not the same as the user's locale, this could result in mixed languages. Attempting to have the native components also follow the managed thread's culture would introduce issues and add significant complexity: - Managed code may not be callable at the time a message needs to be displayed - Some messages propagate up from the host (e.g. errors in `AssemblyDependencyResolver`) and host components do not have a simple way to access the managed thread's culture - Not all platforms have a standard way to choose a specific language outside of process-wide configuration (e.g. `gettext` on Linux always uses the locale based on environment variables) ### Translated assets All localizable resources need to be in the XLIFF file format (.xlf). New tooling will be required to convert from an untranslated base format to language-specific .xlf files and from the language-specific .xlf files to a format (.rc/.po/.strings, UTF-8/UTF-16) that will be compiled into resource libraries (or deployed directly) for each platform. The existing [xliff-tasks](https://github.com/dotnet/xliff-tasks) tooling supports conversion between managed resource files (.resx) and .xlf files and building satellite resource libraries. It is all MSBuild-based and has no concept of native resources or build processes. Extending it in a way that works naturally with CMake builds across platforms would be non-trivial. It is also an option to create tooling directly integrated in the dotnet/runtime repo itself. This would not be a generic and reusable component outside of the dotnet/runtime repo and its build system. ### Platforms Each platform has its own standard way and file formats for handling localization. There are two main approaches that can be taken here: 1. Convert a base format to platform-specific localization formats and use platform-specific localization support - Requires a tool/script to convert file formats at build time - Uses platform support and standard localization methods that the .NET team will not need to maintain - Different method for handling localized resources on each platform 2. Create a custom solution: storage format for string resources, tools for generation from the [translated assets (.xlf)](#translated-assets), and implementation for reading - Requires design of completely custom support that will need to be maintained by the .NET team on all platforms - Allows support for both string resources from file or memory - All platforms could use the same method for handling localized resources For [single-file](#single-file) support without any separate files, (1) would not be sufficient and a custom solution (2) would be required. For single-file support where localized resources can be included as separate files, the platform-specific solutions could be used. #### Windows-specific Resource script (.rc) files will be used as the main source of string values written in the development language (English). These base .rc files will be used to update [.xlf files](#translated-assets). Those which will then be compiled into language-specific resource libraries. The host and runtime will follow the typical [Windows method](#windows) for localization of native string resources. Resources for each language will be compiled into a resource-only library, laid out in a language-specific subfolder. For example: ``` host/fxr/<version> hostfxr.dll fr hostfxr.resources.dll shared/Microsoft.NETCore.App/<version> coreclr.dll hostpolicy.dll fr hostpolicy.resources.dll mscorrc.dll ``` At run time, the .NET Core host/runtime will find and load the resource DLL from the subfolder corresponding to the user's current locale. If the resource cannot be found, English will be the fallback. #### Linux-specific The development language (English) strings will be compiled into the host and runtime directly. The langage-specific .xlf files will be converted into .po files and then .mo files. Those binary .mo files will be laid out in a language-specific subfolder. For example: ``` host/fxr/<version> libhostfxr.so fr LC_MESSAGES hostfxr.mo shared/Microsoft.NETCore.App/<version> libcoreclr.so libhostpolicy.so fr LC_MESSAGES hostpolicy.mo mscorrc.mo ``` The `gettext` APIs will be used to retrieve the appropriate message using the development language strings as the `msgid`. #### OSX-specific The development language (English) strings will be compiled into the host and runtime directly. The language-specific .xlf files will be converted into .strings files. Those .strings files will be laid out in a language-specific subfolder. For example: ``` host/fxr/<version> libhostfxr.dylib fr.lproj hostfxr.strings shared/Microsoft.NETCore.App/<version> libcoreclr.dylib libhostpolicy.dylib fr.lproj hostpolicy.strings mscorrc.strings ``` The `CFCopyLocalizedStringFromTableInBundle` API will be used to retrieve the appropriate message using the development language strings as the key. #### Custom solution The development language (English) strings will be compiled into the host and runtime directly. The langage-specific `.xlf` files will be converted into a chosen storage format. Those files will be laid out in a language-specific subfolder. For example: ``` host/fxr/<version> hostfxr.dll (.so/.dylib) fr hostfxr.resources shared/Microsoft.NETCore.App/<version> coreclr.dll (.so/.dylib) hostpolicy.dll (.so/.dylib) fr hostpolicy.resources mscorrc.resources ``` For single file, the language-specific resources will be bundled into the application's executable. Cross-platform utilities will be created for resource loading. The reader/parser will support both reading from a file and memory. ### Shared utilities between host and runtime Both the host and runtime require support for native localization. Since (with the exception of `apphost`) they would use the same approach, rather than each having their own copy, it would make sense for them to share utilities around finding and loading resources. Ideally, the host and runtime could use the same static lib. However, even though they are now in the same repo, their builds are still fairly partitioned. A reasonable middle ground could be to have source files that are compiled into both the host and runtime components. This does have the complication that the host and runtime have separate PALs, so any shared code would need to work properly with both sides. ### Packaging and deployment Installers and packages will need to include the language-specific resource files. This could involve updating all existing installers or could mean the creation of multiple new installers. Exactly how resources should be delivered is an [open question](#packaging-and-deployment-1). ## Open questions ### Language override Messages from the host and runtime can be user-facing or developer-facing. Some developers do not want to have localized messages, so there should be some way to override localizing to the user's locale. This would need to be a setting that both the host and runtime could easily check. On Windows, the native component fully controls which resource library to load, so it would be able to check for an override (like an environment variable). The `gettext` APIs on Linux essentially allow this kind of override through environment variables. There is not a clear way to configure the APIs on OSX to override the locale; the .strings files can be loaded/read as a dictionary directly through the [`CFPropertyListCreateWithStream`](https://developer.apple.com/documentation/corefoundation/1430023-cfpropertylistcreatewithstream) API. The SDK already allows overriding of the locale through the `DOTNET_CLI_UI_LANGUAGE` environment variable. Any automated testing would likely also require some form of language override. ### Single-file The standard way of doing native localization is based on having separate resources files. On Windows, it is possible to embed resources for multiple languages into one library and use [`FormatMessage`](https://docs.microsoft.com/windows/win32/api/winbase/nf-winbase-formatmessage) or a combination of [`FindResourceEx`](https://docs.microsoft.com/windows/win32/api/winbase/nf-winbase-findresourceexa) and [`LoadResource`](https://docs.microsoft.com/windows/win32/api/libloaderapi/nf-libloaderapi-loadresource) to load the resource for a specific language. On Linux and OSX, no such platform support exists. Extracting files to disk has proven to be extremely problematic across all platforms (permissions, anti-virus, clean up). Adding native resources to that extraction would only exacerbate the existing issues. This means that localized resources would need be read from memory. A custom solution would need to be created and maintained: - Format for storing identifiers and their corresponding strings for every language - Tooling to generate the format based on [translated assets](#translation-and-localized-assets) - Reader/parser for the custom format to retrieve the appropriate string If support for localization of native components in single-file scenarios without separate resource files is a priority, it would make sense to just use the custom solution (that could handle both reading from files and memory) for non-single-file scenarios as well. Since localization would not be needed by all applications, localized resources could also be considered an add-on to single-file and not part of the single-file itself. To support localization, the developer would need to include separate localized resources alongside the single-file executable. In this case, the platform-specific solution would be used. Since Windows does provide a supported way to handle multiple embedded localized resources, the experience for localization could also be improved on Windows such that it does embed all resources into one library. ### Packaging and deployment WPF and WinForms always include all languanges in an install. Does the host/runtime do the same or have separate language packs? How are they delivered (e.g. single installer with runtime and options for different languages, separate installer for languages with options for different languanges, separate installer per language)? ### SDK Self-contained applications would need to include resources for all languages they support. Some developer input would be required to specify the desired language support and the SDK would need to be updated to handle the different options: - All supported languages - One specific language - A subset of supported languages (more than one) Note: Building WPF self-contained applications currently includes resources for all languages.
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/mono/mono/tests/dbnull-missing.cs
using System; using System.Reflection; using System.Runtime.InteropServices; class X { static int Main () { ParameterInfo [] pi = typeof (X).GetMethod ("TakesInt").GetParameters (); Console.WriteLine ("{0} and {1}", pi [0].DefaultValue.GetType (), pi [1].DefaultValue.GetType ()); if (pi [0].DefaultValue.GetType () != typeof (DBNull)) return 1; if (pi [1].DefaultValue.GetType () != typeof (Missing)) return 2; return 0; } public static void TakesInt (int b, [Optional] int a) { } }
using System; using System.Reflection; using System.Runtime.InteropServices; class X { static int Main () { ParameterInfo [] pi = typeof (X).GetMethod ("TakesInt").GetParameters (); Console.WriteLine ("{0} and {1}", pi [0].DefaultValue.GetType (), pi [1].DefaultValue.GetType ()); if (pi [0].DefaultValue.GetType () != typeof (DBNull)) return 1; if (pi [1].DefaultValue.GetType () != typeof (Missing)) return 2; return 0; } public static void TakesInt (int b, [Optional] int a) { } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.IO.Pipes/src/Microsoft/Win32/SafeHandles/SafePipeHandle.Unix.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Diagnostics; using System.Net.Sockets; using System.Reflection; using System.Runtime.InteropServices; using System.Security; using System.Threading; namespace Microsoft.Win32.SafeHandles { public sealed partial class SafePipeHandle : SafeHandleZeroOrMinusOneIsInvalid { private const int DefaultInvalidHandle = -1; // For anonymous pipes, SafePipeHandle.handle is the file descriptor of the pipe. // For named pipes, SafePipeHandle.handle is a copy of the file descriptor // extracted from the Socket's SafeHandle. // This allows operations related to file descriptors to be performed directly on the SafePipeHandle, // and operations that should go through the Socket to be done via PipeSocket. We keep the // Socket's SafeHandle alive as long as this SafeHandle is alive. private Socket? _pipeSocket; private SafeHandle? _pipeSocketHandle; private volatile int _disposed; internal SafePipeHandle(Socket namedPipeSocket) : base(ownsHandle: true) { SetPipeSocketInterlocked(namedPipeSocket, ownsHandle: true); base.SetHandle(_pipeSocketHandle!.DangerousGetHandle()); } internal Socket PipeSocket => _pipeSocket ?? CreatePipeSocket(); internal SafeHandle? PipeSocketHandle => _pipeSocketHandle; protected override void Dispose(bool disposing) { base.Dispose(disposing); // must be called before trying to Dispose the socket _disposed = 1; if (disposing && Volatile.Read(ref _pipeSocket) is Socket socket) { socket.Dispose(); _pipeSocket = null; } } protected override bool ReleaseHandle() { Debug.Assert(!IsInvalid); if (_pipeSocketHandle != null) { base.SetHandle((IntPtr)DefaultInvalidHandle); _pipeSocketHandle.DangerousRelease(); _pipeSocketHandle = null; return true; } else { return (long)handle >= 0 ? Interop.Sys.Close(handle) == 0 : true; } } public override bool IsInvalid { get { return (long)handle < 0 && _pipeSocket == null; } } private Socket CreatePipeSocket(bool ownsHandle = true) { Socket? socket = null; if (_disposed == 0) { bool refAdded = false; try { DangerousAddRef(ref refAdded); socket = SetPipeSocketInterlocked(new Socket(new SafeSocketHandle(handle, ownsHandle)), ownsHandle); // Double check if we haven't Disposed in the meanwhile, and ensure // the Socket is disposed, in case Dispose() missed the _pipeSocket assignment. if (_disposed == 1) { Volatile.Write(ref _pipeSocket, null); socket.Dispose(); socket = null; } } finally { if (refAdded) { DangerousRelease(); } } } return socket ?? throw new ObjectDisposedException(GetType().ToString()); } private Socket SetPipeSocketInterlocked(Socket socket, bool ownsHandle) { Debug.Assert(socket != null); // Multiple threads may try to create the PipeSocket. Socket? current = Interlocked.CompareExchange(ref _pipeSocket, socket, null); if (current != null) { socket.Dispose(); return current; } // If we own the handle, defer ownership to the SocketHandle. SafeSocketHandle socketHandle = _pipeSocket.SafeHandle; if (ownsHandle) { _pipeSocketHandle = socketHandle; bool ignored = false; socketHandle.DangerousAddRef(ref ignored); } return socket; } internal void SetHandle(IntPtr descriptor, bool ownsHandle = true) { base.SetHandle(descriptor); // Avoid throwing when we own the handle by defering pipe creation. if (!ownsHandle) { _pipeSocket = CreatePipeSocket(ownsHandle); } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Diagnostics; using System.Net.Sockets; using System.Reflection; using System.Runtime.InteropServices; using System.Security; using System.Threading; namespace Microsoft.Win32.SafeHandles { public sealed partial class SafePipeHandle : SafeHandleZeroOrMinusOneIsInvalid { private const int DefaultInvalidHandle = -1; // For anonymous pipes, SafePipeHandle.handle is the file descriptor of the pipe. // For named pipes, SafePipeHandle.handle is a copy of the file descriptor // extracted from the Socket's SafeHandle. // This allows operations related to file descriptors to be performed directly on the SafePipeHandle, // and operations that should go through the Socket to be done via PipeSocket. We keep the // Socket's SafeHandle alive as long as this SafeHandle is alive. private Socket? _pipeSocket; private SafeHandle? _pipeSocketHandle; private volatile int _disposed; internal SafePipeHandle(Socket namedPipeSocket) : base(ownsHandle: true) { SetPipeSocketInterlocked(namedPipeSocket, ownsHandle: true); base.SetHandle(_pipeSocketHandle!.DangerousGetHandle()); } internal Socket PipeSocket => _pipeSocket ?? CreatePipeSocket(); internal SafeHandle? PipeSocketHandle => _pipeSocketHandle; protected override void Dispose(bool disposing) { base.Dispose(disposing); // must be called before trying to Dispose the socket _disposed = 1; if (disposing && Volatile.Read(ref _pipeSocket) is Socket socket) { socket.Dispose(); _pipeSocket = null; } } protected override bool ReleaseHandle() { Debug.Assert(!IsInvalid); if (_pipeSocketHandle != null) { base.SetHandle((IntPtr)DefaultInvalidHandle); _pipeSocketHandle.DangerousRelease(); _pipeSocketHandle = null; return true; } else { return (long)handle >= 0 ? Interop.Sys.Close(handle) == 0 : true; } } public override bool IsInvalid { get { return (long)handle < 0 && _pipeSocket == null; } } private Socket CreatePipeSocket(bool ownsHandle = true) { Socket? socket = null; if (_disposed == 0) { bool refAdded = false; try { DangerousAddRef(ref refAdded); socket = SetPipeSocketInterlocked(new Socket(new SafeSocketHandle(handle, ownsHandle)), ownsHandle); // Double check if we haven't Disposed in the meanwhile, and ensure // the Socket is disposed, in case Dispose() missed the _pipeSocket assignment. if (_disposed == 1) { Volatile.Write(ref _pipeSocket, null); socket.Dispose(); socket = null; } } finally { if (refAdded) { DangerousRelease(); } } } return socket ?? throw new ObjectDisposedException(GetType().ToString()); } private Socket SetPipeSocketInterlocked(Socket socket, bool ownsHandle) { Debug.Assert(socket != null); // Multiple threads may try to create the PipeSocket. Socket? current = Interlocked.CompareExchange(ref _pipeSocket, socket, null); if (current != null) { socket.Dispose(); return current; } // If we own the handle, defer ownership to the SocketHandle. SafeSocketHandle socketHandle = _pipeSocket.SafeHandle; if (ownsHandle) { _pipeSocketHandle = socketHandle; bool ignored = false; socketHandle.DangerousAddRef(ref ignored); } return socket; } internal void SetHandle(IntPtr descriptor, bool ownsHandle = true) { base.SetHandle(descriptor); // Avoid throwing when we own the handle by defering pipe creation. if (!ownsHandle) { _pipeSocket = CreatePipeSocket(ownsHandle); } } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/Directed/PREFIX/volatile/1/ldobj.ilproj
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> <RestorePackages>true</RestorePackages> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> <Optimize>True</Optimize> </PropertyGroup> <ItemGroup> <Compile Include="ldobj.il" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> <RestorePackages>true</RestorePackages> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> <Optimize>True</Optimize> </PropertyGroup> <ItemGroup> <Compile Include="ldobj.il" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.Formats.Asn1/tests/Writer/WriteEnumerated.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Formats.Asn1.Tests.Reader; using System.Security.Cryptography.X509Certificates; using Test.Cryptography; using Xunit; namespace System.Formats.Asn1.Tests.Writer { public class WriteEnumerated : Asn1WriterTests { [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.SByteBacked.Zero, false, "0A0100")] [InlineData(AsnEncodingRules.CER, ReadEnumerated.SByteBacked.Pillow, true, "9E01EF")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.SByteBacked.Fluff, false, "0A0153")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.SByteBacked.Fluff, true, "9E0153")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.SByteBacked)(-127), true, "9E0181")] public void VerifyWriteEnumerated_SByte( AsnEncodingRules ruleSet, ReadEnumerated.SByteBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.ContextSpecific, 30)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ByteBacked.Zero, false, "0A0100")] [InlineData(AsnEncodingRules.CER, ReadEnumerated.ByteBacked.NotFluffy, true, "9A010B")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.ByteBacked.Fluff, false, "0A010C")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ByteBacked.Fluff, true, "9A010C")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ByteBacked)253, false, "0A0200FD")] public void VerifyWriteEnumerated_Byte( AsnEncodingRules ruleSet, ReadEnumerated.ByteBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.ContextSpecific, 26)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ShortBacked.Zero, true, "DF81540100")] [InlineData(AsnEncodingRules.CER, ReadEnumerated.ShortBacked.Pillow, true, "DF815402FC00")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.ShortBacked.Fluff, false, "0A020209")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ShortBacked.Fluff, true, "DF8154020209")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ShortBacked)25321, false, "0A0262E9")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ShortBacked)(-12345), false, "0A02CFC7")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ShortBacked)(-1), true, "DF815401FF")] public void VerifyWriteEnumerated_Short( AsnEncodingRules ruleSet, ReadEnumerated.ShortBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.Private, 212)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UShortBacked.Zero, false, "0A0100")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UShortBacked.Zero, true, "4D0100")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.UShortBacked.Fluff, false, "0A03008000")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UShortBacked.Fluff, true, "4D03008000")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.UShortBacked)11, false, "0A010B")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.UShortBacked)short.MaxValue, false, "0A027FFF")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.UShortBacked)ushort.MaxValue, true, "4D0300FFFF")] public void VerifyWriteEnumerated_UShort( AsnEncodingRules ruleSet, ReadEnumerated.UShortBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.Application, 13)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.IntBacked.Zero, true, "5F81FF7F0100")] [InlineData(AsnEncodingRules.CER, ReadEnumerated.IntBacked.Pillow, true, "5F81FF7F03FEFFFF")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.IntBacked.Fluff, false, "0A03010001")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.IntBacked.Fluff, true, "5F81FF7F03010001")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.IntBacked)25321, false, "0A0262E9")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.IntBacked)(-12345), false, "0A02CFC7")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.IntBacked)(-1), true, "5F81FF7F01FF")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.IntBacked)int.MinValue, true, "5F81FF7F0480000000")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.IntBacked)int.MaxValue, false, "0A047FFFFFFF")] public void VerifyWriteEnumerated_Int( AsnEncodingRules ruleSet, ReadEnumerated.IntBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.Application, short.MaxValue)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UIntBacked.Zero, false, "0A0100")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UIntBacked.Zero, true, "9F610100")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.UIntBacked.Fluff, false, "0A050080000005")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UIntBacked.Fluff, true, "9F61050080000005")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.UIntBacked)11, false, "0A010B")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.UIntBacked)short.MaxValue, false, "0A027FFF")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.UIntBacked)ushort.MaxValue, true, "9F610300FFFF")] public void VerifyWriteEnumerated_UInt( AsnEncodingRules ruleSet, ReadEnumerated.UIntBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.ContextSpecific, 97)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.LongBacked.Zero, true, "800100")] [InlineData(AsnEncodingRules.CER, ReadEnumerated.LongBacked.Pillow, true, "8005FF00000000")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.LongBacked.Fluff, false, "0A050200000441")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.LongBacked.Fluff, true, "80050200000441")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.LongBacked)25321, false, "0A0262E9")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.LongBacked)(-12345), false, "0A02CFC7")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.LongBacked)(-1), true, "8001FF")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.LongBacked)int.MinValue, true, "800480000000")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.LongBacked)int.MaxValue, false, "0A047FFFFFFF")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.LongBacked)long.MinValue, false, "0A088000000000000000")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.LongBacked)long.MaxValue, true, "80087FFFFFFFFFFFFFFF")] public void VerifyWriteEnumerated_Long( AsnEncodingRules ruleSet, ReadEnumerated.LongBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.ContextSpecific, 0)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ULongBacked.Zero, false, "0A0100")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ULongBacked.Zero, true, "C10100")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.ULongBacked.Fluff, false, "0A0900FACEF00DCAFEBEEF")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ULongBacked.Fluff, true, "C10900FACEF00DCAFEBEEF")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ULongBacked)11, false, "0A010B")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.ULongBacked)short.MaxValue, false, "0A027FFF")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.ULongBacked)ushort.MaxValue, true, "C10300FFFF")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ULongBacked)long.MaxValue, true, "C1087FFFFFFFFFFFFFFF")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.ULongBacked)ulong.MaxValue, false, "0A0900FFFFFFFFFFFFFFFF")] public void VerifyWriteEnumerated_ULong( AsnEncodingRules ruleSet, ReadEnumerated.ULongBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.Private, 1)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public void VerifyFlagsBased(AsnEncodingRules ruleSet) { AsnWriter writer = new AsnWriter(ruleSet); AssertExtensions.Throws<ArgumentException>( "tEnum", () => writer.WriteEnumeratedValue(OpenFlags.IncludeArchived)); AssertExtensions.Throws<ArgumentException>( "tEnum", () => writer.WriteEnumeratedValue( OpenFlags.IncludeArchived, new Asn1Tag(TagClass.ContextSpecific, 13))); AssertExtensions.Throws<ArgumentException>( "tEnum", () => writer.WriteEnumeratedValue((Enum)OpenFlags.IncludeArchived)); AssertExtensions.Throws<ArgumentException>( "tEnum", () => writer.WriteEnumeratedValue( (Enum)OpenFlags.IncludeArchived, new Asn1Tag(TagClass.ContextSpecific, 13))); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public void VerifyNull(AsnEncodingRules ruleSet) { AsnWriter writer = new AsnWriter(ruleSet); AssertExtensions.Throws<ArgumentException>( "tag", () => writer.WriteEnumeratedValue(ReadEnumerated.IntBacked.Pillow, Asn1Tag.Null)); AssertExtensions.Throws<ArgumentException>( "tag", () => writer.WriteEnumeratedValue((Enum)ReadEnumerated.IntBacked.Pillow, Asn1Tag.Null)); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public static void VerifyWriteEnumeratedValue_NonNull(AsnEncodingRules ruleSet) { AsnWriter writer = new AsnWriter(ruleSet); AssertExtensions.Throws<ArgumentNullException>( "value", () => writer.WriteEnumeratedValue(null)); AssertExtensions.Throws<ArgumentNullException>( "value", () => writer.WriteEnumeratedValue( null, new Asn1Tag(TagClass.ContextSpecific, 1))); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public static void VerifyWriteEnumeratedValue_Object(AsnEncodingRules ruleSet) { AsnWriter objWriter = new AsnWriter(ruleSet); AsnWriter genWriter = new AsnWriter(ruleSet); genWriter.WriteEnumeratedValue(ReadEnumerated.UIntBacked.Fluff); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.UIntBacked.Fluff); genWriter.WriteEnumeratedValue(ReadEnumerated.SByteBacked.Fluff); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.SByteBacked.Fluff); genWriter.WriteEnumeratedValue(ReadEnumerated.ULongBacked.Fluff); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.ULongBacked.Fluff); Verify(objWriter, genWriter.Encode().ByteArrayToHex()); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public static void VerifyWriteEnumeratedValue_Object_WithTag(AsnEncodingRules ruleSet) { AsnWriter objWriter = new AsnWriter(ruleSet); AsnWriter genWriter = new AsnWriter(ruleSet); Asn1Tag tag = new Asn1Tag(TagClass.ContextSpecific, 52); genWriter.WriteEnumeratedValue(ReadEnumerated.UIntBacked.Fluff, tag); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.UIntBacked.Fluff, tag); tag = new Asn1Tag(TagClass.Private, 4); genWriter.WriteEnumeratedValue(ReadEnumerated.SByteBacked.Fluff, tag); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.SByteBacked.Fluff, tag); tag = new Asn1Tag(TagClass.Application, 75); genWriter.WriteEnumeratedValue(ReadEnumerated.ULongBacked.Fluff, tag); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.ULongBacked.Fluff, tag); Verify(objWriter, genWriter.Encode().ByteArrayToHex()); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public void VerifyWriteEnumeratedValue_ConstructedIgnored(AsnEncodingRules ruleSet) { AsnWriter writer = new AsnWriter(ruleSet); writer.WriteEnumeratedValue( ReadEnumerated.ULongBacked.Fluff, new Asn1Tag(UniversalTagNumber.Enumerated, isConstructed: true)); writer.WriteEnumeratedValue( (Enum)ReadEnumerated.SByteBacked.Fluff, new Asn1Tag(TagClass.ContextSpecific, 0, isConstructed: true)); Verify(writer, "0A0900FACEF00DCAFEBEEF" + "800153"); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Formats.Asn1.Tests.Reader; using System.Security.Cryptography.X509Certificates; using Test.Cryptography; using Xunit; namespace System.Formats.Asn1.Tests.Writer { public class WriteEnumerated : Asn1WriterTests { [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.SByteBacked.Zero, false, "0A0100")] [InlineData(AsnEncodingRules.CER, ReadEnumerated.SByteBacked.Pillow, true, "9E01EF")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.SByteBacked.Fluff, false, "0A0153")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.SByteBacked.Fluff, true, "9E0153")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.SByteBacked)(-127), true, "9E0181")] public void VerifyWriteEnumerated_SByte( AsnEncodingRules ruleSet, ReadEnumerated.SByteBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.ContextSpecific, 30)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ByteBacked.Zero, false, "0A0100")] [InlineData(AsnEncodingRules.CER, ReadEnumerated.ByteBacked.NotFluffy, true, "9A010B")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.ByteBacked.Fluff, false, "0A010C")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ByteBacked.Fluff, true, "9A010C")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ByteBacked)253, false, "0A0200FD")] public void VerifyWriteEnumerated_Byte( AsnEncodingRules ruleSet, ReadEnumerated.ByteBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.ContextSpecific, 26)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ShortBacked.Zero, true, "DF81540100")] [InlineData(AsnEncodingRules.CER, ReadEnumerated.ShortBacked.Pillow, true, "DF815402FC00")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.ShortBacked.Fluff, false, "0A020209")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ShortBacked.Fluff, true, "DF8154020209")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ShortBacked)25321, false, "0A0262E9")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ShortBacked)(-12345), false, "0A02CFC7")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ShortBacked)(-1), true, "DF815401FF")] public void VerifyWriteEnumerated_Short( AsnEncodingRules ruleSet, ReadEnumerated.ShortBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.Private, 212)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UShortBacked.Zero, false, "0A0100")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UShortBacked.Zero, true, "4D0100")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.UShortBacked.Fluff, false, "0A03008000")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UShortBacked.Fluff, true, "4D03008000")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.UShortBacked)11, false, "0A010B")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.UShortBacked)short.MaxValue, false, "0A027FFF")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.UShortBacked)ushort.MaxValue, true, "4D0300FFFF")] public void VerifyWriteEnumerated_UShort( AsnEncodingRules ruleSet, ReadEnumerated.UShortBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.Application, 13)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.IntBacked.Zero, true, "5F81FF7F0100")] [InlineData(AsnEncodingRules.CER, ReadEnumerated.IntBacked.Pillow, true, "5F81FF7F03FEFFFF")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.IntBacked.Fluff, false, "0A03010001")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.IntBacked.Fluff, true, "5F81FF7F03010001")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.IntBacked)25321, false, "0A0262E9")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.IntBacked)(-12345), false, "0A02CFC7")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.IntBacked)(-1), true, "5F81FF7F01FF")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.IntBacked)int.MinValue, true, "5F81FF7F0480000000")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.IntBacked)int.MaxValue, false, "0A047FFFFFFF")] public void VerifyWriteEnumerated_Int( AsnEncodingRules ruleSet, ReadEnumerated.IntBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.Application, short.MaxValue)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UIntBacked.Zero, false, "0A0100")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UIntBacked.Zero, true, "9F610100")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.UIntBacked.Fluff, false, "0A050080000005")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.UIntBacked.Fluff, true, "9F61050080000005")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.UIntBacked)11, false, "0A010B")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.UIntBacked)short.MaxValue, false, "0A027FFF")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.UIntBacked)ushort.MaxValue, true, "9F610300FFFF")] public void VerifyWriteEnumerated_UInt( AsnEncodingRules ruleSet, ReadEnumerated.UIntBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.ContextSpecific, 97)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.LongBacked.Zero, true, "800100")] [InlineData(AsnEncodingRules.CER, ReadEnumerated.LongBacked.Pillow, true, "8005FF00000000")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.LongBacked.Fluff, false, "0A050200000441")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.LongBacked.Fluff, true, "80050200000441")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.LongBacked)25321, false, "0A0262E9")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.LongBacked)(-12345), false, "0A02CFC7")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.LongBacked)(-1), true, "8001FF")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.LongBacked)int.MinValue, true, "800480000000")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.LongBacked)int.MaxValue, false, "0A047FFFFFFF")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.LongBacked)long.MinValue, false, "0A088000000000000000")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.LongBacked)long.MaxValue, true, "80087FFFFFFFFFFFFFFF")] public void VerifyWriteEnumerated_Long( AsnEncodingRules ruleSet, ReadEnumerated.LongBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.ContextSpecific, 0)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ULongBacked.Zero, false, "0A0100")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ULongBacked.Zero, true, "C10100")] [InlineData(AsnEncodingRules.DER, ReadEnumerated.ULongBacked.Fluff, false, "0A0900FACEF00DCAFEBEEF")] [InlineData(AsnEncodingRules.BER, ReadEnumerated.ULongBacked.Fluff, true, "C10900FACEF00DCAFEBEEF")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ULongBacked)11, false, "0A010B")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.ULongBacked)short.MaxValue, false, "0A027FFF")] [InlineData(AsnEncodingRules.BER, (ReadEnumerated.ULongBacked)ushort.MaxValue, true, "C10300FFFF")] [InlineData(AsnEncodingRules.CER, (ReadEnumerated.ULongBacked)long.MaxValue, true, "C1087FFFFFFFFFFFFFFF")] [InlineData(AsnEncodingRules.DER, (ReadEnumerated.ULongBacked)ulong.MaxValue, false, "0A0900FFFFFFFFFFFFFFFF")] public void VerifyWriteEnumerated_ULong( AsnEncodingRules ruleSet, ReadEnumerated.ULongBacked value, bool customTag, string expectedHex) { AsnWriter writer = new AsnWriter(ruleSet); if (customTag) { writer.WriteEnumeratedValue(value, new Asn1Tag(TagClass.Private, 1)); } else { writer.WriteEnumeratedValue(value); } Verify(writer, expectedHex); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public void VerifyFlagsBased(AsnEncodingRules ruleSet) { AsnWriter writer = new AsnWriter(ruleSet); AssertExtensions.Throws<ArgumentException>( "tEnum", () => writer.WriteEnumeratedValue(OpenFlags.IncludeArchived)); AssertExtensions.Throws<ArgumentException>( "tEnum", () => writer.WriteEnumeratedValue( OpenFlags.IncludeArchived, new Asn1Tag(TagClass.ContextSpecific, 13))); AssertExtensions.Throws<ArgumentException>( "tEnum", () => writer.WriteEnumeratedValue((Enum)OpenFlags.IncludeArchived)); AssertExtensions.Throws<ArgumentException>( "tEnum", () => writer.WriteEnumeratedValue( (Enum)OpenFlags.IncludeArchived, new Asn1Tag(TagClass.ContextSpecific, 13))); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public void VerifyNull(AsnEncodingRules ruleSet) { AsnWriter writer = new AsnWriter(ruleSet); AssertExtensions.Throws<ArgumentException>( "tag", () => writer.WriteEnumeratedValue(ReadEnumerated.IntBacked.Pillow, Asn1Tag.Null)); AssertExtensions.Throws<ArgumentException>( "tag", () => writer.WriteEnumeratedValue((Enum)ReadEnumerated.IntBacked.Pillow, Asn1Tag.Null)); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public static void VerifyWriteEnumeratedValue_NonNull(AsnEncodingRules ruleSet) { AsnWriter writer = new AsnWriter(ruleSet); AssertExtensions.Throws<ArgumentNullException>( "value", () => writer.WriteEnumeratedValue(null)); AssertExtensions.Throws<ArgumentNullException>( "value", () => writer.WriteEnumeratedValue( null, new Asn1Tag(TagClass.ContextSpecific, 1))); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public static void VerifyWriteEnumeratedValue_Object(AsnEncodingRules ruleSet) { AsnWriter objWriter = new AsnWriter(ruleSet); AsnWriter genWriter = new AsnWriter(ruleSet); genWriter.WriteEnumeratedValue(ReadEnumerated.UIntBacked.Fluff); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.UIntBacked.Fluff); genWriter.WriteEnumeratedValue(ReadEnumerated.SByteBacked.Fluff); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.SByteBacked.Fluff); genWriter.WriteEnumeratedValue(ReadEnumerated.ULongBacked.Fluff); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.ULongBacked.Fluff); Verify(objWriter, genWriter.Encode().ByteArrayToHex()); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public static void VerifyWriteEnumeratedValue_Object_WithTag(AsnEncodingRules ruleSet) { AsnWriter objWriter = new AsnWriter(ruleSet); AsnWriter genWriter = new AsnWriter(ruleSet); Asn1Tag tag = new Asn1Tag(TagClass.ContextSpecific, 52); genWriter.WriteEnumeratedValue(ReadEnumerated.UIntBacked.Fluff, tag); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.UIntBacked.Fluff, tag); tag = new Asn1Tag(TagClass.Private, 4); genWriter.WriteEnumeratedValue(ReadEnumerated.SByteBacked.Fluff, tag); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.SByteBacked.Fluff, tag); tag = new Asn1Tag(TagClass.Application, 75); genWriter.WriteEnumeratedValue(ReadEnumerated.ULongBacked.Fluff, tag); objWriter.WriteEnumeratedValue((Enum)ReadEnumerated.ULongBacked.Fluff, tag); Verify(objWriter, genWriter.Encode().ByteArrayToHex()); } [Theory] [InlineData(AsnEncodingRules.BER)] [InlineData(AsnEncodingRules.CER)] [InlineData(AsnEncodingRules.DER)] public void VerifyWriteEnumeratedValue_ConstructedIgnored(AsnEncodingRules ruleSet) { AsnWriter writer = new AsnWriter(ruleSet); writer.WriteEnumeratedValue( ReadEnumerated.ULongBacked.Fluff, new Asn1Tag(UniversalTagNumber.Enumerated, isConstructed: true)); writer.WriteEnumeratedValue( (Enum)ReadEnumerated.SByteBacked.Fluff, new Asn1Tag(TagClass.ContextSpecific, 0, isConstructed: true)); Verify(writer, "0A0900FACEF00DCAFEBEEF" + "800153"); } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/baseservices/threading/threadstatic/threadstatic07.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="threadstatic07.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="threadstatic07.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/HardwareIntrinsics/General/Vector64/OnesComplement.Single.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; namespace JIT.HardwareIntrinsics.General { public static partial class Program { private static void OnesComplementSingle() { var test = new VectorUnaryOpTest__OnesComplementSingle(); // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); // Validates passing a static member works test.RunClsVarScenario(); // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); // Validates passing the field of a local class works test.RunClassLclFldScenario(); // Validates passing an instance member of a class works test.RunClassFldScenario(); // Validates passing the field of a local struct works test.RunStructLclFldScenario(); // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class VectorUnaryOpTest__OnesComplementSingle { private struct DataTable { private byte[] inArray1; private byte[] outArray; private GCHandle inHandle1; private GCHandle outHandle; private ulong alignment; public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Single>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>(); if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Single, byte>(ref inArray1[0]), (uint)sizeOfinArray1); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector64<Single> _fld1; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>()); return testStruct; } public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementSingle testClass) { var result = Vector64.OnesComplement(_fld1); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); } } private static readonly int LargestVectorSize = 8; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single); private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single); private static Single[] _data1 = new Single[Op1ElementCount]; private static Vector64<Single> _clsVar1; private Vector64<Single> _fld1; private DataTable _dataTable; static VectorUnaryOpTest__OnesComplementSingle() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>()); } public VectorUnaryOpTest__OnesComplementSingle() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); } public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = Vector64.OnesComplement( Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var method = typeof(Vector64).GetMethod(nameof(Vector64.OnesComplement), new Type[] { typeof(Vector64<Single>) }); if (method is null) { method = typeof(Vector64).GetMethod(nameof(Vector64.OnesComplement), 1, new Type[] { typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) }); } if (method.IsGenericMethodDefinition) { method = method.MakeGenericMethod(typeof(Single)); } var result = method.Invoke(null, new object[] { Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = Vector64.OnesComplement( _clsVar1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _dataTable.outArrayPtr); } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr); var result = Vector64.OnesComplement(op1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new VectorUnaryOpTest__OnesComplementSingle(); var result = Vector64.OnesComplement(test._fld1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, _dataTable.outArrayPtr); } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = Vector64.OnesComplement(_fld1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _dataTable.outArrayPtr); } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = Vector64.OnesComplement(test._fld1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } private void ValidateResult(Vector64<Single> op1, void* result, [CallerMemberName] string method = "") { Single[] inArray1 = new Single[Op1ElementCount]; Single[] outArray = new Single[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), op1); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>()); ValidateResult(inArray1, outArray, method); } private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") { Single[] inArray1 = new Single[Op1ElementCount]; Single[] outArray = new Single[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Single>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>()); ValidateResult(inArray1, outArray, method); } private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") { bool succeeded = true; if (BitConverter.SingleToInt32Bits(result[0]) != ~BitConverter.SingleToInt32Bits(firstOp[0])) { succeeded = false; } else { for (var i = 1; i < RetElementCount; i++) { if (BitConverter.SingleToInt32Bits(result[i]) != ~BitConverter.SingleToInt32Bits(firstOp[i])) { succeeded = false; break; } } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(Vector64)}.{nameof(Vector64.OnesComplement)}<Single>(Vector64<Single>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; namespace JIT.HardwareIntrinsics.General { public static partial class Program { private static void OnesComplementSingle() { var test = new VectorUnaryOpTest__OnesComplementSingle(); // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); // Validates passing a static member works test.RunClsVarScenario(); // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); // Validates passing the field of a local class works test.RunClassLclFldScenario(); // Validates passing an instance member of a class works test.RunClassFldScenario(); // Validates passing the field of a local struct works test.RunStructLclFldScenario(); // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class VectorUnaryOpTest__OnesComplementSingle { private struct DataTable { private byte[] inArray1; private byte[] outArray; private GCHandle inHandle1; private GCHandle outHandle; private ulong alignment; public DataTable(Single[] inArray1, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Single>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>(); if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Single, byte>(ref inArray1[0]), (uint)sizeOfinArray1); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector64<Single> _fld1; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>()); return testStruct; } public void RunStructFldScenario(VectorUnaryOpTest__OnesComplementSingle testClass) { var result = Vector64.OnesComplement(_fld1); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr); } } private static readonly int LargestVectorSize = 8; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single); private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single); private static Single[] _data1 = new Single[Op1ElementCount]; private static Vector64<Single> _clsVar1; private Vector64<Single> _fld1; private DataTable _dataTable; static VectorUnaryOpTest__OnesComplementSingle() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>()); } public VectorUnaryOpTest__OnesComplementSingle() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } _dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize); } public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = Vector64.OnesComplement( Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var method = typeof(Vector64).GetMethod(nameof(Vector64.OnesComplement), new Type[] { typeof(Vector64<Single>) }); if (method is null) { method = typeof(Vector64).GetMethod(nameof(Vector64.OnesComplement), 1, new Type[] { typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) }); } if (method.IsGenericMethodDefinition) { method = method.MakeGenericMethod(typeof(Single)); } var result = method.Invoke(null, new object[] { Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = Vector64.OnesComplement( _clsVar1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _dataTable.outArrayPtr); } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr); var result = Vector64.OnesComplement(op1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new VectorUnaryOpTest__OnesComplementSingle(); var result = Vector64.OnesComplement(test._fld1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, _dataTable.outArrayPtr); } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = Vector64.OnesComplement(_fld1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _dataTable.outArrayPtr); } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = Vector64.OnesComplement(test._fld1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } private void ValidateResult(Vector64<Single> op1, void* result, [CallerMemberName] string method = "") { Single[] inArray1 = new Single[Op1ElementCount]; Single[] outArray = new Single[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), op1); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>()); ValidateResult(inArray1, outArray, method); } private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "") { Single[] inArray1 = new Single[Op1ElementCount]; Single[] outArray = new Single[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Single>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>()); ValidateResult(inArray1, outArray, method); } private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") { bool succeeded = true; if (BitConverter.SingleToInt32Bits(result[0]) != ~BitConverter.SingleToInt32Bits(firstOp[0])) { succeeded = false; } else { for (var i = 1; i < RetElementCount; i++) { if (BitConverter.SingleToInt32Bits(result[i]) != ~BitConverter.SingleToInt32Bits(firstOp[i])) { succeeded = false; break; } } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(Vector64)}.{nameof(Vector64.OnesComplement)}<Single>(Vector64<Single>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.Private.Xml/tests/Xslt/TestFiles/TestData/xsltc/baseline/cnt1.txt
<?xml version="1.0" encoding="utf-8"?>Hello, world!
<?xml version="1.0" encoding="utf-8"?>Hello, world!
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/ComponentChangedEventArgs.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.ComponentModel.Design { /// <summary> /// Provides data for the <see cref='System.ComponentModel.Design.IComponentChangeService.ComponentChanged'/> event. /// </summary> public sealed class ComponentChangedEventArgs : EventArgs { /// <summary> /// Gets or sets the component that is the cause of this event. /// </summary> public object? Component { get; } /// <summary> /// Gets or sets the member that is about to change. /// </summary> public MemberDescriptor? Member { get; } /// <summary> /// Gets or sets the new value of the changed member. /// </summary> public object? NewValue { get; } /// <summary> /// Gets or sets the old value of the changed member. /// </summary> public object? OldValue { get; } /// <summary> /// Initializes a new instance of the <see cref='System.ComponentModel.Design.ComponentChangedEventArgs'/> class. /// </summary> public ComponentChangedEventArgs(object? component, MemberDescriptor? member, object? oldValue, object? newValue) { Component = component; Member = member; OldValue = oldValue; NewValue = newValue; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.ComponentModel.Design { /// <summary> /// Provides data for the <see cref='System.ComponentModel.Design.IComponentChangeService.ComponentChanged'/> event. /// </summary> public sealed class ComponentChangedEventArgs : EventArgs { /// <summary> /// Gets or sets the component that is the cause of this event. /// </summary> public object? Component { get; } /// <summary> /// Gets or sets the member that is about to change. /// </summary> public MemberDescriptor? Member { get; } /// <summary> /// Gets or sets the new value of the changed member. /// </summary> public object? NewValue { get; } /// <summary> /// Gets or sets the old value of the changed member. /// </summary> public object? OldValue { get; } /// <summary> /// Initializes a new instance of the <see cref='System.ComponentModel.Design.ComponentChangedEventArgs'/> class. /// </summary> public ComponentChangedEventArgs(object? component, MemberDescriptor? member, object? oldValue, object? newValue) { Component = component; Member = member; OldValue = oldValue; NewValue = newValue; } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/Generics/Parameters/static_passing_class01.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="static_passing_class01.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="static_passing_class01.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSAWrapper.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; using System.IO; namespace System.Security.Cryptography { internal sealed class RSAWrapper : RSA { private readonly RSA _wrapped; internal RSAWrapper(RSA wrapped) { Debug.Assert(wrapped != null); _wrapped = wrapped; } public override int KeySize { get => _wrapped.KeySize; set => _wrapped.KeySize = value; } public override KeySizes[] LegalKeySizes => _wrapped.LegalKeySizes; public override byte[] ExportEncryptedPkcs8PrivateKey( ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters) => _wrapped.ExportEncryptedPkcs8PrivateKey(passwordBytes, pbeParameters); public override byte[] ExportEncryptedPkcs8PrivateKey( ReadOnlySpan<char> password, PbeParameters pbeParameters) => _wrapped.ExportEncryptedPkcs8PrivateKey(password, pbeParameters); public override byte[] ExportPkcs8PrivateKey() => _wrapped.ExportPkcs8PrivateKey(); public override byte[] ExportSubjectPublicKeyInfo() => _wrapped.ExportSubjectPublicKeyInfo(); public override void FromXmlString(string xmlString) => _wrapped.FromXmlString(xmlString); public override string ToXmlString(bool includePrivateParameters) => _wrapped.ToXmlString(includePrivateParameters); public override RSAParameters ExportParameters(bool includePrivateParameters) => _wrapped.ExportParameters(includePrivateParameters); public override void ImportParameters(RSAParameters parameters) => _wrapped.ImportParameters(parameters); public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) => _wrapped.Encrypt(data, padding); public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) => _wrapped.Decrypt(data, padding); public override byte[] SignHash( byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.SignHash(hash, hashAlgorithm, padding); public override bool VerifyHash( byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.VerifyHash(hash, signature, hashAlgorithm, padding); public override bool TryDecrypt( ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) => _wrapped.TryDecrypt(data, destination, padding, out bytesWritten); public override bool TryEncrypt( ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) => _wrapped.TryEncrypt(data, destination, padding, out bytesWritten); public override bool TrySignHash( ReadOnlySpan<byte> hash, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) => _wrapped.TrySignHash(hash, destination, hashAlgorithm, padding, out bytesWritten); public override bool VerifyHash( ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.VerifyHash(hash, signature, hashAlgorithm, padding); public override byte[] DecryptValue(byte[] rgb) => _wrapped.DecryptValue(rgb); public override byte[] EncryptValue(byte[] rgb) => _wrapped.EncryptValue(rgb); public override byte[] SignData( byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.SignData(data, offset, count, hashAlgorithm, padding); public override byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.SignData(data, hashAlgorithm, padding); public override bool TrySignData( ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) => _wrapped.TrySignData(data, destination, hashAlgorithm, padding, out bytesWritten); public override bool VerifyData( byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.VerifyData(data, offset, count, signature, hashAlgorithm, padding); public override bool VerifyData( ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.VerifyData(data, signature, hashAlgorithm, padding); public override byte[] ExportRSAPrivateKey() => _wrapped.ExportRSAPrivateKey(); public override bool TryExportRSAPrivateKey(Span<byte> destination, out int bytesWritten) => _wrapped.TryExportRSAPrivateKey(destination, out bytesWritten); public override byte[] ExportRSAPublicKey() => _wrapped.ExportRSAPublicKey(); public override bool TryExportRSAPublicKey(Span<byte> destination, out int bytesWritten) => _wrapped.TryExportRSAPublicKey(destination, out bytesWritten); public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) => _wrapped.TryExportSubjectPublicKeyInfo(destination, out bytesWritten); public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) => _wrapped.TryExportPkcs8PrivateKey(destination, out bytesWritten); public override bool TryExportEncryptedPkcs8PrivateKey( ReadOnlySpan<char> password, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten) => _wrapped.TryExportEncryptedPkcs8PrivateKey(password, pbeParameters, destination, out bytesWritten); public override bool TryExportEncryptedPkcs8PrivateKey( ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten) => _wrapped.TryExportEncryptedPkcs8PrivateKey(passwordBytes, pbeParameters, destination, out bytesWritten); public override void ImportSubjectPublicKeyInfo(ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportSubjectPublicKeyInfo(source, out bytesRead); public override void ImportRSAPublicKey(ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportRSAPublicKey(source, out bytesRead); public override void ImportRSAPrivateKey(ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportRSAPrivateKey(source, out bytesRead); public override void ImportPkcs8PrivateKey(ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportPkcs8PrivateKey(source, out bytesRead); public override void ImportEncryptedPkcs8PrivateKey( ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportEncryptedPkcs8PrivateKey(passwordBytes, source, out bytesRead); public override void ImportEncryptedPkcs8PrivateKey( ReadOnlySpan<char> password, ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportEncryptedPkcs8PrivateKey(password, source, out bytesRead); public override void ImportFromPem(ReadOnlySpan<char> input) => _wrapped.ImportFromPem(input); public override void ImportFromEncryptedPem(ReadOnlySpan<char> input, ReadOnlySpan<char> password) => _wrapped.ImportFromEncryptedPem(input, password); public override void ImportFromEncryptedPem(ReadOnlySpan<char> input, ReadOnlySpan<byte> passwordBytes) => _wrapped.ImportFromEncryptedPem(input, passwordBytes); public override string? KeyExchangeAlgorithm => _wrapped.KeyExchangeAlgorithm; public override string SignatureAlgorithm => _wrapped.SignatureAlgorithm; protected override void Dispose(bool disposing) { if (disposing) { _wrapped.Dispose(); } base.Dispose(disposing); } public override bool Equals(object? obj) => _wrapped.Equals(obj); public override int GetHashCode() => _wrapped.GetHashCode(); public override string ToString() => _wrapped.ToString()!; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; using System.IO; namespace System.Security.Cryptography { internal sealed class RSAWrapper : RSA { private readonly RSA _wrapped; internal RSAWrapper(RSA wrapped) { Debug.Assert(wrapped != null); _wrapped = wrapped; } public override int KeySize { get => _wrapped.KeySize; set => _wrapped.KeySize = value; } public override KeySizes[] LegalKeySizes => _wrapped.LegalKeySizes; public override byte[] ExportEncryptedPkcs8PrivateKey( ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters) => _wrapped.ExportEncryptedPkcs8PrivateKey(passwordBytes, pbeParameters); public override byte[] ExportEncryptedPkcs8PrivateKey( ReadOnlySpan<char> password, PbeParameters pbeParameters) => _wrapped.ExportEncryptedPkcs8PrivateKey(password, pbeParameters); public override byte[] ExportPkcs8PrivateKey() => _wrapped.ExportPkcs8PrivateKey(); public override byte[] ExportSubjectPublicKeyInfo() => _wrapped.ExportSubjectPublicKeyInfo(); public override void FromXmlString(string xmlString) => _wrapped.FromXmlString(xmlString); public override string ToXmlString(bool includePrivateParameters) => _wrapped.ToXmlString(includePrivateParameters); public override RSAParameters ExportParameters(bool includePrivateParameters) => _wrapped.ExportParameters(includePrivateParameters); public override void ImportParameters(RSAParameters parameters) => _wrapped.ImportParameters(parameters); public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) => _wrapped.Encrypt(data, padding); public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) => _wrapped.Decrypt(data, padding); public override byte[] SignHash( byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.SignHash(hash, hashAlgorithm, padding); public override bool VerifyHash( byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.VerifyHash(hash, signature, hashAlgorithm, padding); public override bool TryDecrypt( ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) => _wrapped.TryDecrypt(data, destination, padding, out bytesWritten); public override bool TryEncrypt( ReadOnlySpan<byte> data, Span<byte> destination, RSAEncryptionPadding padding, out int bytesWritten) => _wrapped.TryEncrypt(data, destination, padding, out bytesWritten); public override bool TrySignHash( ReadOnlySpan<byte> hash, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) => _wrapped.TrySignHash(hash, destination, hashAlgorithm, padding, out bytesWritten); public override bool VerifyHash( ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.VerifyHash(hash, signature, hashAlgorithm, padding); public override byte[] DecryptValue(byte[] rgb) => _wrapped.DecryptValue(rgb); public override byte[] EncryptValue(byte[] rgb) => _wrapped.EncryptValue(rgb); public override byte[] SignData( byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.SignData(data, offset, count, hashAlgorithm, padding); public override byte[] SignData(Stream data, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.SignData(data, hashAlgorithm, padding); public override bool TrySignData( ReadOnlySpan<byte> data, Span<byte> destination, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding, out int bytesWritten) => _wrapped.TrySignData(data, destination, hashAlgorithm, padding, out bytesWritten); public override bool VerifyData( byte[] data, int offset, int count, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.VerifyData(data, offset, count, signature, hashAlgorithm, padding); public override bool VerifyData( ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) => _wrapped.VerifyData(data, signature, hashAlgorithm, padding); public override byte[] ExportRSAPrivateKey() => _wrapped.ExportRSAPrivateKey(); public override bool TryExportRSAPrivateKey(Span<byte> destination, out int bytesWritten) => _wrapped.TryExportRSAPrivateKey(destination, out bytesWritten); public override byte[] ExportRSAPublicKey() => _wrapped.ExportRSAPublicKey(); public override bool TryExportRSAPublicKey(Span<byte> destination, out int bytesWritten) => _wrapped.TryExportRSAPublicKey(destination, out bytesWritten); public override bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten) => _wrapped.TryExportSubjectPublicKeyInfo(destination, out bytesWritten); public override bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten) => _wrapped.TryExportPkcs8PrivateKey(destination, out bytesWritten); public override bool TryExportEncryptedPkcs8PrivateKey( ReadOnlySpan<char> password, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten) => _wrapped.TryExportEncryptedPkcs8PrivateKey(password, pbeParameters, destination, out bytesWritten); public override bool TryExportEncryptedPkcs8PrivateKey( ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten) => _wrapped.TryExportEncryptedPkcs8PrivateKey(passwordBytes, pbeParameters, destination, out bytesWritten); public override void ImportSubjectPublicKeyInfo(ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportSubjectPublicKeyInfo(source, out bytesRead); public override void ImportRSAPublicKey(ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportRSAPublicKey(source, out bytesRead); public override void ImportRSAPrivateKey(ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportRSAPrivateKey(source, out bytesRead); public override void ImportPkcs8PrivateKey(ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportPkcs8PrivateKey(source, out bytesRead); public override void ImportEncryptedPkcs8PrivateKey( ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportEncryptedPkcs8PrivateKey(passwordBytes, source, out bytesRead); public override void ImportEncryptedPkcs8PrivateKey( ReadOnlySpan<char> password, ReadOnlySpan<byte> source, out int bytesRead) => _wrapped.ImportEncryptedPkcs8PrivateKey(password, source, out bytesRead); public override void ImportFromPem(ReadOnlySpan<char> input) => _wrapped.ImportFromPem(input); public override void ImportFromEncryptedPem(ReadOnlySpan<char> input, ReadOnlySpan<char> password) => _wrapped.ImportFromEncryptedPem(input, password); public override void ImportFromEncryptedPem(ReadOnlySpan<char> input, ReadOnlySpan<byte> passwordBytes) => _wrapped.ImportFromEncryptedPem(input, passwordBytes); public override string? KeyExchangeAlgorithm => _wrapped.KeyExchangeAlgorithm; public override string SignatureAlgorithm => _wrapped.SignatureAlgorithm; protected override void Dispose(bool disposing) { if (disposing) { _wrapped.Dispose(); } base.Dispose(disposing); } public override bool Equals(object? obj) => _wrapped.Equals(obj); public override int GetHashCode() => _wrapped.GetHashCode(); public override string ToString() => _wrapped.ToString()!; } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/NativeRuntimeEventSource.PortableThreadPool.NativeSinks.CoreCLR.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Threading; using System.Diagnostics.Tracing; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace System.Diagnostics.Tracing { // This is part of the NativeRuntimeEventsource, which is the managed version of the Microsoft-Windows-DotNETRuntime provider. // It contains the runtime specific interop to native event sinks. internal sealed partial class NativeRuntimeEventSource : EventSource { [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadStart(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadStop(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadWait(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadAdjustmentSample(double Throughput, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadAdjustmentAdjustment(double AverageThroughput, uint NewWorkerThreadCount, NativeRuntimeEventSource.ThreadAdjustmentReasonMap Reason, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadAdjustmentStats( double Duration, double Throughput, double ThreadPoolWorkerThreadWait, double ThroughputWave, double ThroughputErrorEstimate, double AverageThroughputErrorEstimate, double ThroughputRatio, double Confidence, double NewControlSetting, ushort NewThreadWaveMagnitude, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolIOEnqueue( IntPtr NativeOverlapped, IntPtr Overlapped, [MarshalAs(UnmanagedType.Bool)] bool MultiDequeues, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolIODequeue( IntPtr NativeOverlapped, IntPtr Overlapped, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkingThreadCount( uint Count, ushort ClrInstanceID ); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Threading; using System.Diagnostics.Tracing; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace System.Diagnostics.Tracing { // This is part of the NativeRuntimeEventsource, which is the managed version of the Microsoft-Windows-DotNETRuntime provider. // It contains the runtime specific interop to native event sinks. internal sealed partial class NativeRuntimeEventSource : EventSource { [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadStart(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadStop(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadWait(uint ActiveWorkerThreadCount, uint RetiredWorkerThreadCount, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadAdjustmentSample(double Throughput, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadAdjustmentAdjustment(double AverageThroughput, uint NewWorkerThreadCount, NativeRuntimeEventSource.ThreadAdjustmentReasonMap Reason, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkerThreadAdjustmentStats( double Duration, double Throughput, double ThreadPoolWorkerThreadWait, double ThroughputWave, double ThroughputErrorEstimate, double AverageThroughputErrorEstimate, double ThroughputRatio, double Confidence, double NewControlSetting, ushort NewThreadWaveMagnitude, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolIOEnqueue( IntPtr NativeOverlapped, IntPtr Overlapped, [MarshalAs(UnmanagedType.Bool)] bool MultiDequeues, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolIODequeue( IntPtr NativeOverlapped, IntPtr Overlapped, ushort ClrInstanceID); [NonEvent] [GeneratedDllImport(RuntimeHelpers.QCall)] internal static partial void LogThreadPoolWorkingThreadCount( uint Count, ushort ClrInstanceID ); } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/mono/mono/mini/mini-arm64-gsharedvt.h
/** * \file */ #ifndef __MINI_ARM64_GSHAREDVT_H__ #define __MINI_ARM64_GSHAREDVT_H__ /* Argument marshallings for calls between gsharedvt and normal code */ typedef enum { GSHAREDVT_ARG_NONE = 0, GSHAREDVT_ARG_BYVAL_TO_BYREF = 1, GSHAREDVT_ARG_BYVAL_TO_BYREF_HFAR4 = 2, GSHAREDVT_ARG_BYREF_TO_BYVAL = 3, GSHAREDVT_ARG_BYREF_TO_BYVAL_HFAR4 = 4, GSHAREDVT_ARG_BYREF_TO_BYREF = 5 } GSharedVtArgMarshal; /* For arguments passed on the stack on ios */ typedef enum { GSHAREDVT_ARG_SIZE_NONE = 0, GSHAREDVT_ARG_SIZE_I1 = 1, GSHAREDVT_ARG_SIZE_U1 = 2, GSHAREDVT_ARG_SIZE_I2 = 3, GSHAREDVT_ARG_SIZE_U2 = 4, GSHAREDVT_ARG_SIZE_I4 = 5, GSHAREDVT_ARG_SIZE_U4 = 6, } GSharedVtArgSize; /* Return value marshalling for calls between gsharedvt and normal code */ typedef enum { GSHAREDVT_RET_NONE = 0, GSHAREDVT_RET_I8 = 1, GSHAREDVT_RET_I1 = 2, GSHAREDVT_RET_U1 = 3, GSHAREDVT_RET_I2 = 4, GSHAREDVT_RET_U2 = 5, GSHAREDVT_RET_I4 = 6, GSHAREDVT_RET_U4 = 7, GSHAREDVT_RET_R8 = 8, GSHAREDVT_RET_R4 = 9, GSHAREDVT_RET_IREGS_1 = 10, GSHAREDVT_RET_IREGS_2 = 11, GSHAREDVT_RET_IREGS_3 = 12, GSHAREDVT_RET_IREGS_4 = 13, GSHAREDVT_RET_IREGS_5 = 14, GSHAREDVT_RET_IREGS_6 = 15, GSHAREDVT_RET_IREGS_7 = 16, GSHAREDVT_RET_IREGS_8 = 17, GSHAREDVT_RET_HFAR8_1 = 18, GSHAREDVT_RET_HFAR8_2 = 19, GSHAREDVT_RET_HFAR8_3 = 20, GSHAREDVT_RET_HFAR8_4 = 21, GSHAREDVT_RET_HFAR4_1 = 22, GSHAREDVT_RET_HFAR4_2 = 23, GSHAREDVT_RET_HFAR4_3 = 24, GSHAREDVT_RET_HFAR4_4 = 25, GSHAREDVT_RET_NUM = 26 } GSharedVtRetMarshal; typedef struct { /* Method address to call */ gpointer addr; /* The trampoline reads this, so keep the size explicit */ int ret_marshal; /* If ret_marshal != NONE, this is the reg of the vret arg, else -1 */ /* Equivalent of vret_arg_slot in x86 implementation. */ int vret_arg_reg; /* The stack slot where the return value will be stored */ int vret_slot; int stack_usage, map_count; /* If not -1, then make a virtual call using this vtable offset */ int vcall_offset; /* If 1, make an indirect call to the address in the rgctx reg */ int calli; /* Whenever this is a in or an out call */ int gsharedvt_in; /* Maps stack slots/registers in the caller to the stack slots/registers in the callee */ int map [MONO_ZERO_LEN_ARRAY]; } GSharedVtCallInfo; /* Number of argument registers (r0..r8) */ #define NUM_GSHAREDVT_ARG_GREGS 9 #define NUM_GSHAREDVT_ARG_FREGS 8 gpointer mono_arm_start_gsharedvt_call (GSharedVtCallInfo *info, gpointer *caller, gpointer *callee, gpointer mrgctx_reg); #endif /* __MINI_ARM64_GSHAREDVT_H__ */
/** * \file */ #ifndef __MINI_ARM64_GSHAREDVT_H__ #define __MINI_ARM64_GSHAREDVT_H__ /* Argument marshallings for calls between gsharedvt and normal code */ typedef enum { GSHAREDVT_ARG_NONE = 0, GSHAREDVT_ARG_BYVAL_TO_BYREF = 1, GSHAREDVT_ARG_BYVAL_TO_BYREF_HFAR4 = 2, GSHAREDVT_ARG_BYREF_TO_BYVAL = 3, GSHAREDVT_ARG_BYREF_TO_BYVAL_HFAR4 = 4, GSHAREDVT_ARG_BYREF_TO_BYREF = 5 } GSharedVtArgMarshal; /* For arguments passed on the stack on ios */ typedef enum { GSHAREDVT_ARG_SIZE_NONE = 0, GSHAREDVT_ARG_SIZE_I1 = 1, GSHAREDVT_ARG_SIZE_U1 = 2, GSHAREDVT_ARG_SIZE_I2 = 3, GSHAREDVT_ARG_SIZE_U2 = 4, GSHAREDVT_ARG_SIZE_I4 = 5, GSHAREDVT_ARG_SIZE_U4 = 6, } GSharedVtArgSize; /* Return value marshalling for calls between gsharedvt and normal code */ typedef enum { GSHAREDVT_RET_NONE = 0, GSHAREDVT_RET_I8 = 1, GSHAREDVT_RET_I1 = 2, GSHAREDVT_RET_U1 = 3, GSHAREDVT_RET_I2 = 4, GSHAREDVT_RET_U2 = 5, GSHAREDVT_RET_I4 = 6, GSHAREDVT_RET_U4 = 7, GSHAREDVT_RET_R8 = 8, GSHAREDVT_RET_R4 = 9, GSHAREDVT_RET_IREGS_1 = 10, GSHAREDVT_RET_IREGS_2 = 11, GSHAREDVT_RET_IREGS_3 = 12, GSHAREDVT_RET_IREGS_4 = 13, GSHAREDVT_RET_IREGS_5 = 14, GSHAREDVT_RET_IREGS_6 = 15, GSHAREDVT_RET_IREGS_7 = 16, GSHAREDVT_RET_IREGS_8 = 17, GSHAREDVT_RET_HFAR8_1 = 18, GSHAREDVT_RET_HFAR8_2 = 19, GSHAREDVT_RET_HFAR8_3 = 20, GSHAREDVT_RET_HFAR8_4 = 21, GSHAREDVT_RET_HFAR4_1 = 22, GSHAREDVT_RET_HFAR4_2 = 23, GSHAREDVT_RET_HFAR4_3 = 24, GSHAREDVT_RET_HFAR4_4 = 25, GSHAREDVT_RET_NUM = 26 } GSharedVtRetMarshal; typedef struct { /* Method address to call */ gpointer addr; /* The trampoline reads this, so keep the size explicit */ int ret_marshal; /* If ret_marshal != NONE, this is the reg of the vret arg, else -1 */ /* Equivalent of vret_arg_slot in x86 implementation. */ int vret_arg_reg; /* The stack slot where the return value will be stored */ int vret_slot; int stack_usage, map_count; /* If not -1, then make a virtual call using this vtable offset */ int vcall_offset; /* If 1, make an indirect call to the address in the rgctx reg */ int calli; /* Whenever this is a in or an out call */ int gsharedvt_in; /* Maps stack slots/registers in the caller to the stack slots/registers in the callee */ int map [MONO_ZERO_LEN_ARRAY]; } GSharedVtCallInfo; /* Number of argument registers (r0..r8) */ #define NUM_GSHAREDVT_ARG_GREGS 9 #define NUM_GSHAREDVT_ARG_FREGS 8 gpointer mono_arm_start_gsharedvt_call (GSharedVtCallInfo *info, gpointer *caller, gpointer *callee, gpointer mrgctx_reg); #endif /* __MINI_ARM64_GSHAREDVT_H__ */
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/Loader/classloader/MethodImpl/self_override1.reflect.xml
<linker> <assembly fullname="self_override1"> <type fullname="*" required="true" /> </assembly> </linker>
<linker> <assembly fullname="self_override1"> <type fullname="*" required="true" /> </assembly> </linker>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1300/Generated1300.il
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) .ver 4:0:0:0 } .assembly extern TestFramework { .publickeytoken = ( B0 3F 5F 7F 11 D5 0A 3A ) } //TYPES IN FORWARDER ASSEMBLIES: //TEST ASSEMBLY: .assembly Generated1300 { .hash algorithm 0x00008004 } .assembly extern xunit.core {} .class public BaseClass0 { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } .class public BaseClass1 extends BaseClass0 { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void BaseClass0::.ctor() ret } } .class public G3_C1772`1<T0> extends class G2_C722`2<!T0,class BaseClass1> implements class IBase1`1<class BaseClass1> { .method public hidebysig newslot virtual instance string Method4() cil managed noinlining { ldstr "G3_C1772::Method4.17909()" ret } .method public hidebysig newslot virtual instance string 'IBase1<class BaseClass1>.Method4'() cil managed noinlining { .override method instance string class IBase1`1<class BaseClass1>::Method4() ldstr "G3_C1772::Method4.MI.17910()" ret } .method public hidebysig newslot virtual instance string Method5() cil managed noinlining { ldstr "G3_C1772::Method5.17911()" ret } .method public hidebysig newslot virtual instance string 'IBase1<class BaseClass1>.Method5'() cil managed noinlining { .override method instance string class IBase1`1<class BaseClass1>::Method5() ldstr "G3_C1772::Method5.MI.17912()" ret } .method public hidebysig virtual instance string Method6<M0>() cil managed noinlining { ldstr "G3_C1772::Method6.17913<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod4942() cil managed noinlining { ldstr "G3_C1772::ClassMethod4942.17914()" ret } .method public hidebysig newslot virtual instance string ClassMethod4943() cil managed noinlining { ldstr "G3_C1772::ClassMethod4943.17915()" ret } .method public hidebysig newslot virtual instance string ClassMethod4944<M0>() cil managed noinlining { ldstr "G3_C1772::ClassMethod4944.17916<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod4945<M0>() cil managed noinlining { ldstr "G3_C1772::ClassMethod4945.17917<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string 'G2_C722<T0,class BaseClass1>.ClassMethod2815'() cil managed noinlining { .override method instance string class G2_C722`2<!T0,class BaseClass1>::ClassMethod2815() ldstr "G3_C1772::ClassMethod2815.MI.17918()" ret } .method public hidebysig newslot virtual instance string 'G2_C722<T0,class BaseClass1>.ClassMethod2816'() cil managed noinlining { .override method instance string class G2_C722`2<!T0,class BaseClass1>::ClassMethod2816() ldstr "G3_C1772::ClassMethod2816.MI.17919()" ret } .method public hidebysig newslot virtual instance string 'G2_C722<T0,class BaseClass1>.ClassMethod2818'<M0>() cil managed noinlining { .override method instance string class G2_C722`2<!T0,class BaseClass1>::ClassMethod2818<[1]>() ldstr "G3_C1772::ClassMethod2818.MI.17920<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void class G2_C722`2<!T0,class BaseClass1>::.ctor() ret } } .class public G2_C722`2<T0, T1> extends class G1_C13`2<!T1,class BaseClass0> implements class IBase2`2<class BaseClass1,!T0>, IBase0 { .method public hidebysig virtual instance string Method7<M0>() cil managed noinlining { ldstr "G2_C722::Method7.11654<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string Method0() cil managed noinlining { ldstr "G2_C722::Method0.11655()" ret } .method public hidebysig virtual instance string Method1() cil managed noinlining { ldstr "G2_C722::Method1.11656()" ret } .method public hidebysig newslot virtual instance string Method2<M0>() cil managed noinlining { ldstr "G2_C722::Method2.11657<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig virtual instance string Method3<M0>() cil managed noinlining { ldstr "G2_C722::Method3.11658<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string 'IBase0.Method3'<M0>() cil managed noinlining { .override method instance string IBase0::Method3<[1]>() ldstr "G2_C722::Method3.MI.11659<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod2815() cil managed noinlining { ldstr "G2_C722::ClassMethod2815.11660()" ret } .method public hidebysig newslot virtual instance string ClassMethod2816() cil managed noinlining { ldstr "G2_C722::ClassMethod2816.11661()" ret } .method public hidebysig newslot virtual instance string ClassMethod2817<M0>() cil managed noinlining { ldstr "G2_C722::ClassMethod2817.11662<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod2818<M0>() cil managed noinlining { ldstr "G2_C722::ClassMethod2818.11663<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void class G1_C13`2<!T1,class BaseClass0>::.ctor() ret } } .class interface public abstract IBase1`1<+T0> { .method public hidebysig newslot abstract virtual instance string Method4() cil managed { } .method public hidebysig newslot abstract virtual instance string Method5() cil managed { } .method public hidebysig newslot abstract virtual instance string Method6<M0>() cil managed { } } .class public abstract G1_C13`2<T0, T1> implements class IBase2`2<!T0,!T1>, class IBase1`1<!T0> { .method public hidebysig virtual instance string Method7<M0>() cil managed noinlining { ldstr "G1_C13::Method7.4871<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string Method4() cil managed noinlining { ldstr "G1_C13::Method4.4872()" ret } .method public hidebysig newslot virtual instance string Method5() cil managed noinlining { ldstr "G1_C13::Method5.4873()" ret } .method public hidebysig newslot virtual instance string 'IBase1<T0>.Method5'() cil managed noinlining { .override method instance string class IBase1`1<!T0>::Method5() ldstr "G1_C13::Method5.MI.4874()" ret } .method public hidebysig newslot virtual instance string Method6<M0>() cil managed noinlining { ldstr "G1_C13::Method6.4875<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod1348<M0>() cil managed noinlining { ldstr "G1_C13::ClassMethod1348.4876<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod1349<M0>() cil managed noinlining { ldstr "G1_C13::ClassMethod1349.4877<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } .class interface public abstract IBase2`2<+T0, -T1> { .method public hidebysig newslot abstract virtual instance string Method7<M0>() cil managed { } } .class interface public abstract IBase0 { .method public hidebysig newslot abstract virtual instance string Method0() cil managed { } .method public hidebysig newslot abstract virtual instance string Method1() cil managed { } .method public hidebysig newslot abstract virtual instance string Method2<M0>() cil managed { } .method public hidebysig newslot abstract virtual instance string Method3<M0>() cil managed { } } .class public auto ansi beforefieldinit Generated1300 { .method static void M.BaseClass0<(BaseClass0)W>(!!W inst, string exp) cil managed { .maxstack 5 .locals init (string[] actualResults) ldc.i4.s 0 newarr string stloc.s actualResults ldarg.1 ldstr "M.BaseClass0<(BaseClass0)W>(!!W inst, string exp)" ldc.i4.s 0 ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.BaseClass1<(BaseClass1)W>(!!W inst, string exp) cil managed { .maxstack 5 .locals init (string[] actualResults) ldc.i4.s 0 newarr string stloc.s actualResults ldarg.1 ldstr "M.BaseClass1<(BaseClass1)W>(!!W inst, string exp)" ldc.i4.s 0 ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G3_C1772.T<T0,(class G3_C1772`1<!!T0>)W>(!!W 'inst', string exp) cil managed { .maxstack 23 .locals init (string[] actualResults) ldc.i4.s 18 newarr string stloc.s actualResults ldarg.1 ldstr "M.G3_C1772.T<T0,(class G3_C1772`1<!!T0>)W>(!!W 'inst', string exp)" ldc.i4.s 18 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod4942() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod4943() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod4944<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod4945<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 14 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 15 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 16 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 17 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G3_C1772.A<(class G3_C1772`1<class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 23 .locals init (string[] actualResults) ldc.i4.s 18 newarr string stloc.s actualResults ldarg.1 ldstr "M.G3_C1772.A<(class G3_C1772`1<class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 18 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4942() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4943() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4944<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4945<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 14 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 15 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 16 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 17 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G3_C1772.B<(class G3_C1772`1<class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 23 .locals init (string[] actualResults) ldc.i4.s 18 newarr string stloc.s actualResults ldarg.1 ldstr "M.G3_C1772.B<(class G3_C1772`1<class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 18 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4942() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4943() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4944<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4945<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 14 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 15 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 16 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 17 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.T.T<T0,T1,(class G2_C722`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.T.T<T0,T1,(class G2_C722`2<!!T0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.A.T<T1,(class G2_C722`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.A.T<T1,(class G2_C722`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.A.A<(class G2_C722`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.A.A<(class G2_C722`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.A.B<(class G2_C722`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.A.B<(class G2_C722`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.B.T<T1,(class G2_C722`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.B.T<T1,(class G2_C722`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.B.A<(class G2_C722`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.B.A<(class G2_C722`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.B.B<(class G2_C722`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.B.B<(class G2_C722`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase1.T<T0,(class IBase1`1<!!T0>)W>(!!W 'inst', string exp) cil managed { .maxstack 8 .locals init (string[] actualResults) ldc.i4.s 3 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase1.T<T0,(class IBase1`1<!!T0>)W>(!!W 'inst', string exp)" ldc.i4.s 3 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<!!T0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<!!T0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<!!T0>::Method6<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase1.A<(class IBase1`1<class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 8 .locals init (string[] actualResults) ldc.i4.s 3 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase1.A<(class IBase1`1<class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 3 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase1.B<(class IBase1`1<class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 8 .locals init (string[] actualResults) ldc.i4.s 3 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase1.B<(class IBase1`1<class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 3 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.T.T<T0,T1,(class G1_C13`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.T.T<T0,T1,(class G1_C13`2<!!T0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.A.T<T1,(class G1_C13`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.A.T<T1,(class G1_C13`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.A.A<(class G1_C13`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.A.A<(class G1_C13`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.A.B<(class G1_C13`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.A.B<(class G1_C13`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.B.T<T1,(class G1_C13`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.B.T<T1,(class G1_C13`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.B.A<(class G1_C13`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.B.A<(class G1_C13`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.B.B<(class G1_C13`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.B.B<(class G1_C13`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.T.T<T0,T1,(class IBase2`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.T.T<T0,T1,(class IBase2`2<!!T0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<!!T0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.A.T<T1,(class IBase2`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.A.T<T1,(class IBase2`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.A.A<(class IBase2`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.A.A<(class IBase2`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.A.B<(class IBase2`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.A.B<(class IBase2`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.B.T<T1,(class IBase2`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.B.T<T1,(class IBase2`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass1,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.B.A<(class IBase2`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.B.A<(class IBase2`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.B.B<(class IBase2`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.B.B<(class IBase2`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase0<(IBase0)W>(!!W inst, string exp) cil managed { .maxstack 9 .locals init (string[] actualResults) ldc.i4.s 4 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase0<(IBase0)W>(!!W inst, string exp)" ldc.i4.s 4 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string IBase0::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string IBase0::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string IBase0::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string IBase0::Method3<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method public hidebysig static void MethodCallingTest() cil managed { .maxstack 10 .locals init (object V_0) ldstr "========================== Method Calling Test ==========================" call void [mscorlib]System.Console::WriteLine(string) newobj instance void class G3_C1772`1<class BaseClass0>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass1>::Method4() ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method5() ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2818<object>() ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2816() ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2815() ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4945<object>() ldstr "G3_C1772::ClassMethod4945.17917<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4944<object>() ldstr "G3_C1772::ClassMethod4944.17916<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4943() ldstr "G3_C1772::ClassMethod4943.17915()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4942() ldstr "G3_C1772::ClassMethod4942.17914()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method5() ldstr "G3_C1772::Method5.17911()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method4() ldstr "G3_C1772::Method4.17909()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2818<object>() ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2816() ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2815() ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop newobj instance void class G3_C1772`1<class BaseClass1>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass1>::Method4() ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method5() ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2818<object>() ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2816() ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2815() ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4945<object>() ldstr "G3_C1772::ClassMethod4945.17917<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4944<object>() ldstr "G3_C1772::ClassMethod4944.17916<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4943() ldstr "G3_C1772::ClassMethod4943.17915()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4942() ldstr "G3_C1772::ClassMethod4942.17914()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method5() ldstr "G3_C1772::Method5.17911()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method4() ldstr "G3_C1772::Method4.17909()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2818<object>() ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2816() ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2815() ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop newobj instance void class G2_C722`2<class BaseClass0,class BaseClass0>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2818<object>() ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2816() ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2815() ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop newobj instance void class G2_C722`2<class BaseClass0,class BaseClass1>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2818<object>() ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2816() ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2815() ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop newobj instance void class G2_C722`2<class BaseClass1,class BaseClass0>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2818<object>() ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2816() ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2815() ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop newobj instance void class G2_C722`2<class BaseClass1,class BaseClass1>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2818<object>() ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2816() ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2815() ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldstr "========================================================================\n\n" call void [mscorlib]System.Console::WriteLine(string) ret } .method public hidebysig static void ConstrainedCallsTest() cil managed { .maxstack 10 .locals init (object V_0) ldstr "========================== Constrained Calls Test ==========================" call void [mscorlib]System.Console::WriteLine(string) newobj instance void class G3_C1772`1<class BaseClass0>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass1,class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.T<class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.A<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.A<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.B<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.A<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass0,class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.T<class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.B<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G3_C1772::ClassMethod4942.17914()#G3_C1772::ClassMethod4943.17915()#G3_C1772::ClassMethod4944.17916<System.Object>()#G3_C1772::ClassMethod4945.17917<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G3_C1772::Method4.17909()#G3_C1772::Method5.17911()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G3_C1772.T<class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G3_C1772::ClassMethod4942.17914()#G3_C1772::ClassMethod4943.17915()#G3_C1772::ClassMethod4944.17916<System.Object>()#G3_C1772::ClassMethod4945.17917<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G3_C1772::Method4.17909()#G3_C1772::Method5.17911()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G3_C1772.A<class G3_C1772`1<class BaseClass0>>(!!0,string) newobj instance void class G3_C1772`1<class BaseClass1>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass1,class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.T<class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.A<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.A<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.B<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.A<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass1,class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.T<class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.B<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G3_C1772::ClassMethod4942.17914()#G3_C1772::ClassMethod4943.17915()#G3_C1772::ClassMethod4944.17916<System.Object>()#G3_C1772::ClassMethod4945.17917<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G3_C1772::Method4.17909()#G3_C1772::Method5.17911()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G3_C1772.T<class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G3_C1772::ClassMethod4942.17914()#G3_C1772::ClassMethod4943.17915()#G3_C1772::ClassMethod4944.17916<System.Object>()#G3_C1772::ClassMethod4945.17917<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G3_C1772::Method4.17909()#G3_C1772::Method5.17911()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G3_C1772.B<class G3_C1772`1<class BaseClass1>>(!!0,string) newobj instance void class G2_C722`2<class BaseClass0,class BaseClass0>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.A.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.A.A<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.A<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.A<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.A<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) newobj instance void class G2_C722`2<class BaseClass0,class BaseClass1>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.A<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.A<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.B<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.A<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass0,class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.B<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) newobj instance void class G2_C722`2<class BaseClass1,class BaseClass0>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.A.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.A.A<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.A<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.A<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) newobj instance void class G2_C722`2<class BaseClass1,class BaseClass1>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.A<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.A<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.B<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.A<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass1,class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.B<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldstr "========================================================================\n\n" call void [mscorlib]System.Console::WriteLine(string) ret } .method public hidebysig static void StructConstrainedInterfaceCallsTest() cil managed { .maxstack 10 ldstr "===================== Struct Constrained Interface Calls Test =====================" call void [mscorlib]System.Console::WriteLine(string) ldstr "========================================================================\n\n" call void [mscorlib]System.Console::WriteLine(string) ret } .method public hidebysig static void CalliTest() cil managed { .maxstack 10 .locals init (object V_0) ldstr "========================== Method Calli Test ==========================" call void [mscorlib]System.Console::WriteLine(string) newobj instance void class G3_C1772`1<class BaseClass0>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2818<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2817<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2816() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2815() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method3<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method2<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method1() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method0() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method5() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method4() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod4945<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod4945.17917<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod4944<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod4944.17916<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod4943() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod4943.17915()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod4942() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod4942.17914()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method5() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method5.17911()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method4() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method4.17909()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod2818<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod2817<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod2816() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod2815() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method3<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method2<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method1() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method0() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) newobj instance void class G3_C1772`1<class BaseClass1>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2818<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2817<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2816() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2815() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method3<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method2<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method1() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method0() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method5() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method4() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod4945<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod4945.17917<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod4944<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod4944.17916<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod4943() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod4943.17915()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod4942() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod4942.17914()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method5() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method5.17911()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method4() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method4.17909()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod2818<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod2817<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod2816() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod2815() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method3<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method2<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method1() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method0() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) newobj instance void class G2_C722`2<class BaseClass0,class BaseClass0>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2818<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2817<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2816() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2815() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method3<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method2<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method1() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method0() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) newobj instance void class G2_C722`2<class BaseClass0,class BaseClass1>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2818<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2817<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2816() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2815() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method3<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method2<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method1() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method0() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) newobj instance void class G2_C722`2<class BaseClass1,class BaseClass0>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2818<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2817<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2816() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2815() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method3<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method2<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method1() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method0() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) newobj instance void class G2_C722`2<class BaseClass1,class BaseClass1>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2818<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2817<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2816() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2815() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method3<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method2<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method1() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method0() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldstr "========================================================================\n\n" call void [mscorlib]System.Console::WriteLine(string) ret } .method public hidebysig static int32 Main() cil managed { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) .entrypoint .maxstack 10 call void Generated1300::MethodCallingTest() call void Generated1300::ConstrainedCallsTest() call void Generated1300::StructConstrainedInterfaceCallsTest() call void Generated1300::CalliTest() ldc.i4 100 ret } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) .ver 4:0:0:0 } .assembly extern TestFramework { .publickeytoken = ( B0 3F 5F 7F 11 D5 0A 3A ) } //TYPES IN FORWARDER ASSEMBLIES: //TEST ASSEMBLY: .assembly Generated1300 { .hash algorithm 0x00008004 } .assembly extern xunit.core {} .class public BaseClass0 { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } .class public BaseClass1 extends BaseClass0 { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void BaseClass0::.ctor() ret } } .class public G3_C1772`1<T0> extends class G2_C722`2<!T0,class BaseClass1> implements class IBase1`1<class BaseClass1> { .method public hidebysig newslot virtual instance string Method4() cil managed noinlining { ldstr "G3_C1772::Method4.17909()" ret } .method public hidebysig newslot virtual instance string 'IBase1<class BaseClass1>.Method4'() cil managed noinlining { .override method instance string class IBase1`1<class BaseClass1>::Method4() ldstr "G3_C1772::Method4.MI.17910()" ret } .method public hidebysig newslot virtual instance string Method5() cil managed noinlining { ldstr "G3_C1772::Method5.17911()" ret } .method public hidebysig newslot virtual instance string 'IBase1<class BaseClass1>.Method5'() cil managed noinlining { .override method instance string class IBase1`1<class BaseClass1>::Method5() ldstr "G3_C1772::Method5.MI.17912()" ret } .method public hidebysig virtual instance string Method6<M0>() cil managed noinlining { ldstr "G3_C1772::Method6.17913<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod4942() cil managed noinlining { ldstr "G3_C1772::ClassMethod4942.17914()" ret } .method public hidebysig newslot virtual instance string ClassMethod4943() cil managed noinlining { ldstr "G3_C1772::ClassMethod4943.17915()" ret } .method public hidebysig newslot virtual instance string ClassMethod4944<M0>() cil managed noinlining { ldstr "G3_C1772::ClassMethod4944.17916<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod4945<M0>() cil managed noinlining { ldstr "G3_C1772::ClassMethod4945.17917<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string 'G2_C722<T0,class BaseClass1>.ClassMethod2815'() cil managed noinlining { .override method instance string class G2_C722`2<!T0,class BaseClass1>::ClassMethod2815() ldstr "G3_C1772::ClassMethod2815.MI.17918()" ret } .method public hidebysig newslot virtual instance string 'G2_C722<T0,class BaseClass1>.ClassMethod2816'() cil managed noinlining { .override method instance string class G2_C722`2<!T0,class BaseClass1>::ClassMethod2816() ldstr "G3_C1772::ClassMethod2816.MI.17919()" ret } .method public hidebysig newslot virtual instance string 'G2_C722<T0,class BaseClass1>.ClassMethod2818'<M0>() cil managed noinlining { .override method instance string class G2_C722`2<!T0,class BaseClass1>::ClassMethod2818<[1]>() ldstr "G3_C1772::ClassMethod2818.MI.17920<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void class G2_C722`2<!T0,class BaseClass1>::.ctor() ret } } .class public G2_C722`2<T0, T1> extends class G1_C13`2<!T1,class BaseClass0> implements class IBase2`2<class BaseClass1,!T0>, IBase0 { .method public hidebysig virtual instance string Method7<M0>() cil managed noinlining { ldstr "G2_C722::Method7.11654<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string Method0() cil managed noinlining { ldstr "G2_C722::Method0.11655()" ret } .method public hidebysig virtual instance string Method1() cil managed noinlining { ldstr "G2_C722::Method1.11656()" ret } .method public hidebysig newslot virtual instance string Method2<M0>() cil managed noinlining { ldstr "G2_C722::Method2.11657<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig virtual instance string Method3<M0>() cil managed noinlining { ldstr "G2_C722::Method3.11658<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string 'IBase0.Method3'<M0>() cil managed noinlining { .override method instance string IBase0::Method3<[1]>() ldstr "G2_C722::Method3.MI.11659<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod2815() cil managed noinlining { ldstr "G2_C722::ClassMethod2815.11660()" ret } .method public hidebysig newslot virtual instance string ClassMethod2816() cil managed noinlining { ldstr "G2_C722::ClassMethod2816.11661()" ret } .method public hidebysig newslot virtual instance string ClassMethod2817<M0>() cil managed noinlining { ldstr "G2_C722::ClassMethod2817.11662<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod2818<M0>() cil managed noinlining { ldstr "G2_C722::ClassMethod2818.11663<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void class G1_C13`2<!T1,class BaseClass0>::.ctor() ret } } .class interface public abstract IBase1`1<+T0> { .method public hidebysig newslot abstract virtual instance string Method4() cil managed { } .method public hidebysig newslot abstract virtual instance string Method5() cil managed { } .method public hidebysig newslot abstract virtual instance string Method6<M0>() cil managed { } } .class public abstract G1_C13`2<T0, T1> implements class IBase2`2<!T0,!T1>, class IBase1`1<!T0> { .method public hidebysig virtual instance string Method7<M0>() cil managed noinlining { ldstr "G1_C13::Method7.4871<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string Method4() cil managed noinlining { ldstr "G1_C13::Method4.4872()" ret } .method public hidebysig newslot virtual instance string Method5() cil managed noinlining { ldstr "G1_C13::Method5.4873()" ret } .method public hidebysig newslot virtual instance string 'IBase1<T0>.Method5'() cil managed noinlining { .override method instance string class IBase1`1<!T0>::Method5() ldstr "G1_C13::Method5.MI.4874()" ret } .method public hidebysig newslot virtual instance string Method6<M0>() cil managed noinlining { ldstr "G1_C13::Method6.4875<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod1348<M0>() cil managed noinlining { ldstr "G1_C13::ClassMethod1348.4876<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig newslot virtual instance string ClassMethod1349<M0>() cil managed noinlining { ldstr "G1_C13::ClassMethod1349.4877<" ldtoken !!M0 call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) call string [mscorlib]System.String::Concat(object,object) ldstr ">()" call string [mscorlib]System.String::Concat(object,object) ret } .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { ldarg.0 call instance void [mscorlib]System.Object::.ctor() ret } } .class interface public abstract IBase2`2<+T0, -T1> { .method public hidebysig newslot abstract virtual instance string Method7<M0>() cil managed { } } .class interface public abstract IBase0 { .method public hidebysig newslot abstract virtual instance string Method0() cil managed { } .method public hidebysig newslot abstract virtual instance string Method1() cil managed { } .method public hidebysig newslot abstract virtual instance string Method2<M0>() cil managed { } .method public hidebysig newslot abstract virtual instance string Method3<M0>() cil managed { } } .class public auto ansi beforefieldinit Generated1300 { .method static void M.BaseClass0<(BaseClass0)W>(!!W inst, string exp) cil managed { .maxstack 5 .locals init (string[] actualResults) ldc.i4.s 0 newarr string stloc.s actualResults ldarg.1 ldstr "M.BaseClass0<(BaseClass0)W>(!!W inst, string exp)" ldc.i4.s 0 ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.BaseClass1<(BaseClass1)W>(!!W inst, string exp) cil managed { .maxstack 5 .locals init (string[] actualResults) ldc.i4.s 0 newarr string stloc.s actualResults ldarg.1 ldstr "M.BaseClass1<(BaseClass1)W>(!!W inst, string exp)" ldc.i4.s 0 ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G3_C1772.T<T0,(class G3_C1772`1<!!T0>)W>(!!W 'inst', string exp) cil managed { .maxstack 23 .locals init (string[] actualResults) ldc.i4.s 18 newarr string stloc.s actualResults ldarg.1 ldstr "M.G3_C1772.T<T0,(class G3_C1772`1<!!T0>)W>(!!W 'inst', string exp)" ldc.i4.s 18 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod4942() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod4943() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod4944<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::ClassMethod4945<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 14 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 15 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 16 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 17 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<!!T0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G3_C1772.A<(class G3_C1772`1<class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 23 .locals init (string[] actualResults) ldc.i4.s 18 newarr string stloc.s actualResults ldarg.1 ldstr "M.G3_C1772.A<(class G3_C1772`1<class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 18 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4942() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4943() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4944<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4945<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 14 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 15 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 16 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 17 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G3_C1772.B<(class G3_C1772`1<class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 23 .locals init (string[] actualResults) ldc.i4.s 18 newarr string stloc.s actualResults ldarg.1 ldstr "M.G3_C1772.B<(class G3_C1772`1<class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 18 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4942() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4943() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4944<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4945<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 14 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 15 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 16 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 17 ldarga.s 0 constrained. !!W callvirt instance string class G3_C1772`1<class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.T.T<T0,T1,(class G2_C722`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.T.T<T0,T1,(class G2_C722`2<!!T0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<!!T0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.A.T<T1,(class G2_C722`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.A.T<T1,(class G2_C722`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.A.A<(class G2_C722`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.A.A<(class G2_C722`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.A.B<(class G2_C722`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.A.B<(class G2_C722`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.B.T<T1,(class G2_C722`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.B.T<T1,(class G2_C722`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.B.A<(class G2_C722`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.B.A<(class G2_C722`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G2_C722.B.B<(class G2_C722`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 19 .locals init (string[] actualResults) ldc.i4.s 14 newarr string stloc.s actualResults ldarg.1 ldstr "M.G2_C722.B.B<(class G2_C722`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 14 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2815() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2816() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2817<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2818<object>() stelem.ref ldloc.s actualResults ldc.i4.s 6 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 7 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 8 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 9 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method3<object>() stelem.ref ldloc.s actualResults ldc.i4.s 10 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 11 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 12 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 13 ldarga.s 0 constrained. !!W callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase1.T<T0,(class IBase1`1<!!T0>)W>(!!W 'inst', string exp) cil managed { .maxstack 8 .locals init (string[] actualResults) ldc.i4.s 3 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase1.T<T0,(class IBase1`1<!!T0>)W>(!!W 'inst', string exp)" ldc.i4.s 3 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<!!T0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<!!T0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<!!T0>::Method6<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase1.A<(class IBase1`1<class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 8 .locals init (string[] actualResults) ldc.i4.s 3 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase1.A<(class IBase1`1<class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 3 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase1.B<(class IBase1`1<class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 8 .locals init (string[] actualResults) ldc.i4.s 3 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase1.B<(class IBase1`1<class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 3 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.T.T<T0,T1,(class G1_C13`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.T.T<T0,T1,(class G1_C13`2<!!T0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<!!T0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.A.T<T1,(class G1_C13`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.A.T<T1,(class G1_C13`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.A.A<(class G1_C13`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.A.A<(class G1_C13`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.A.B<(class G1_C13`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.A.B<(class G1_C13`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.B.T<T1,(class G1_C13`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.B.T<T1,(class G1_C13`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.B.A<(class G1_C13`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.B.A<(class G1_C13`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.G1_C13.B.B<(class G1_C13`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 11 .locals init (string[] actualResults) ldc.i4.s 6 newarr string stloc.s actualResults ldarg.1 ldstr "M.G1_C13.B.B<(class G1_C13`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 6 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::Method4() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::Method5() stelem.ref ldloc.s actualResults ldc.i4.s 4 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::Method6<object>() stelem.ref ldloc.s actualResults ldc.i4.s 5 ldarga.s 0 constrained. !!W callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.T.T<T0,T1,(class IBase2`2<!!T0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.T.T<T0,T1,(class IBase2`2<!!T0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<!!T0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.A.T<T1,(class IBase2`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.A.T<T1,(class IBase2`2<class BaseClass0,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass0,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.A.A<(class IBase2`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.A.A<(class IBase2`2<class BaseClass0,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.A.B<(class IBase2`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.A.B<(class IBase2`2<class BaseClass0,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.B.T<T1,(class IBase2`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.B.T<T1,(class IBase2`2<class BaseClass1,!!T1>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass1,!!T1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.B.A<(class IBase2`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.B.A<(class IBase2`2<class BaseClass1,class BaseClass0>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase2.B.B<(class IBase2`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp) cil managed { .maxstack 6 .locals init (string[] actualResults) ldc.i4.s 1 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase2.B.B<(class IBase2`2<class BaseClass1,class BaseClass1>)W>(!!W 'inst', string exp)" ldc.i4.s 1 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method static void M.IBase0<(IBase0)W>(!!W inst, string exp) cil managed { .maxstack 9 .locals init (string[] actualResults) ldc.i4.s 4 newarr string stloc.s actualResults ldarg.1 ldstr "M.IBase0<(IBase0)W>(!!W inst, string exp)" ldc.i4.s 4 ldloc.s actualResults ldc.i4.s 0 ldarga.s 0 constrained. !!W callvirt instance string IBase0::Method0() stelem.ref ldloc.s actualResults ldc.i4.s 1 ldarga.s 0 constrained. !!W callvirt instance string IBase0::Method1() stelem.ref ldloc.s actualResults ldc.i4.s 2 ldarga.s 0 constrained. !!W callvirt instance string IBase0::Method2<object>() stelem.ref ldloc.s actualResults ldc.i4.s 3 ldarga.s 0 constrained. !!W callvirt instance string IBase0::Method3<object>() stelem.ref ldloc.s actualResults call void [TestFramework]TestFramework::MethodCallTest(string,string,int32,string[]) ret } .method public hidebysig static void MethodCallingTest() cil managed { .maxstack 10 .locals init (object V_0) ldstr "========================== Method Calling Test ==========================" call void [mscorlib]System.Console::WriteLine(string) newobj instance void class G3_C1772`1<class BaseClass0>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass1>::Method4() ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method5() ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2818<object>() ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2816() ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2815() ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4945<object>() ldstr "G3_C1772::ClassMethod4945.17917<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4944<object>() ldstr "G3_C1772::ClassMethod4944.17916<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4943() ldstr "G3_C1772::ClassMethod4943.17915()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod4942() ldstr "G3_C1772::ClassMethod4942.17914()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method5() ldstr "G3_C1772::Method5.17911()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method4() ldstr "G3_C1772::Method4.17909()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2818<object>() ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2816() ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod2815() ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass0> callvirt instance string class G3_C1772`1<class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop newobj instance void class G3_C1772`1<class BaseClass1>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass1>::Method4() ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method5() ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2818<object>() ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2816() ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2815() ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4945<object>() ldstr "G3_C1772::ClassMethod4945.17917<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4944<object>() ldstr "G3_C1772::ClassMethod4944.17916<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4943() ldstr "G3_C1772::ClassMethod4943.17915()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod4942() ldstr "G3_C1772::ClassMethod4942.17914()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method6<object>() ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method5() ldstr "G3_C1772::Method5.17911()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method4() ldstr "G3_C1772::Method4.17909()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2818<object>() ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2816() ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod2815() ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G3_C1772`1<class BaseClass1> callvirt instance string class G3_C1772`1<class BaseClass1>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop newobj instance void class G2_C722`2<class BaseClass0,class BaseClass0>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2818<object>() ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2816() ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2815() ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop newobj instance void class G2_C722`2<class BaseClass0,class BaseClass1>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2818<object>() ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2816() ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2815() ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass0,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop newobj instance void class G2_C722`2<class BaseClass1,class BaseClass0>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass0,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2818<object>() ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2816() ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2815() ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass0> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop newobj instance void class G2_C722`2<class BaseClass1,class BaseClass1>::.ctor() stloc.0 ldloc.0 dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G1_C13`2<class BaseClass1,class BaseClass0> callvirt instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass1>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string class IBase1`1<class BaseClass0>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method5() ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string class IBase1`1<class BaseClass0>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2818<object>() ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2817<object>() ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2816() ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2815() ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method3<object>() ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method1() ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method0() ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method7<object>() ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method6<object>() ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method5() ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup castclass class G2_C722`2<class BaseClass1,class BaseClass1> callvirt instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method4() ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldloc.0 dup callvirt instance string IBase0::Method0() ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method1() ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method2<object>() ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) dup callvirt instance string IBase0::Method3<object>() ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) pop ldstr "========================================================================\n\n" call void [mscorlib]System.Console::WriteLine(string) ret } .method public hidebysig static void ConstrainedCallsTest() cil managed { .maxstack 10 .locals init (object V_0) ldstr "========================== Constrained Calls Test ==========================" call void [mscorlib]System.Console::WriteLine(string) newobj instance void class G3_C1772`1<class BaseClass0>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass1,class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.T<class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.A<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.A<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.B<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.A<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass0,class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.T<class BaseClass1,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.B<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G3_C1772`1<class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G3_C1772::ClassMethod4942.17914()#G3_C1772::ClassMethod4943.17915()#G3_C1772::ClassMethod4944.17916<System.Object>()#G3_C1772::ClassMethod4945.17917<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G3_C1772::Method4.17909()#G3_C1772::Method5.17911()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G3_C1772.T<class BaseClass0,class G3_C1772`1<class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G3_C1772::ClassMethod4942.17914()#G3_C1772::ClassMethod4943.17915()#G3_C1772::ClassMethod4944.17916<System.Object>()#G3_C1772::ClassMethod4945.17917<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G3_C1772::Method4.17909()#G3_C1772::Method5.17911()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G3_C1772.A<class G3_C1772`1<class BaseClass0>>(!!0,string) newobj instance void class G3_C1772`1<class BaseClass1>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass1,class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.T<class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.A<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.A<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.B<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G3_C1772::Method4.MI.17910()#G3_C1772::Method5.MI.17912()#G3_C1772::Method6.17913<System.Object>()#" call void Generated1300::M.IBase1.A<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass1,class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.T<class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.B<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G3_C1772`1<class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G3_C1772::ClassMethod4942.17914()#G3_C1772::ClassMethod4943.17915()#G3_C1772::ClassMethod4944.17916<System.Object>()#G3_C1772::ClassMethod4945.17917<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G3_C1772::Method4.17909()#G3_C1772::Method5.17911()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G3_C1772.T<class BaseClass1,class G3_C1772`1<class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G3_C1772::ClassMethod2815.MI.17918()#G3_C1772::ClassMethod2816.MI.17919()#G2_C722::ClassMethod2817.11662<System.Object>()#G3_C1772::ClassMethod2818.MI.17920<System.Object>()#G3_C1772::ClassMethod4942.17914()#G3_C1772::ClassMethod4943.17915()#G3_C1772::ClassMethod4944.17916<System.Object>()#G3_C1772::ClassMethod4945.17917<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G3_C1772::Method4.17909()#G3_C1772::Method5.17911()#G3_C1772::Method6.17913<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G3_C1772.B<class G3_C1772`1<class BaseClass1>>(!!0,string) newobj instance void class G2_C722`2<class BaseClass0,class BaseClass0>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.A.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.A.A<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.A<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.A<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.A<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G2_C722`2<class BaseClass0,class BaseClass0>>(!!0,string) newobj instance void class G2_C722`2<class BaseClass0,class BaseClass1>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.A<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.A<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.B<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.A<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass0,class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.T<class BaseClass1,class G2_C722`2<class BaseClass0,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.A.B<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G2_C722`2<class BaseClass0,class BaseClass1>>(!!0,string) newobj instance void class G2_C722`2<class BaseClass1,class BaseClass0>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.A.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.A.A<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.A<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.A<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass0>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G2_C722`2<class BaseClass1,class BaseClass0>>(!!0,string) newobj instance void class G2_C722`2<class BaseClass1,class BaseClass1>::.ctor() stloc.0 ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G1_C13.B.A<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.A<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.B<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.A<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass0,class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.A.B<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.T.T<class BaseClass1,class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.IBase2.B.B<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.T<class BaseClass0,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::Method4.4872()#G1_C13::Method5.MI.4874()#G1_C13::Method6.4875<System.Object>()#" call void Generated1300::M.IBase1.A<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.T.T<class BaseClass1,class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!2,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.T<class BaseClass1,class G2_C722`2<class BaseClass1,class BaseClass1>>(!!1,string) ldloc.0 ldstr "G1_C13::ClassMethod1348.4876<System.Object>()#G1_C13::ClassMethod1349.4877<System.Object>()#G2_C722::ClassMethod2815.11660()#G2_C722::ClassMethod2816.11661()#G2_C722::ClassMethod2817.11662<System.Object>()#G2_C722::ClassMethod2818.11663<System.Object>()#G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.11658<System.Object>()#G1_C13::Method4.4872()#G1_C13::Method5.4873()#G1_C13::Method6.4875<System.Object>()#G2_C722::Method7.11654<System.Object>()#" call void Generated1300::M.G2_C722.B.B<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldloc.0 ldstr "G2_C722::Method0.11655()#G2_C722::Method1.11656()#G2_C722::Method2.11657<System.Object>()#G2_C722::Method3.MI.11659<System.Object>()#" call void Generated1300::M.IBase0<class G2_C722`2<class BaseClass1,class BaseClass1>>(!!0,string) ldstr "========================================================================\n\n" call void [mscorlib]System.Console::WriteLine(string) ret } .method public hidebysig static void StructConstrainedInterfaceCallsTest() cil managed { .maxstack 10 ldstr "===================== Struct Constrained Interface Calls Test =====================" call void [mscorlib]System.Console::WriteLine(string) ldstr "========================================================================\n\n" call void [mscorlib]System.Console::WriteLine(string) ret } .method public hidebysig static void CalliTest() cil managed { .maxstack 10 .locals init (object V_0) ldstr "========================== Method Calli Test ==========================" call void [mscorlib]System.Console::WriteLine(string) newobj instance void class G3_C1772`1<class BaseClass0>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2818<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2817<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2816() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2815() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method3<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method2<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method1() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method0() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method5() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method4() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod4945<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod4945.17917<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod4944<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod4944.17916<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod4943() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod4943.17915()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod4942() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod4942.17914()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method5() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method5.17911()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method4() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::Method4.17909()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod2818<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod2817<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod2816() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod2815() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method3<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method2<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method1() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method0() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass0> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass0>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G3_C1772`1<class BaseClass0> on type class G3_C1772`1<class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) newobj instance void class G3_C1772`1<class BaseClass1>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method4.MI.17910()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method5.MI.17912()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2818<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2817<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2816() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2815() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method3<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method2<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method1() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method0() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method5() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method4() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod4945<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod4945.17917<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod4944<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod4944.17916<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod4943() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod4943.17915()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod4942() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod4942.17914()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method6<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method6.17913<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method5() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method5.17911()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method4() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::Method4.17909()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod2818<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2818.MI.17920<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod2817<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod2816() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2816.MI.17919()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod2815() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G3_C1772::ClassMethod2815.MI.17918()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method3<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method2<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method1() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method0() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::Method7<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod1349<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G3_C1772`1<class BaseClass1> ldloc.0 ldvirtftn instance string class G3_C1772`1<class BaseClass1>::ClassMethod1348<object>() calli default string(class G3_C1772`1<class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G3_C1772`1<class BaseClass1> on type class G3_C1772`1<class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) newobj instance void class G2_C722`2<class BaseClass0,class BaseClass0>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2818<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2817<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2816() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod2815() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method3<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method2<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method1() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method0() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) newobj instance void class G2_C722`2<class BaseClass0,class BaseClass1>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2818<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2817<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2816() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod2815() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method3<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method2<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method1() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method0() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method6<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method5() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass0,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass0,class BaseClass1>::Method4() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G2_C722`2<class BaseClass0,class BaseClass1>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass0,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) newobj instance void class G2_C722`2<class BaseClass1,class BaseClass0>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass0,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2818<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2817<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2816() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod2815() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method3<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method2<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method1() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method0() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass0>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass0>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) newobj instance void class G2_C722`2<class BaseClass1,class BaseClass1>::.ctor() stloc.0 ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G1_C13`2<class BaseClass1,class BaseClass0> ldloc.0 ldvirtftn instance string class G1_C13`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G1_C13`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass1>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass0>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass0,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass0,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase2`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class IBase2`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method5.MI.4874()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string class IBase1`1<class BaseClass0>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class IBase1`1<class BaseClass0> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2818<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::ClassMethod2818.11663<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2817<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::ClassMethod2817.11662<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2816() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::ClassMethod2816.11661()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod2815() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::ClassMethod2815.11660()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method3<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method3.11658<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method2<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method1() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method0() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method7<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method7.11654<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1349<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::ClassMethod1349.4877<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::ClassMethod1348<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::ClassMethod1348.4876<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method6<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method6.4875<System.Object>()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method5() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method5.4873()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 castclass class G2_C722`2<class BaseClass1,class BaseClass1> ldloc.0 ldvirtftn instance string class G2_C722`2<class BaseClass1,class BaseClass1>::Method4() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G1_C13::Method4.4872()" ldstr "class G2_C722`2<class BaseClass1,class BaseClass1> on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method0() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method0.11655()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method1() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method1.11656()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method2<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method2.11657<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldloc.0 ldloc.0 ldvirtftn instance string IBase0::Method3<object>() calli default string(class G2_C722`2<class BaseClass1,class BaseClass1>) ldstr "G2_C722::Method3.MI.11659<System.Object>()" ldstr "IBase0 on type class G2_C722`2<class BaseClass1,class BaseClass1>" call void [TestFramework]TestFramework::MethodCallTest(string,string,string) ldstr "========================================================================\n\n" call void [mscorlib]System.Console::WriteLine(string) ret } .method public hidebysig static int32 Main() cil managed { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) .entrypoint .maxstack 10 call void Generated1300::MethodCallingTest() call void Generated1300::ConstrainedCallsTest() call void Generated1300::StructConstrainedInterfaceCallsTest() call void Generated1300::CalliTest() ldc.i4 100 ret } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.Private.Xml/tests/Xslt/TestFiles/TestData/xsltc/baseline/pft17.xsl
<xsl:stylesheet version= '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' > <xsl:template match="/"> <xsl:for-each select="//foo"> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet>
<xsl:stylesheet version= '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' > <xsl:template match="/"> <xsl:for-each select="//foo"> <xsl:value-of select="."/> </xsl:for-each> </xsl:template> </xsl:stylesheet>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="castclass-null041.cs" /> <Compile Include="..\structdef.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="castclass-null041.cs" /> <Compile Include="..\structdef.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/CodeGenBringUpTests/DblRoots_ro.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> <Optimize>True</Optimize> </PropertyGroup> <ItemGroup> <Compile Include="DblRoots.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> <Optimize>True</Optimize> </PropertyGroup> <ItemGroup> <Compile Include="DblRoots.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/Common/src/Microsoft/Win32/SafeHandles/SafeBioHandle.Unix.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Security; using System.Runtime.InteropServices; using System.Diagnostics; namespace Microsoft.Win32.SafeHandles { internal sealed class SafeBioHandle : SafeHandle { private SafeHandle? _parent; public SafeBioHandle() : base(IntPtr.Zero, ownsHandle: true) { } protected override bool ReleaseHandle() { IntPtr h = handle; SetHandle(IntPtr.Zero); if (_parent != null) { SafeHandle parent = _parent; _parent = null; parent.DangerousRelease(); return true; } else { return Interop.Crypto.BioDestroy(h); } } public override bool IsInvalid { get { // If handle is 0, we're invalid. // If we have a _parent and they're invalid, we're invalid. return handle == IntPtr.Zero || (_parent != null && _parent.IsInvalid); } } internal void TransferOwnershipToParent(SafeHandle parent) { Debug.Assert(_parent == null, "Expected no existing parent"); Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid"); bool addedRef = false; parent.DangerousAddRef(ref addedRef); _parent = parent; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Security; using System.Runtime.InteropServices; using System.Diagnostics; namespace Microsoft.Win32.SafeHandles { internal sealed class SafeBioHandle : SafeHandle { private SafeHandle? _parent; public SafeBioHandle() : base(IntPtr.Zero, ownsHandle: true) { } protected override bool ReleaseHandle() { IntPtr h = handle; SetHandle(IntPtr.Zero); if (_parent != null) { SafeHandle parent = _parent; _parent = null; parent.DangerousRelease(); return true; } else { return Interop.Crypto.BioDestroy(h); } } public override bool IsInvalid { get { // If handle is 0, we're invalid. // If we have a _parent and they're invalid, we're invalid. return handle == IntPtr.Zero || (_parent != null && _parent.IsInvalid); } } internal void TransferOwnershipToParent(SafeHandle parent) { Debug.Assert(_parent == null, "Expected no existing parent"); Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid"); bool addedRef = false; parent.DangerousAddRef(ref addedRef); _parent = parent; } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.Net.Security/tests/FunctionalTests/NegotiateStreamConformanceTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.IO; using System.IO.Tests; using System.Threading.Tasks; using Xunit; namespace System.Net.Security.Tests { [PlatformSpecific(TestPlatforms.Windows)] // NegotiateStream client needs explicit credentials or SPNs on unix. public sealed class NegotiateStreamMemoryConformanceTests : WrappingConnectedStreamConformanceTests { protected override bool UsableAfterCanceledReads => false; protected override bool BlocksOnZeroByteReads => true; protected override Type UnsupportedConcurrentExceptionType => typeof(NotSupportedException); protected override Task<StreamPair> CreateConnectedStreamsAsync() => CreateWrappedConnectedStreamsAsync(ConnectedStreams.CreateBidirectional(), leaveOpen: false); protected override async Task<StreamPair> CreateWrappedConnectedStreamsAsync(StreamPair wrapped, bool leaveOpen) { var negotiate1 = new NegotiateStream(wrapped.Stream1, leaveOpen); var negotiate2 = new NegotiateStream(wrapped.Stream2, leaveOpen); await Task.WhenAll(negotiate1.AuthenticateAsClientAsync(), negotiate2.AuthenticateAsServerAsync()); return new StreamPair(negotiate1, negotiate2); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.IO; using System.IO.Tests; using System.Threading.Tasks; using Xunit; namespace System.Net.Security.Tests { [PlatformSpecific(TestPlatforms.Windows)] // NegotiateStream client needs explicit credentials or SPNs on unix. public sealed class NegotiateStreamMemoryConformanceTests : WrappingConnectedStreamConformanceTests { protected override bool UsableAfterCanceledReads => false; protected override bool BlocksOnZeroByteReads => true; protected override Type UnsupportedConcurrentExceptionType => typeof(NotSupportedException); protected override Task<StreamPair> CreateConnectedStreamsAsync() => CreateWrappedConnectedStreamsAsync(ConnectedStreams.CreateBidirectional(), leaveOpen: false); protected override async Task<StreamPair> CreateWrappedConnectedStreamsAsync(StreamPair wrapped, bool leaveOpen) { var negotiate1 = new NegotiateStream(wrapped.Stream1, leaveOpen); var negotiate2 = new NegotiateStream(wrapped.Stream2, leaveOpen); await Task.WhenAll(negotiate1.AuthenticateAsClientAsync(), negotiate2.AuthenticateAsServerAsync()); return new StreamPair(negotiate1, negotiate2); } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/coreclr/tools/r2rtest/Commands/CompileSerpCommand.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Text; namespace R2RTest { class CompileSerpCommand { private static readonly string BackupFolder = "backup"; private static readonly string CompileFolder = "compile"; private static readonly string SerpCompositeFilename = "Microsoft.Search.Frontend.CoreUX.R2R.dll"; private static readonly string AnswersGlueAssemblyFilename = "Microsoft.Search.Frontend.AnswersGlue.dll"; private List<string> _packageCompileAssemblies; private List<string> _packageReferenceAssemblies; private List<string> _coreCompileAssemblies = new List<string>(); private List<string> _coreReferenceAssemblies = new List<string>(); private List<string> _frameworkCompileAssemblies = new List<string>(); private List<string> _frameworkReferenceAssemblies = new List<string>(); private List<string> _aspCompileAssemblies = new List<string>(); private List<string> _aspReferenceAssemblies = new List<string>(); private string SerpDir { get; set; } private string BinDir { get;set; } private BuildOptions _options; public CompileSerpCommand(BuildOptions options) { // This command does not work in the context of an app, just a loose set of rsp files so don't execute anything we compile options.NoJit = true; options.NoEtw = true; options.Release = true; _options = options; if (_options.InputDirectory == null) { throw new ArgumentException("Specify --response-file or --input-directory containing multiple response files."); } if (_options.CoreRootDirectory == null) { throw new ArgumentException("--core-root-directory (--cr) is a required argument."); } if (_options.AspNetPath == null || !File.Exists(Path.Combine(_options.AspNetPath.FullName, "Microsoft.AspNetCore.dll"))) { throw new ArgumentException($"Error: Asp.NET Core path must contain Microsoft.AspNetCore.dll"); } SerpDir = _options.InputDirectory.FullName; BinDir = Path.Combine(SerpDir, "bin"); if (!File.Exists(Path.Combine(SerpDir, "runserp.cmd"))) { throw new ArgumentException($"Error: InputDirectory must point at a SERP build. Could not find {Path.Combine(SerpDir, "runserp.cmd")}"); } // Check that the "Microsoft.Search.Frontend.AnswersGlue.dll" assembly was generated in this drop string answersGlueAssembly = Path.Combine(BinDir, AnswersGlueAssemblyFilename); if (!File.Exists(answersGlueAssembly)) { throw new FileNotFoundException($"Could not find {answersGlueAssembly}. Run {SerpDir}\\GenAnswersEntryPoints.bat first!"); } // Add all assemblies from the various SERP packages (filtered by ShouldInclude) _packageCompileAssemblies = Directory.GetFiles(Path.Combine(SerpDir, "App_Data\\Answers\\Services\\Packages"), "*.dll", SearchOption.AllDirectories) .Where((string x) => ShouldInclude(x)) .ToList(); _packageReferenceAssemblies = new List<string>(); { HashSet<string> packageReferenceAssemblyDirectories = new HashSet<string>(); foreach (var binFile in _packageCompileAssemblies) { var directory = Path.GetDirectoryName(binFile); if (!packageReferenceAssemblyDirectories.Contains(directory)) packageReferenceAssemblyDirectories.Add(directory); } foreach (string binFile in ResolveReferences(packageReferenceAssemblyDirectories)) { _packageReferenceAssemblies.Add(binFile); } } _coreCompileAssemblies = new List<string>(); _coreReferenceAssemblies = new List<string>(); { // Add an allow-list of assemblies from bin. This unified list includes binaries from /bin and /App_data so filter just the /bin assemblies foreach (string item in GetCrossgenAllowedBinDlls()) { string binAssembly = Path.Combine(BinDir, item); if (File.Exists(binAssembly) && !FrameworkExclusion.Exclude(Path.GetFileNameWithoutExtension(binAssembly), CompilerIndex.CPAOT, out string reason)) { _coreCompileAssemblies.Add(binAssembly); } } HashSet<string> coreReferenceAssemblyDirectories = new HashSet<string>(); foreach (var binFile in _coreCompileAssemblies) { var directory = Path.GetDirectoryName(binFile); if (!coreReferenceAssemblyDirectories.Contains(directory)) coreReferenceAssemblyDirectories.Add(directory); } foreach (string binFile in ResolveReferences(coreReferenceAssemblyDirectories)) { _coreReferenceAssemblies.Add(binFile); } } _frameworkCompileAssemblies = new List<string>(); _frameworkReferenceAssemblies = new List<string>(); { foreach (string frameworkDll in ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.CoreRootDirectory.FullName, "System.*.dll")) { string simpleName = Path.GetFileNameWithoutExtension(frameworkDll); if (!FrameworkExclusion.Exclude(simpleName, CompilerIndex.CPAOT, out string reason)) { _frameworkCompileAssemblies.Add(frameworkDll); } } foreach (string frameworkDll in ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.CoreRootDirectory.FullName, "Microsoft.*.dll")) { string simpleName = Path.GetFileNameWithoutExtension(frameworkDll); if (!FrameworkExclusion.Exclude(simpleName, CompilerIndex.CPAOT, out string reason)) { _frameworkCompileAssemblies.Add(frameworkDll); } } _frameworkCompileAssemblies.Add(Path.Combine(options.CoreRootDirectory.FullName, "mscorlib.dll")); _frameworkCompileAssemblies.Add(Path.Combine(options.CoreRootDirectory.FullName, "netstandard.dll")); _frameworkReferenceAssemblies.AddRange(ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.CoreRootDirectory.FullName, "System.*.dll")); _frameworkReferenceAssemblies.AddRange(ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.CoreRootDirectory.FullName, "Microsoft.*.dll")); _frameworkReferenceAssemblies.Add(Path.Combine(options.CoreRootDirectory.FullName, "mscorlib.dll")); _frameworkReferenceAssemblies.Add(Path.Combine(options.CoreRootDirectory.FullName, "netstandard.dll")); } _aspCompileAssemblies = new List<string>(); _aspReferenceAssemblies = new List<string>(); { _aspCompileAssemblies.AddRange(ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.AspNetPath.FullName, "Microsoft.AspNetCore.*.dll")); _aspCompileAssemblies.AddRange(ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.AspNetPath.FullName, "Microsoft.Extensions.*.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "Microsoft.JSInterop.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "Microsoft.Net.Http.Headers.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "Microsoft.Win32.SystemEvents.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Diagnostics.EventLog.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Drawing.Common.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.IO.Pipelines.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Security.Cryptography.Pkcs.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Security.Cryptography.Xml.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Security.Permissions.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Windows.Extensions.dll")); _aspReferenceAssemblies = new List<string>(_aspCompileAssemblies); } } public int CompileSerpAssemblies() { Console.WriteLine("Compiling serp in " + (_options.Composite ? "composite" : "single assembly") + " mode"); string serpRoot = Directory.GetParent(SerpDir).Parent.Parent.Parent.FullName; string compileOutRoot = Path.Combine(serpRoot, CompileFolder); if (Directory.Exists(compileOutRoot)) Directory.Delete(compileOutRoot, true); List<ProcessInfo> fileCompilations = new List<ProcessInfo>(); // Single composite image for all of Serp if (_options.Composite) { List<string> combinedCompileAssemblies = new List<string>(); HashSet<string> simpleNameList = new HashSet<string>(); combinedCompileAssemblies.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _coreCompileAssemblies)); combinedCompileAssemblies.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _aspCompileAssemblies)); combinedCompileAssemblies.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _frameworkCompileAssemblies)); combinedCompileAssemblies.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _packageCompileAssemblies)); List<string> combinedCompileAssembliesBackup = BackupAndUseOriginalAssemblies(serpRoot, combinedCompileAssemblies); string compositeDllPath = Path.Combine(BinDir, SerpCompositeFilename); if (File.Exists(compositeDllPath)) File.Delete(compositeDllPath); string compositeDllCompile = GetCompileFile(serpRoot, compositeDllPath); Crossgen2RunnerOptions crossgen2Options = new Crossgen2RunnerOptions() { Composite = true, CompositeRoot = GetBackupFile(serpRoot, SerpDir), PartialComposite = true }; var runner = new Crossgen2Runner(_options, crossgen2Options, combinedCompileAssembliesBackup); var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, compositeDllCompile, combinedCompileAssembliesBackup)); fileCompilations.Add(compilationProcess); } else { // Framework assemblies { List<string> frameworkCompileAssembliesBackup = BackupAndUseOriginalAssemblies(serpRoot, _frameworkCompileAssemblies); Crossgen2RunnerOptions crossgen2Options = new Crossgen2RunnerOptions() { Composite = false }; var runner = new Crossgen2Runner(_options, crossgen2Options, new List<string>()); foreach (string assembly in frameworkCompileAssembliesBackup) { string dllCompile = GetCompileFile(serpRoot, assembly); var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, dllCompile, new string[] { assembly })); fileCompilations.Add(compilationProcess); } } // Asp.Net { List<string> aspCombinedReferences = new List<string>(); aspCombinedReferences.AddRange(_aspReferenceAssemblies); aspCombinedReferences.AddRange(_frameworkCompileAssemblies); List<string> aspCombinedReferencesBackup = BackupAndUseOriginalAssemblies(serpRoot, aspCombinedReferences); List<string> aspCompileAssembliesBackup = BackupAndUseOriginalAssemblies(serpRoot, _aspCompileAssemblies); Crossgen2RunnerOptions crossgen2Options = new Crossgen2RunnerOptions() { Composite = false }; var runner = new Crossgen2Runner(_options, crossgen2Options, aspCombinedReferencesBackup); foreach (string assembly in aspCompileAssembliesBackup) { string dllCompile = GetCompileFile(serpRoot, assembly); var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, dllCompile, new string[] { assembly })); fileCompilations.Add(compilationProcess); } } // Serp core { List<string> coreCombinedReferences = new List<string>(); coreCombinedReferences.AddRange(_coreReferenceAssemblies); coreCombinedReferences.AddRange(_aspReferenceAssemblies); coreCombinedReferences.AddRange(_frameworkReferenceAssemblies); List<string> coreCombinedReferencesBackup = BackupAndUseOriginalAssemblies(serpRoot, coreCombinedReferences); List<string> coreCompileAssembliesBackup = BackupAndUseOriginalAssemblies(serpRoot, _coreCompileAssemblies); Crossgen2RunnerOptions crossgen2Options = new Crossgen2RunnerOptions() { Composite = false }; var runner = new Crossgen2Runner(_options, crossgen2Options, coreCombinedReferencesBackup); foreach (string assembly in coreCompileAssembliesBackup) { string dllCompile = GetCompileFile(serpRoot, assembly); var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, dllCompile, new string[] { assembly })); fileCompilations.Add(compilationProcess); } } // Individual Serp package assemblies { List<string> packageCombinedReferences = new List<string>(); HashSet<string> simpleNameList = new HashSet<string>(); packageCombinedReferences.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _packageReferenceAssemblies)); packageCombinedReferences.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _coreReferenceAssemblies)); packageCombinedReferences.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _aspReferenceAssemblies)); packageCombinedReferences.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _frameworkReferenceAssemblies)); List<string> packageCombinedReferencesBackup = BackupAndUseOriginalAssemblies(serpRoot, packageCombinedReferences); List<string> packageCompileAssembliesBackup = BackupAndUseOriginalAssemblies(serpRoot, _packageCompileAssemblies); Crossgen2RunnerOptions crossgen2Options = new Crossgen2RunnerOptions() { Composite = false }; var runner = new Crossgen2Runner(_options, crossgen2Options, packageCombinedReferencesBackup); foreach (string assembly in packageCompileAssembliesBackup) { string dllCompile = GetCompileFile(serpRoot, assembly); var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, dllCompile, new string[] { assembly })); fileCompilations.Add(compilationProcess); } } } ParallelRunner.Run(fileCompilations, _options.DegreeOfParallelism); bool success = true; foreach (var compilationProcess in fileCompilations) { if (!compilationProcess.Succeeded) { success = false; Console.WriteLine($"Failed compiling {compilationProcess.Parameters.OutputFileName}"); } } if (!success) return 1; if (_options.Composite) { // For combined composite, move the component assemblies we added the R2R header from the composite out folder // to the correct compile tree destination folder so they get copied into the right place string compositeOutputRootDir = GetCompileFile(serpRoot, BinDir); string frameworkCompositeDll = Path.Combine(compositeOutputRootDir, SerpCompositeFilename); Debug.Assert(File.Exists(frameworkCompositeDll)); var compiledCompositeFiles = Directory.GetFiles(compositeOutputRootDir, "*.dll", SearchOption.AllDirectories); foreach (var componentAssembly in compiledCompositeFiles) { if (Path.GetFileName(componentAssembly).Equals(SerpCompositeFilename)) continue; string assemblyRelativePath = Path.GetRelativePath(compositeOutputRootDir, componentAssembly); string destinationFile = Path.Combine(SerpDir, assemblyRelativePath); Debug.Assert(File.Exists(GetBackupFile(serpRoot, destinationFile))); File.Move(componentAssembly, destinationFile, true); } } // Move everything we compiled to the main directory structure var compiledFiles = Directory.GetFiles(Path.Combine(serpRoot, CompileFolder), "*.dll", SearchOption.AllDirectories); foreach (var file in compiledFiles) { string destinationFile = GetOriginalFile(serpRoot, file); File.Move(file, destinationFile, true); } return success ? 0 : 1; } private static bool ShouldInclude(string file) { if (!string.IsNullOrEmpty(file)) { if (file.EndsWith("Shared.Exports.dll", StringComparison.OrdinalIgnoreCase)) { return true; } if (file.EndsWith(".parallax.dll", StringComparison.OrdinalIgnoreCase)) { return false; } if (!file.EndsWith("Exports.dll", StringComparison.OrdinalIgnoreCase)) { return true; } } return false; } private IEnumerable<string> GetCrossgenAllowedBinDlls() { // This list is hard-coded somewhere in Serp's deployment scripting. return new string[] { "AjaxMin.dll", "AntiXssLibrary.dll", "DomainNameProcessorLibrary.dll", "dotless.Core.dll", "Frontend.PixelBasedTrimmer.dll", "Microsoft.Search.Frontend.AnswersFramework.ServiceInterfaces.dll", "Microsoft.Search.Frontend.AnswersGlue.dll", "Microsoft.Search.Frontend.ApiSchemas.Current.dll", "Microsoft.Search.Frontend.ApiSchemas.Interfaces.dll", "Microsoft.Search.Frontend.CoreUX.dll", "Microsoft.Search.Frontend.CoreUX.Data.dll", "Microsoft.Search.Frontend.CoreUX.Instrumentation.dll", "Microsoft.Search.Frontend.DataSchemas.dll", "Microsoft.Search.Frontend.Data.Bond.dll", "Microsoft.Search.Frontend.Data.BondRepository.dll", "Microsoft.Search.Frontend.Data.LinksModels.dll", "Microsoft.Search.Frontend.Data.Kif.dll", "Microsoft.Search.Frontend.Data.PropertyPath.dll", "Microsoft.Search.Frontend.DeviceCapabilities.dll", "Microsoft.Search.Frontend.dll", "Microsoft.Search.Frontend.Federation.Federators.dll", "Microsoft.Search.Frontend.Hosting.Serp.Core.dll", "Microsoft.Search.Frontend.Hosting.Serp.Runtime.dll", "Microsoft.Search.Frontend.SchemaInterfaces.dll", "Microsoft.Search.Frontend.Serialization.Models.dll", "Microsoft.Search.Frontend.SharedComponents.dll", "SparkleAssembly.dll" }; } private static IEnumerable<string> ResolveReferences(IEnumerable<string> folders) { foreach (string referenceFolder in folders) { foreach (string reference in ComputeManagedAssemblies.GetManagedAssembliesInFolder(referenceFolder)) { yield return reference; } } } /// <summary> /// Backs up the assemblies to a separate folder tree and replaces each file with the original reference /// in the output list. This keeps the Serp folder clean of junk. /// </summary> private static List<string> BackupAndUseOriginalAssemblies(string rootFolder, List<string> assemblies) { List<string> rewrittenList = new List<string>(); foreach (var assembly in assemblies) { rewrittenList.Add(BackupAndUseOriginalAssembly(rootFolder, assembly)); } return rewrittenList; } private static string BackupAndUseOriginalAssembly(string rootFolder, string assembly) { string backupFile = GetBackupFile(rootFolder, assembly); string backupDir = Path.GetDirectoryName(backupFile); if (!Directory.Exists(backupDir)) Directory.CreateDirectory(backupDir); if (!File.Exists(backupFile)) { File.Copy(assembly, backupFile); } return backupFile; } private static string GetBackupFile(string rootFolder, string assembly) { string relativePath = GetOriginalFileRelativePath(rootFolder, assembly); return Path.Combine(rootFolder, BackupFolder, relativePath); } private static string GetCompileFile(string rootFolder, string assembly) { string relativePath = GetOriginalFileRelativePath(rootFolder, assembly); return Path.Combine(rootFolder, CompileFolder, relativePath); } private static string GetOriginalFile(string rootFolder, string assembly) { string relativePath = GetOriginalFileRelativePath(rootFolder, assembly); return Path.Combine(rootFolder, relativePath); } private static string GetOriginalFileRelativePath(string rootFolder, string assembly) { string relativePath = Path.GetRelativePath(rootFolder, assembly); if (relativePath.StartsWith(CompileFolder)) { relativePath = Path.GetRelativePath(Path.Combine(rootFolder, CompileFolder), assembly); } else if (relativePath.StartsWith(BackupFolder)) { relativePath = Path.GetRelativePath(Path.Combine(rootFolder, BackupFolder), assembly); } return relativePath; } private static IEnumerable<string> FilterAssembliesNoSimpleNameDuplicates(HashSet<string> simpleNameSet, IEnumerable<string> assemblyFileList) { foreach (var x in assemblyFileList) { string simpleName = Path.GetFileNameWithoutExtension(x); if (!simpleNameSet.Contains(simpleName)) { simpleNameSet.Add(simpleName); yield return x; } } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Text; namespace R2RTest { class CompileSerpCommand { private static readonly string BackupFolder = "backup"; private static readonly string CompileFolder = "compile"; private static readonly string SerpCompositeFilename = "Microsoft.Search.Frontend.CoreUX.R2R.dll"; private static readonly string AnswersGlueAssemblyFilename = "Microsoft.Search.Frontend.AnswersGlue.dll"; private List<string> _packageCompileAssemblies; private List<string> _packageReferenceAssemblies; private List<string> _coreCompileAssemblies = new List<string>(); private List<string> _coreReferenceAssemblies = new List<string>(); private List<string> _frameworkCompileAssemblies = new List<string>(); private List<string> _frameworkReferenceAssemblies = new List<string>(); private List<string> _aspCompileAssemblies = new List<string>(); private List<string> _aspReferenceAssemblies = new List<string>(); private string SerpDir { get; set; } private string BinDir { get;set; } private BuildOptions _options; public CompileSerpCommand(BuildOptions options) { // This command does not work in the context of an app, just a loose set of rsp files so don't execute anything we compile options.NoJit = true; options.NoEtw = true; options.Release = true; _options = options; if (_options.InputDirectory == null) { throw new ArgumentException("Specify --response-file or --input-directory containing multiple response files."); } if (_options.CoreRootDirectory == null) { throw new ArgumentException("--core-root-directory (--cr) is a required argument."); } if (_options.AspNetPath == null || !File.Exists(Path.Combine(_options.AspNetPath.FullName, "Microsoft.AspNetCore.dll"))) { throw new ArgumentException($"Error: Asp.NET Core path must contain Microsoft.AspNetCore.dll"); } SerpDir = _options.InputDirectory.FullName; BinDir = Path.Combine(SerpDir, "bin"); if (!File.Exists(Path.Combine(SerpDir, "runserp.cmd"))) { throw new ArgumentException($"Error: InputDirectory must point at a SERP build. Could not find {Path.Combine(SerpDir, "runserp.cmd")}"); } // Check that the "Microsoft.Search.Frontend.AnswersGlue.dll" assembly was generated in this drop string answersGlueAssembly = Path.Combine(BinDir, AnswersGlueAssemblyFilename); if (!File.Exists(answersGlueAssembly)) { throw new FileNotFoundException($"Could not find {answersGlueAssembly}. Run {SerpDir}\\GenAnswersEntryPoints.bat first!"); } // Add all assemblies from the various SERP packages (filtered by ShouldInclude) _packageCompileAssemblies = Directory.GetFiles(Path.Combine(SerpDir, "App_Data\\Answers\\Services\\Packages"), "*.dll", SearchOption.AllDirectories) .Where((string x) => ShouldInclude(x)) .ToList(); _packageReferenceAssemblies = new List<string>(); { HashSet<string> packageReferenceAssemblyDirectories = new HashSet<string>(); foreach (var binFile in _packageCompileAssemblies) { var directory = Path.GetDirectoryName(binFile); if (!packageReferenceAssemblyDirectories.Contains(directory)) packageReferenceAssemblyDirectories.Add(directory); } foreach (string binFile in ResolveReferences(packageReferenceAssemblyDirectories)) { _packageReferenceAssemblies.Add(binFile); } } _coreCompileAssemblies = new List<string>(); _coreReferenceAssemblies = new List<string>(); { // Add an allow-list of assemblies from bin. This unified list includes binaries from /bin and /App_data so filter just the /bin assemblies foreach (string item in GetCrossgenAllowedBinDlls()) { string binAssembly = Path.Combine(BinDir, item); if (File.Exists(binAssembly) && !FrameworkExclusion.Exclude(Path.GetFileNameWithoutExtension(binAssembly), CompilerIndex.CPAOT, out string reason)) { _coreCompileAssemblies.Add(binAssembly); } } HashSet<string> coreReferenceAssemblyDirectories = new HashSet<string>(); foreach (var binFile in _coreCompileAssemblies) { var directory = Path.GetDirectoryName(binFile); if (!coreReferenceAssemblyDirectories.Contains(directory)) coreReferenceAssemblyDirectories.Add(directory); } foreach (string binFile in ResolveReferences(coreReferenceAssemblyDirectories)) { _coreReferenceAssemblies.Add(binFile); } } _frameworkCompileAssemblies = new List<string>(); _frameworkReferenceAssemblies = new List<string>(); { foreach (string frameworkDll in ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.CoreRootDirectory.FullName, "System.*.dll")) { string simpleName = Path.GetFileNameWithoutExtension(frameworkDll); if (!FrameworkExclusion.Exclude(simpleName, CompilerIndex.CPAOT, out string reason)) { _frameworkCompileAssemblies.Add(frameworkDll); } } foreach (string frameworkDll in ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.CoreRootDirectory.FullName, "Microsoft.*.dll")) { string simpleName = Path.GetFileNameWithoutExtension(frameworkDll); if (!FrameworkExclusion.Exclude(simpleName, CompilerIndex.CPAOT, out string reason)) { _frameworkCompileAssemblies.Add(frameworkDll); } } _frameworkCompileAssemblies.Add(Path.Combine(options.CoreRootDirectory.FullName, "mscorlib.dll")); _frameworkCompileAssemblies.Add(Path.Combine(options.CoreRootDirectory.FullName, "netstandard.dll")); _frameworkReferenceAssemblies.AddRange(ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.CoreRootDirectory.FullName, "System.*.dll")); _frameworkReferenceAssemblies.AddRange(ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.CoreRootDirectory.FullName, "Microsoft.*.dll")); _frameworkReferenceAssemblies.Add(Path.Combine(options.CoreRootDirectory.FullName, "mscorlib.dll")); _frameworkReferenceAssemblies.Add(Path.Combine(options.CoreRootDirectory.FullName, "netstandard.dll")); } _aspCompileAssemblies = new List<string>(); _aspReferenceAssemblies = new List<string>(); { _aspCompileAssemblies.AddRange(ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.AspNetPath.FullName, "Microsoft.AspNetCore.*.dll")); _aspCompileAssemblies.AddRange(ComputeManagedAssemblies.GetManagedAssembliesInFolder(options.AspNetPath.FullName, "Microsoft.Extensions.*.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "Microsoft.JSInterop.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "Microsoft.Net.Http.Headers.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "Microsoft.Win32.SystemEvents.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Diagnostics.EventLog.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Drawing.Common.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.IO.Pipelines.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Security.Cryptography.Pkcs.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Security.Cryptography.Xml.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Security.Permissions.dll")); _aspCompileAssemblies.Add(Path.Combine(options.AspNetPath.FullName, "System.Windows.Extensions.dll")); _aspReferenceAssemblies = new List<string>(_aspCompileAssemblies); } } public int CompileSerpAssemblies() { Console.WriteLine("Compiling serp in " + (_options.Composite ? "composite" : "single assembly") + " mode"); string serpRoot = Directory.GetParent(SerpDir).Parent.Parent.Parent.FullName; string compileOutRoot = Path.Combine(serpRoot, CompileFolder); if (Directory.Exists(compileOutRoot)) Directory.Delete(compileOutRoot, true); List<ProcessInfo> fileCompilations = new List<ProcessInfo>(); // Single composite image for all of Serp if (_options.Composite) { List<string> combinedCompileAssemblies = new List<string>(); HashSet<string> simpleNameList = new HashSet<string>(); combinedCompileAssemblies.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _coreCompileAssemblies)); combinedCompileAssemblies.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _aspCompileAssemblies)); combinedCompileAssemblies.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _frameworkCompileAssemblies)); combinedCompileAssemblies.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _packageCompileAssemblies)); List<string> combinedCompileAssembliesBackup = BackupAndUseOriginalAssemblies(serpRoot, combinedCompileAssemblies); string compositeDllPath = Path.Combine(BinDir, SerpCompositeFilename); if (File.Exists(compositeDllPath)) File.Delete(compositeDllPath); string compositeDllCompile = GetCompileFile(serpRoot, compositeDllPath); Crossgen2RunnerOptions crossgen2Options = new Crossgen2RunnerOptions() { Composite = true, CompositeRoot = GetBackupFile(serpRoot, SerpDir), PartialComposite = true }; var runner = new Crossgen2Runner(_options, crossgen2Options, combinedCompileAssembliesBackup); var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, compositeDllCompile, combinedCompileAssembliesBackup)); fileCompilations.Add(compilationProcess); } else { // Framework assemblies { List<string> frameworkCompileAssembliesBackup = BackupAndUseOriginalAssemblies(serpRoot, _frameworkCompileAssemblies); Crossgen2RunnerOptions crossgen2Options = new Crossgen2RunnerOptions() { Composite = false }; var runner = new Crossgen2Runner(_options, crossgen2Options, new List<string>()); foreach (string assembly in frameworkCompileAssembliesBackup) { string dllCompile = GetCompileFile(serpRoot, assembly); var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, dllCompile, new string[] { assembly })); fileCompilations.Add(compilationProcess); } } // Asp.Net { List<string> aspCombinedReferences = new List<string>(); aspCombinedReferences.AddRange(_aspReferenceAssemblies); aspCombinedReferences.AddRange(_frameworkCompileAssemblies); List<string> aspCombinedReferencesBackup = BackupAndUseOriginalAssemblies(serpRoot, aspCombinedReferences); List<string> aspCompileAssembliesBackup = BackupAndUseOriginalAssemblies(serpRoot, _aspCompileAssemblies); Crossgen2RunnerOptions crossgen2Options = new Crossgen2RunnerOptions() { Composite = false }; var runner = new Crossgen2Runner(_options, crossgen2Options, aspCombinedReferencesBackup); foreach (string assembly in aspCompileAssembliesBackup) { string dllCompile = GetCompileFile(serpRoot, assembly); var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, dllCompile, new string[] { assembly })); fileCompilations.Add(compilationProcess); } } // Serp core { List<string> coreCombinedReferences = new List<string>(); coreCombinedReferences.AddRange(_coreReferenceAssemblies); coreCombinedReferences.AddRange(_aspReferenceAssemblies); coreCombinedReferences.AddRange(_frameworkReferenceAssemblies); List<string> coreCombinedReferencesBackup = BackupAndUseOriginalAssemblies(serpRoot, coreCombinedReferences); List<string> coreCompileAssembliesBackup = BackupAndUseOriginalAssemblies(serpRoot, _coreCompileAssemblies); Crossgen2RunnerOptions crossgen2Options = new Crossgen2RunnerOptions() { Composite = false }; var runner = new Crossgen2Runner(_options, crossgen2Options, coreCombinedReferencesBackup); foreach (string assembly in coreCompileAssembliesBackup) { string dllCompile = GetCompileFile(serpRoot, assembly); var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, dllCompile, new string[] { assembly })); fileCompilations.Add(compilationProcess); } } // Individual Serp package assemblies { List<string> packageCombinedReferences = new List<string>(); HashSet<string> simpleNameList = new HashSet<string>(); packageCombinedReferences.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _packageReferenceAssemblies)); packageCombinedReferences.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _coreReferenceAssemblies)); packageCombinedReferences.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _aspReferenceAssemblies)); packageCombinedReferences.AddRange(FilterAssembliesNoSimpleNameDuplicates(simpleNameList, _frameworkReferenceAssemblies)); List<string> packageCombinedReferencesBackup = BackupAndUseOriginalAssemblies(serpRoot, packageCombinedReferences); List<string> packageCompileAssembliesBackup = BackupAndUseOriginalAssemblies(serpRoot, _packageCompileAssemblies); Crossgen2RunnerOptions crossgen2Options = new Crossgen2RunnerOptions() { Composite = false }; var runner = new Crossgen2Runner(_options, crossgen2Options, packageCombinedReferencesBackup); foreach (string assembly in packageCompileAssembliesBackup) { string dllCompile = GetCompileFile(serpRoot, assembly); var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, dllCompile, new string[] { assembly })); fileCompilations.Add(compilationProcess); } } } ParallelRunner.Run(fileCompilations, _options.DegreeOfParallelism); bool success = true; foreach (var compilationProcess in fileCompilations) { if (!compilationProcess.Succeeded) { success = false; Console.WriteLine($"Failed compiling {compilationProcess.Parameters.OutputFileName}"); } } if (!success) return 1; if (_options.Composite) { // For combined composite, move the component assemblies we added the R2R header from the composite out folder // to the correct compile tree destination folder so they get copied into the right place string compositeOutputRootDir = GetCompileFile(serpRoot, BinDir); string frameworkCompositeDll = Path.Combine(compositeOutputRootDir, SerpCompositeFilename); Debug.Assert(File.Exists(frameworkCompositeDll)); var compiledCompositeFiles = Directory.GetFiles(compositeOutputRootDir, "*.dll", SearchOption.AllDirectories); foreach (var componentAssembly in compiledCompositeFiles) { if (Path.GetFileName(componentAssembly).Equals(SerpCompositeFilename)) continue; string assemblyRelativePath = Path.GetRelativePath(compositeOutputRootDir, componentAssembly); string destinationFile = Path.Combine(SerpDir, assemblyRelativePath); Debug.Assert(File.Exists(GetBackupFile(serpRoot, destinationFile))); File.Move(componentAssembly, destinationFile, true); } } // Move everything we compiled to the main directory structure var compiledFiles = Directory.GetFiles(Path.Combine(serpRoot, CompileFolder), "*.dll", SearchOption.AllDirectories); foreach (var file in compiledFiles) { string destinationFile = GetOriginalFile(serpRoot, file); File.Move(file, destinationFile, true); } return success ? 0 : 1; } private static bool ShouldInclude(string file) { if (!string.IsNullOrEmpty(file)) { if (file.EndsWith("Shared.Exports.dll", StringComparison.OrdinalIgnoreCase)) { return true; } if (file.EndsWith(".parallax.dll", StringComparison.OrdinalIgnoreCase)) { return false; } if (!file.EndsWith("Exports.dll", StringComparison.OrdinalIgnoreCase)) { return true; } } return false; } private IEnumerable<string> GetCrossgenAllowedBinDlls() { // This list is hard-coded somewhere in Serp's deployment scripting. return new string[] { "AjaxMin.dll", "AntiXssLibrary.dll", "DomainNameProcessorLibrary.dll", "dotless.Core.dll", "Frontend.PixelBasedTrimmer.dll", "Microsoft.Search.Frontend.AnswersFramework.ServiceInterfaces.dll", "Microsoft.Search.Frontend.AnswersGlue.dll", "Microsoft.Search.Frontend.ApiSchemas.Current.dll", "Microsoft.Search.Frontend.ApiSchemas.Interfaces.dll", "Microsoft.Search.Frontend.CoreUX.dll", "Microsoft.Search.Frontend.CoreUX.Data.dll", "Microsoft.Search.Frontend.CoreUX.Instrumentation.dll", "Microsoft.Search.Frontend.DataSchemas.dll", "Microsoft.Search.Frontend.Data.Bond.dll", "Microsoft.Search.Frontend.Data.BondRepository.dll", "Microsoft.Search.Frontend.Data.LinksModels.dll", "Microsoft.Search.Frontend.Data.Kif.dll", "Microsoft.Search.Frontend.Data.PropertyPath.dll", "Microsoft.Search.Frontend.DeviceCapabilities.dll", "Microsoft.Search.Frontend.dll", "Microsoft.Search.Frontend.Federation.Federators.dll", "Microsoft.Search.Frontend.Hosting.Serp.Core.dll", "Microsoft.Search.Frontend.Hosting.Serp.Runtime.dll", "Microsoft.Search.Frontend.SchemaInterfaces.dll", "Microsoft.Search.Frontend.Serialization.Models.dll", "Microsoft.Search.Frontend.SharedComponents.dll", "SparkleAssembly.dll" }; } private static IEnumerable<string> ResolveReferences(IEnumerable<string> folders) { foreach (string referenceFolder in folders) { foreach (string reference in ComputeManagedAssemblies.GetManagedAssembliesInFolder(referenceFolder)) { yield return reference; } } } /// <summary> /// Backs up the assemblies to a separate folder tree and replaces each file with the original reference /// in the output list. This keeps the Serp folder clean of junk. /// </summary> private static List<string> BackupAndUseOriginalAssemblies(string rootFolder, List<string> assemblies) { List<string> rewrittenList = new List<string>(); foreach (var assembly in assemblies) { rewrittenList.Add(BackupAndUseOriginalAssembly(rootFolder, assembly)); } return rewrittenList; } private static string BackupAndUseOriginalAssembly(string rootFolder, string assembly) { string backupFile = GetBackupFile(rootFolder, assembly); string backupDir = Path.GetDirectoryName(backupFile); if (!Directory.Exists(backupDir)) Directory.CreateDirectory(backupDir); if (!File.Exists(backupFile)) { File.Copy(assembly, backupFile); } return backupFile; } private static string GetBackupFile(string rootFolder, string assembly) { string relativePath = GetOriginalFileRelativePath(rootFolder, assembly); return Path.Combine(rootFolder, BackupFolder, relativePath); } private static string GetCompileFile(string rootFolder, string assembly) { string relativePath = GetOriginalFileRelativePath(rootFolder, assembly); return Path.Combine(rootFolder, CompileFolder, relativePath); } private static string GetOriginalFile(string rootFolder, string assembly) { string relativePath = GetOriginalFileRelativePath(rootFolder, assembly); return Path.Combine(rootFolder, relativePath); } private static string GetOriginalFileRelativePath(string rootFolder, string assembly) { string relativePath = Path.GetRelativePath(rootFolder, assembly); if (relativePath.StartsWith(CompileFolder)) { relativePath = Path.GetRelativePath(Path.Combine(rootFolder, CompileFolder), assembly); } else if (relativePath.StartsWith(BackupFolder)) { relativePath = Path.GetRelativePath(Path.Combine(rootFolder, BackupFolder), assembly); } return relativePath; } private static IEnumerable<string> FilterAssembliesNoSimpleNameDuplicates(HashSet<string> simpleNameSet, IEnumerable<string> assemblyFileList) { foreach (var x in assemblyFileList) { string simpleName = Path.GetFileNameWithoutExtension(x); if (!simpleNameSet.Contains(simpleName)) { simpleNameSet.Add(simpleName); yield return x; } } } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/baseservices/threading/regressions/13662/13662-simple.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <!-- Under heavy load, some of the TimerCallback functions don't complete before the test exits, preventing unload --> <UnloadabilityIncompatible>true</UnloadabilityIncompatible> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="simple.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <!-- Under heavy load, some of the TimerCallback functions don't complete before the test exits, preventing unload --> <UnloadabilityIncompatible>true</UnloadabilityIncompatible> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="simple.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/Loader/classloader/generics/Instantiation/Positive/MultipleInterface14.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="MultipleInterface14.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="MultipleInterface14.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatch.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; public class TryCatch{ public static int Main(String [] args) { int retVal = 100; int i = 0; String m_str = ""; String str = "Done"; try { throw new ArithmeticException(); } catch ( ArithmeticException ) { m_str = m_str + "ArithmeticException\n"; i++; } try { throw new DivideByZeroException(); } catch ( DivideByZeroException ) { m_str = m_str + "DivideByZeroException\n"; i++; } try { throw new OverflowException(); } catch ( OverflowException ) { m_str = m_str + "OverflowException\n"; i++; } try { throw new ArgumentException(); } catch ( ArgumentException ) { m_str = m_str + "ArgumentException\n"; i++; } try { throw new ArrayTypeMismatchException(); } catch ( ArrayTypeMismatchException ) { m_str = m_str + "ArrayTypeMismatchException\n"; i++; } try { throw new MemberAccessException(); } catch ( MemberAccessException ) { m_str = m_str + "AccessException\n"; i++; } try { throw new FieldAccessException(); } catch ( FieldAccessException ) { m_str = m_str + "FieldAccessException\n"; i++; } try { throw new MissingFieldException(); } catch ( MissingFieldException ) { m_str = m_str + "MissingFieldException\n"; i++; } try { throw new MethodAccessException(); } catch ( MethodAccessException ) { m_str = m_str + "MethodAccessException\n"; i++; } try { throw new MissingMethodException(); } catch ( MissingMethodException ) { m_str = m_str + "MissingMethodException\n"; i++; } Console.WriteLine( m_str ); if (i == 10){ Console.WriteLine("Test Passed"); } else { Console.WriteLine("Test Failed"); retVal = 1; } Console.WriteLine(str); return retVal; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; public class TryCatch{ public static int Main(String [] args) { int retVal = 100; int i = 0; String m_str = ""; String str = "Done"; try { throw new ArithmeticException(); } catch ( ArithmeticException ) { m_str = m_str + "ArithmeticException\n"; i++; } try { throw new DivideByZeroException(); } catch ( DivideByZeroException ) { m_str = m_str + "DivideByZeroException\n"; i++; } try { throw new OverflowException(); } catch ( OverflowException ) { m_str = m_str + "OverflowException\n"; i++; } try { throw new ArgumentException(); } catch ( ArgumentException ) { m_str = m_str + "ArgumentException\n"; i++; } try { throw new ArrayTypeMismatchException(); } catch ( ArrayTypeMismatchException ) { m_str = m_str + "ArrayTypeMismatchException\n"; i++; } try { throw new MemberAccessException(); } catch ( MemberAccessException ) { m_str = m_str + "AccessException\n"; i++; } try { throw new FieldAccessException(); } catch ( FieldAccessException ) { m_str = m_str + "FieldAccessException\n"; i++; } try { throw new MissingFieldException(); } catch ( MissingFieldException ) { m_str = m_str + "MissingFieldException\n"; i++; } try { throw new MethodAccessException(); } catch ( MethodAccessException ) { m_str = m_str + "MethodAccessException\n"; i++; } try { throw new MissingMethodException(); } catch ( MissingMethodException ) { m_str = m_str + "MissingMethodException\n"; i++; } Console.WriteLine( m_str ); if (i == 10){ Console.WriteLine("Test Passed"); } else { Console.WriteLine("Test Failed"); retVal = 1; } Console.WriteLine(str); return retVal; } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/mono/wasm/runtime/roots.ts
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. import cwraps from "./cwraps"; import { Module } from "./imports"; import { VoidPtr, ManagedPointer, NativePointer } from "./types/emscripten"; const maxScratchRoots = 8192; let _scratch_root_buffer: WasmRootBuffer | null = null; let _scratch_root_free_indices: Int32Array | null = null; let _scratch_root_free_indices_count = 0; const _scratch_root_free_instances: WasmRoot<any>[] = []; const _external_root_free_instances: WasmExternalRoot<any>[] = []; /** * Allocates a block of memory that can safely contain pointers into the managed heap. * The result object has get(index) and set(index, value) methods that can be used to retrieve and store managed pointers. * Once you are done using the root buffer, you must call its release() method. * For small numbers of roots, it is preferable to use the mono_wasm_new_root and mono_wasm_new_roots APIs instead. */ export function mono_wasm_new_root_buffer(capacity: number, name?: string): WasmRootBuffer { if (capacity <= 0) throw new Error("capacity >= 1"); capacity = capacity | 0; const capacityBytes = capacity * 4; const offset = Module._malloc(capacityBytes); if ((<any>offset % 4) !== 0) throw new Error("Malloc returned an unaligned offset"); _zero_region(offset, capacityBytes); return new WasmRootBuffer(offset, capacity, true, name); } /** * Creates a root buffer object representing an existing allocation in the native heap and registers * the allocation with the GC. The caller is responsible for managing the lifetime of the allocation. */ export function mono_wasm_new_root_buffer_from_pointer(offset: VoidPtr, capacity: number, name?: string): WasmRootBuffer { if (capacity <= 0) throw new Error("capacity >= 1"); capacity = capacity | 0; const capacityBytes = capacity * 4; if ((<any>offset % 4) !== 0) throw new Error("Unaligned offset"); _zero_region(offset, capacityBytes); return new WasmRootBuffer(offset, capacity, false, name); } /** * Allocates a WasmRoot pointing to a root provided and controlled by external code. Typicaly on managed stack. * Releasing this root will not de-allocate the root space. You still need to call .release(). */ export function mono_wasm_new_external_root<T extends ManagedPointer | NativePointer>(address: VoidPtr): WasmRoot<T> { let result: WasmExternalRoot<T>; if (!address) throw new Error("address must be a location in the native heap"); if (_external_root_free_instances.length > 0) { result = _external_root_free_instances.pop()!; result._set_address(address); } else { result = new WasmExternalRoot<T>(address); } return result; } /** * Allocates temporary storage for a pointer into the managed heap. * Pointers stored here will be visible to the GC, ensuring that the object they point to aren't moved or collected. * If you already have a managed pointer you can pass it as an argument to initialize the temporary storage. * The result object has get() and set(value) methods, along with a .value property. * When you are done using the root you must call its .release() method. */ export function mono_wasm_new_root<T extends ManagedPointer | NativePointer>(value: T | undefined = undefined): WasmRoot<T> { let result: WasmRoot<T>; if (_scratch_root_free_instances.length > 0) { result = _scratch_root_free_instances.pop()!; } else { const index = _mono_wasm_claim_scratch_index(); const buffer = _scratch_root_buffer; result = new WasmJsOwnedRoot(buffer!, index); } if (value !== undefined) { if (typeof (value) !== "number") throw new Error("value must be an address in the managed heap"); result.set(value); } else { result.set(<any>0); } return result; } /** * Allocates 1 or more temporary roots, accepting either a number of roots or an array of pointers. * mono_wasm_new_roots(n): returns an array of N zero-initialized roots. * mono_wasm_new_roots([a, b, ...]) returns an array of new roots initialized with each element. * Each root must be released with its release method, or using the mono_wasm_release_roots API. */ export function mono_wasm_new_roots<T extends ManagedPointer | NativePointer>(count_or_values: number | T[]): WasmRoot<T>[] { let result; if (Array.isArray(count_or_values)) { result = new Array(count_or_values.length); for (let i = 0; i < result.length; i++) result[i] = mono_wasm_new_root(count_or_values[i]); } else if ((count_or_values | 0) > 0) { result = new Array(count_or_values); for (let i = 0; i < result.length; i++) result[i] = mono_wasm_new_root(); } else { throw new Error("count_or_values must be either an array or a number greater than 0"); } return result; } /** * Releases 1 or more root or root buffer objects. * Multiple objects may be passed on the argument list. * 'undefined' may be passed as an argument so it is safe to call this method from finally blocks * even if you are not sure all of your roots have been created yet. * @param {... WasmRoot} roots */ export function mono_wasm_release_roots(...args: WasmRoot<any>[]): void { for (let i = 0; i < args.length; i++) { if (!args[i]) continue; args[i].release(); } } function _zero_region(byteOffset: VoidPtr, sizeBytes: number) { if (((<any>byteOffset % 4) === 0) && ((sizeBytes % 4) === 0)) Module.HEAP32.fill(0, <any>byteOffset >>> 2, sizeBytes >>> 2); else Module.HEAP8.fill(0, <any>byteOffset, sizeBytes); } function _mono_wasm_release_scratch_index(index: number) { if (index === undefined) return; _scratch_root_buffer!.set(index, <any>0); _scratch_root_free_indices![_scratch_root_free_indices_count] = index; _scratch_root_free_indices_count++; } function _mono_wasm_claim_scratch_index() { if (!_scratch_root_buffer || !_scratch_root_free_indices) { _scratch_root_buffer = mono_wasm_new_root_buffer(maxScratchRoots, "js roots"); _scratch_root_free_indices = new Int32Array(maxScratchRoots); _scratch_root_free_indices_count = maxScratchRoots; for (let i = 0; i < maxScratchRoots; i++) _scratch_root_free_indices[i] = maxScratchRoots - i - 1; } if (_scratch_root_free_indices_count < 1) throw new Error("Out of scratch root space"); const result = _scratch_root_free_indices[_scratch_root_free_indices_count - 1]; _scratch_root_free_indices_count--; return result; } export class WasmRootBuffer { private __count: number; private length: number; private __offset: VoidPtr; private __offset32: number; private __handle: number; private __ownsAllocation: boolean; constructor(offset: VoidPtr, capacity: number, ownsAllocation: boolean, name?: string) { const capacityBytes = capacity * 4; this.__offset = offset; this.__offset32 = <number><any>offset >>> 2; this.__count = capacity; this.length = capacity; this.__handle = cwraps.mono_wasm_register_root(offset, capacityBytes, name || "noname"); this.__ownsAllocation = ownsAllocation; } _throw_index_out_of_range(): void { throw new Error("index out of range"); } _check_in_range(index: number): void { if ((index >= this.__count) || (index < 0)) this._throw_index_out_of_range(); } get_address(index: number): NativePointer { this._check_in_range(index); return <any>this.__offset + (index * 4); } get_address_32(index: number): number { this._check_in_range(index); return this.__offset32 + index; } // NOTE: These functions do not use the helpers from memory.ts because WasmRoot.get and WasmRoot.set // are hot-spots when you profile any application that uses the bindings extensively. get(index: number): ManagedPointer { this._check_in_range(index); const offset = this.get_address_32(index); return <any>Module.HEAP32[offset]; } set(index: number, value: ManagedPointer): ManagedPointer { const offset = this.get_address_32(index); Module.HEAP32[offset] = <any>value; return value; } _unsafe_get(index: number): number { return Module.HEAP32[this.__offset32 + index]; } _unsafe_set(index: number, value: ManagedPointer | NativePointer): void { Module.HEAP32[this.__offset32 + index] = <any>value; } clear(): void { if (this.__offset) _zero_region(this.__offset, this.__count * 4); } release(): void { if (this.__offset && this.__ownsAllocation) { cwraps.mono_wasm_deregister_root(this.__offset); _zero_region(this.__offset, this.__count * 4); Module._free(this.__offset); } this.__handle = (<any>this.__offset) = this.__count = this.__offset32 = 0; } toString(): string { return `[root buffer @${this.get_address(0)}, size ${this.__count} ]`; } } export interface WasmRoot<T extends ManagedPointer | NativePointer> { get_address(): NativePointer; get_address_32(): number; get(): T; set(value: T): T; get value(): T; set value(value: T); valueOf(): T; clear(): void; release(): void; toString(): string; } class WasmJsOwnedRoot<T extends ManagedPointer | NativePointer> implements WasmRoot<T> { private __buffer: WasmRootBuffer; private __index: number; constructor(buffer: WasmRootBuffer, index: number) { this.__buffer = buffer;//TODO this.__index = index; } get_address(): NativePointer { return this.__buffer.get_address(this.__index); } get_address_32(): number { return this.__buffer.get_address_32(this.__index); } get(): T { const result = this.__buffer._unsafe_get(this.__index); return <any>result; } set(value: T): T { this.__buffer._unsafe_set(this.__index, value); return value; } get value(): T { return this.get(); } set value(value: T) { this.set(value); } valueOf(): T { return this.get(); } clear(): void { this.set(<any>0); } release(): void { if (!this.__buffer) throw new Error("No buffer"); const maxPooledInstances = 128; if (_scratch_root_free_instances.length > maxPooledInstances) { _mono_wasm_release_scratch_index(this.__index); (<any>this).__buffer = null; this.__index = 0; } else { this.set(<any>0); _scratch_root_free_instances.push(this); } } toString(): string { return `[root @${this.get_address()}]`; } } class WasmExternalRoot<T extends ManagedPointer | NativePointer> implements WasmRoot<T> { private __external_address: NativePointer = <any>undefined; private __external_address_32: number = <any>undefined; constructor(address: NativePointer) { this._set_address(address); } _set_address(address: NativePointer): void { this.__external_address = address; this.__external_address_32 = <number><any>address >>> 2; } get_address(): NativePointer { return this.__external_address; } get_address_32(): number { return this.__external_address_32; } get(): T { const result = Module.HEAPU32[this.__external_address_32]; return <any>result; } set(value: T): T { Module.HEAPU32[this.__external_address_32] = <number><any>value; return value; } get value(): T { return this.get(); } set value(value: T) { this.set(value); } valueOf(): T { return this.get(); } clear(): void { this.set(<any>0); } release(): void { const maxPooledInstances = 128; if (_external_root_free_instances.length < maxPooledInstances) _external_root_free_instances.push(this); } toString(): string { return `[external root @${this.get_address()}]`; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. import cwraps from "./cwraps"; import { Module } from "./imports"; import { VoidPtr, ManagedPointer, NativePointer } from "./types/emscripten"; const maxScratchRoots = 8192; let _scratch_root_buffer: WasmRootBuffer | null = null; let _scratch_root_free_indices: Int32Array | null = null; let _scratch_root_free_indices_count = 0; const _scratch_root_free_instances: WasmRoot<any>[] = []; const _external_root_free_instances: WasmExternalRoot<any>[] = []; /** * Allocates a block of memory that can safely contain pointers into the managed heap. * The result object has get(index) and set(index, value) methods that can be used to retrieve and store managed pointers. * Once you are done using the root buffer, you must call its release() method. * For small numbers of roots, it is preferable to use the mono_wasm_new_root and mono_wasm_new_roots APIs instead. */ export function mono_wasm_new_root_buffer(capacity: number, name?: string): WasmRootBuffer { if (capacity <= 0) throw new Error("capacity >= 1"); capacity = capacity | 0; const capacityBytes = capacity * 4; const offset = Module._malloc(capacityBytes); if ((<any>offset % 4) !== 0) throw new Error("Malloc returned an unaligned offset"); _zero_region(offset, capacityBytes); return new WasmRootBuffer(offset, capacity, true, name); } /** * Creates a root buffer object representing an existing allocation in the native heap and registers * the allocation with the GC. The caller is responsible for managing the lifetime of the allocation. */ export function mono_wasm_new_root_buffer_from_pointer(offset: VoidPtr, capacity: number, name?: string): WasmRootBuffer { if (capacity <= 0) throw new Error("capacity >= 1"); capacity = capacity | 0; const capacityBytes = capacity * 4; if ((<any>offset % 4) !== 0) throw new Error("Unaligned offset"); _zero_region(offset, capacityBytes); return new WasmRootBuffer(offset, capacity, false, name); } /** * Allocates a WasmRoot pointing to a root provided and controlled by external code. Typicaly on managed stack. * Releasing this root will not de-allocate the root space. You still need to call .release(). */ export function mono_wasm_new_external_root<T extends ManagedPointer | NativePointer>(address: VoidPtr): WasmRoot<T> { let result: WasmExternalRoot<T>; if (!address) throw new Error("address must be a location in the native heap"); if (_external_root_free_instances.length > 0) { result = _external_root_free_instances.pop()!; result._set_address(address); } else { result = new WasmExternalRoot<T>(address); } return result; } /** * Allocates temporary storage for a pointer into the managed heap. * Pointers stored here will be visible to the GC, ensuring that the object they point to aren't moved or collected. * If you already have a managed pointer you can pass it as an argument to initialize the temporary storage. * The result object has get() and set(value) methods, along with a .value property. * When you are done using the root you must call its .release() method. */ export function mono_wasm_new_root<T extends ManagedPointer | NativePointer>(value: T | undefined = undefined): WasmRoot<T> { let result: WasmRoot<T>; if (_scratch_root_free_instances.length > 0) { result = _scratch_root_free_instances.pop()!; } else { const index = _mono_wasm_claim_scratch_index(); const buffer = _scratch_root_buffer; result = new WasmJsOwnedRoot(buffer!, index); } if (value !== undefined) { if (typeof (value) !== "number") throw new Error("value must be an address in the managed heap"); result.set(value); } else { result.set(<any>0); } return result; } /** * Allocates 1 or more temporary roots, accepting either a number of roots or an array of pointers. * mono_wasm_new_roots(n): returns an array of N zero-initialized roots. * mono_wasm_new_roots([a, b, ...]) returns an array of new roots initialized with each element. * Each root must be released with its release method, or using the mono_wasm_release_roots API. */ export function mono_wasm_new_roots<T extends ManagedPointer | NativePointer>(count_or_values: number | T[]): WasmRoot<T>[] { let result; if (Array.isArray(count_or_values)) { result = new Array(count_or_values.length); for (let i = 0; i < result.length; i++) result[i] = mono_wasm_new_root(count_or_values[i]); } else if ((count_or_values | 0) > 0) { result = new Array(count_or_values); for (let i = 0; i < result.length; i++) result[i] = mono_wasm_new_root(); } else { throw new Error("count_or_values must be either an array or a number greater than 0"); } return result; } /** * Releases 1 or more root or root buffer objects. * Multiple objects may be passed on the argument list. * 'undefined' may be passed as an argument so it is safe to call this method from finally blocks * even if you are not sure all of your roots have been created yet. * @param {... WasmRoot} roots */ export function mono_wasm_release_roots(...args: WasmRoot<any>[]): void { for (let i = 0; i < args.length; i++) { if (!args[i]) continue; args[i].release(); } } function _zero_region(byteOffset: VoidPtr, sizeBytes: number) { if (((<any>byteOffset % 4) === 0) && ((sizeBytes % 4) === 0)) Module.HEAP32.fill(0, <any>byteOffset >>> 2, sizeBytes >>> 2); else Module.HEAP8.fill(0, <any>byteOffset, sizeBytes); } function _mono_wasm_release_scratch_index(index: number) { if (index === undefined) return; _scratch_root_buffer!.set(index, <any>0); _scratch_root_free_indices![_scratch_root_free_indices_count] = index; _scratch_root_free_indices_count++; } function _mono_wasm_claim_scratch_index() { if (!_scratch_root_buffer || !_scratch_root_free_indices) { _scratch_root_buffer = mono_wasm_new_root_buffer(maxScratchRoots, "js roots"); _scratch_root_free_indices = new Int32Array(maxScratchRoots); _scratch_root_free_indices_count = maxScratchRoots; for (let i = 0; i < maxScratchRoots; i++) _scratch_root_free_indices[i] = maxScratchRoots - i - 1; } if (_scratch_root_free_indices_count < 1) throw new Error("Out of scratch root space"); const result = _scratch_root_free_indices[_scratch_root_free_indices_count - 1]; _scratch_root_free_indices_count--; return result; } export class WasmRootBuffer { private __count: number; private length: number; private __offset: VoidPtr; private __offset32: number; private __handle: number; private __ownsAllocation: boolean; constructor(offset: VoidPtr, capacity: number, ownsAllocation: boolean, name?: string) { const capacityBytes = capacity * 4; this.__offset = offset; this.__offset32 = <number><any>offset >>> 2; this.__count = capacity; this.length = capacity; this.__handle = cwraps.mono_wasm_register_root(offset, capacityBytes, name || "noname"); this.__ownsAllocation = ownsAllocation; } _throw_index_out_of_range(): void { throw new Error("index out of range"); } _check_in_range(index: number): void { if ((index >= this.__count) || (index < 0)) this._throw_index_out_of_range(); } get_address(index: number): NativePointer { this._check_in_range(index); return <any>this.__offset + (index * 4); } get_address_32(index: number): number { this._check_in_range(index); return this.__offset32 + index; } // NOTE: These functions do not use the helpers from memory.ts because WasmRoot.get and WasmRoot.set // are hot-spots when you profile any application that uses the bindings extensively. get(index: number): ManagedPointer { this._check_in_range(index); const offset = this.get_address_32(index); return <any>Module.HEAP32[offset]; } set(index: number, value: ManagedPointer): ManagedPointer { const offset = this.get_address_32(index); Module.HEAP32[offset] = <any>value; return value; } _unsafe_get(index: number): number { return Module.HEAP32[this.__offset32 + index]; } _unsafe_set(index: number, value: ManagedPointer | NativePointer): void { Module.HEAP32[this.__offset32 + index] = <any>value; } clear(): void { if (this.__offset) _zero_region(this.__offset, this.__count * 4); } release(): void { if (this.__offset && this.__ownsAllocation) { cwraps.mono_wasm_deregister_root(this.__offset); _zero_region(this.__offset, this.__count * 4); Module._free(this.__offset); } this.__handle = (<any>this.__offset) = this.__count = this.__offset32 = 0; } toString(): string { return `[root buffer @${this.get_address(0)}, size ${this.__count} ]`; } } export interface WasmRoot<T extends ManagedPointer | NativePointer> { get_address(): NativePointer; get_address_32(): number; get(): T; set(value: T): T; get value(): T; set value(value: T); valueOf(): T; clear(): void; release(): void; toString(): string; } class WasmJsOwnedRoot<T extends ManagedPointer | NativePointer> implements WasmRoot<T> { private __buffer: WasmRootBuffer; private __index: number; constructor(buffer: WasmRootBuffer, index: number) { this.__buffer = buffer;//TODO this.__index = index; } get_address(): NativePointer { return this.__buffer.get_address(this.__index); } get_address_32(): number { return this.__buffer.get_address_32(this.__index); } get(): T { const result = this.__buffer._unsafe_get(this.__index); return <any>result; } set(value: T): T { this.__buffer._unsafe_set(this.__index, value); return value; } get value(): T { return this.get(); } set value(value: T) { this.set(value); } valueOf(): T { return this.get(); } clear(): void { this.set(<any>0); } release(): void { if (!this.__buffer) throw new Error("No buffer"); const maxPooledInstances = 128; if (_scratch_root_free_instances.length > maxPooledInstances) { _mono_wasm_release_scratch_index(this.__index); (<any>this).__buffer = null; this.__index = 0; } else { this.set(<any>0); _scratch_root_free_instances.push(this); } } toString(): string { return `[root @${this.get_address()}]`; } } class WasmExternalRoot<T extends ManagedPointer | NativePointer> implements WasmRoot<T> { private __external_address: NativePointer = <any>undefined; private __external_address_32: number = <any>undefined; constructor(address: NativePointer) { this._set_address(address); } _set_address(address: NativePointer): void { this.__external_address = address; this.__external_address_32 = <number><any>address >>> 2; } get_address(): NativePointer { return this.__external_address; } get_address_32(): number { return this.__external_address_32; } get(): T { const result = Module.HEAPU32[this.__external_address_32]; return <any>result; } set(value: T): T { Module.HEAPU32[this.__external_address_32] = <number><any>value; return value; } get value(): T { return this.get(); } set value(value: T) { this.set(value); } valueOf(): T { return this.get(); } clear(): void { this.set(<any>0); } release(): void { const maxPooledInstances = 128; if (_external_root_free_instances.length < maxPooledInstances) _external_root_free_instances.push(this); } toString(): string { return `[external root @${this.get_address()}]`; } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest506/Generated506.ilproj
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="Generated506.il" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\TestFramework\TestFramework.csproj" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="Generated506.il" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\TestFramework\TestFramework.csproj" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/native/public/mono/utils/details/mono-error-types.h
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // #ifndef _MONO_ERROR_TYPES_H #define _MONO_ERROR_TYPES_H #include <mono/utils/details/mono-publib-types.h> enum { /* The supplied strings were dup'd by means of calling mono_error_dup_strings. */ MONO_ERROR_FREE_STRINGS = 0x0001, /* Something happened while processing the error and the resulting message is incomplete. */ MONO_ERROR_INCOMPLETE = 0x0002, /* This MonoError is heap allocated in a mempool */ MONO_ERROR_MEMPOOL_BOXED = 0x0004 }; enum { MONO_ERROR_NONE = 0, MONO_ERROR_MISSING_METHOD = 1, MONO_ERROR_MISSING_FIELD = 2, MONO_ERROR_TYPE_LOAD = 3, MONO_ERROR_FILE_NOT_FOUND = 4, MONO_ERROR_BAD_IMAGE = 5, MONO_ERROR_OUT_OF_MEMORY = 6, MONO_ERROR_ARGUMENT = 7, MONO_ERROR_ARGUMENT_NULL = 11, MONO_ERROR_ARGUMENT_OUT_OF_RANGE = 14, MONO_ERROR_NOT_VERIFIABLE = 8, MONO_ERROR_INVALID_PROGRAM = 12, MONO_ERROR_MEMBER_ACCESS = 13, /* * This is a generic error mechanism is you need to raise an arbitrary corlib exception. * You must pass the exception name otherwise prepare_exception will fail with internal execution. */ MONO_ERROR_GENERIC = 9, /* This one encapsulates a managed exception instance */ MONO_ERROR_EXCEPTION_INSTANCE = 10, /* Not a valid error code - indicates that the error was cleaned up and reused */ MONO_ERROR_CLEANUP_CALLED_SENTINEL = 0xffff }; #ifdef _MSC_VER __pragma(warning (push)) __pragma(warning (disable:4201)) #endif /*Keep in sync with MonoErrorInternal*/ typedef union _MonoError { // Merge two uint16 into one uint32 so it can be initialized // with one instruction instead of two. uint32_t init; struct { uint16_t error_code; uint16_t private_flags; /*DON'T TOUCH */ void *hidden_1 [12]; /*DON'T TOUCH */ }; } MonoErrorExternal; #ifdef _MSC_VER __pragma(warning (pop)) #endif #ifdef MONO_INSIDE_RUNTIME typedef union _MonoErrorInternal MonoError; #else typedef MonoErrorExternal MonoError; #endif /* Mempool-allocated MonoError.*/ typedef struct _MonoErrorBoxed MonoErrorBoxed; #endif
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // #ifndef _MONO_ERROR_TYPES_H #define _MONO_ERROR_TYPES_H #include <mono/utils/details/mono-publib-types.h> enum { /* The supplied strings were dup'd by means of calling mono_error_dup_strings. */ MONO_ERROR_FREE_STRINGS = 0x0001, /* Something happened while processing the error and the resulting message is incomplete. */ MONO_ERROR_INCOMPLETE = 0x0002, /* This MonoError is heap allocated in a mempool */ MONO_ERROR_MEMPOOL_BOXED = 0x0004 }; enum { MONO_ERROR_NONE = 0, MONO_ERROR_MISSING_METHOD = 1, MONO_ERROR_MISSING_FIELD = 2, MONO_ERROR_TYPE_LOAD = 3, MONO_ERROR_FILE_NOT_FOUND = 4, MONO_ERROR_BAD_IMAGE = 5, MONO_ERROR_OUT_OF_MEMORY = 6, MONO_ERROR_ARGUMENT = 7, MONO_ERROR_ARGUMENT_NULL = 11, MONO_ERROR_ARGUMENT_OUT_OF_RANGE = 14, MONO_ERROR_NOT_VERIFIABLE = 8, MONO_ERROR_INVALID_PROGRAM = 12, MONO_ERROR_MEMBER_ACCESS = 13, /* * This is a generic error mechanism is you need to raise an arbitrary corlib exception. * You must pass the exception name otherwise prepare_exception will fail with internal execution. */ MONO_ERROR_GENERIC = 9, /* This one encapsulates a managed exception instance */ MONO_ERROR_EXCEPTION_INSTANCE = 10, /* Not a valid error code - indicates that the error was cleaned up and reused */ MONO_ERROR_CLEANUP_CALLED_SENTINEL = 0xffff }; #ifdef _MSC_VER __pragma(warning (push)) __pragma(warning (disable:4201)) #endif /*Keep in sync with MonoErrorInternal*/ typedef union _MonoError { // Merge two uint16 into one uint32 so it can be initialized // with one instruction instead of two. uint32_t init; struct { uint16_t error_code; uint16_t private_flags; /*DON'T TOUCH */ void *hidden_1 [12]; /*DON'T TOUCH */ }; } MonoErrorExternal; #ifdef _MSC_VER __pragma(warning (pop)) #endif #ifdef MONO_INSIDE_RUNTIME typedef union _MonoErrorInternal MonoError; #else typedef MonoErrorExternal MonoError; #endif /* Mempool-allocated MonoError.*/ typedef struct _MonoErrorBoxed MonoErrorBoxed; #endif
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/Methodical/Arrays/huge/huge_objref_il_r.ilproj
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> <RestorePackages>true</RestorePackages> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="huge_objref.il" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> <RestorePackages>true</RestorePackages> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="huge_objref.il" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/Common/src/System/Net/CookieFields.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.Net { internal static class CookieFields { internal const string CommentAttributeName = "Comment"; internal const string CommentUrlAttributeName = "CommentURL"; internal const string DiscardAttributeName = "Discard"; internal const string DomainAttributeName = "Domain"; internal const string ExpiresAttributeName = "Expires"; internal const string MaxAgeAttributeName = "Max-Age"; internal const string PathAttributeName = "Path"; internal const string PortAttributeName = "Port"; internal const string SecureAttributeName = "Secure"; internal const string VersionAttributeName = "Version"; internal const string HttpOnlyAttributeName = "HttpOnly"; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.Net { internal static class CookieFields { internal const string CommentAttributeName = "Comment"; internal const string CommentUrlAttributeName = "CommentURL"; internal const string DiscardAttributeName = "Discard"; internal const string DomainAttributeName = "Domain"; internal const string ExpiresAttributeName = "Expires"; internal const string MaxAgeAttributeName = "Max-Age"; internal const string PathAttributeName = "Path"; internal const string PortAttributeName = "Port"; internal const string SecureAttributeName = "Secure"; internal const string VersionAttributeName = "Version"; internal const string HttpOnlyAttributeName = "HttpOnly"; } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.Private.Xml/tests/XmlSchema/TestFiles/TestData/XmlSchemaValidatorAPI/PartialValidation.xsd
<?xml version="1.0" encoding="utf-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="PartialElement" type="xs:int"/> <xs:element name="PartialElement2" type="xs:string" /> <xs:complexType name="PartialType" /> <xs:complexType name="PartialType2"> <xs:sequence> <xs:element name="bar" /> </xs:sequence> </xs:complexType> <xs:attribute name="PartialAttribute" type="xs:int" /> <xs:attribute name="PartialAttribute2" type="xs:string" /> </xs:schema>
<?xml version="1.0" encoding="utf-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="PartialElement" type="xs:int"/> <xs:element name="PartialElement2" type="xs:string" /> <xs:complexType name="PartialType" /> <xs:complexType name="PartialType2"> <xs:sequence> <xs:element name="bar" /> </xs:sequence> </xs:complexType> <xs:attribute name="PartialAttribute" type="xs:int" /> <xs:attribute name="PartialAttribute2" type="xs:string" /> </xs:schema>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/SIMD/VectorRelOp_r.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> </PropertyGroup> <PropertyGroup> <DebugType>None</DebugType> <Optimize /> </PropertyGroup> <ItemGroup> <Compile Include="VectorRelOp.cs" /> <Compile Include="VectorUtil.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> </PropertyGroup> <PropertyGroup> <DebugType>None</DebugType> <Optimize /> </PropertyGroup> <ItemGroup> <Compile Include="VectorRelOp.cs" /> <Compile Include="VectorUtil.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AddPairwise.Vector128.UInt64.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.Arm; namespace JIT.HardwareIntrinsics.Arm { public static partial class Program { private static void AddPairwise_Vector128_UInt64() { var test = new SimpleBinaryOpTest__AddPairwise_Vector128_UInt64(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); } // Validates passing a static member works test.RunClsVarScenario(); if (AdvSimd.IsSupported) { // Validates passing a static member works, using pinning and Load test.RunClsVarScenario_Load(); } // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local class works, using pinning and Load test.RunClassLclFldScenario_Load(); } // Validates passing an instance member of a class works test.RunClassFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a class works, using pinning and Load test.RunClassFldScenario_Load(); } // Validates passing the field of a local struct works test.RunStructLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local struct works, using pinning and Load test.RunStructLclFldScenario_Load(); } // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a struct works, using pinning and Load test.RunStructFldScenario_Load(); } } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class SimpleBinaryOpTest__AddPairwise_Vector128_UInt64 { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; private ulong alignment; public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt64>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt64>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt64>(); if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt64, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt64, byte>(ref inArray2[0]), (uint)sizeOfinArray2); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector128<UInt64> _fld1; public Vector128<UInt64> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); return testStruct; } public void RunStructFldScenario(SimpleBinaryOpTest__AddPairwise_Vector128_UInt64 testClass) { var result = AdvSimd.Arm64.AddPairwise(_fld1, _fld2); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } public void RunStructFldScenario_Load(SimpleBinaryOpTest__AddPairwise_Vector128_UInt64 testClass) { fixed (Vector128<UInt64>* pFld1 = &_fld1) fixed (Vector128<UInt64>* pFld2 = &_fld2) { var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(pFld1)), AdvSimd.LoadVector128((UInt64*)(pFld2)) ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } } private static readonly int LargestVectorSize = 16; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64); private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64); private static UInt64[] _data1 = new UInt64[Op1ElementCount]; private static UInt64[] _data2 = new UInt64[Op2ElementCount]; private static Vector128<UInt64> _clsVar1; private static Vector128<UInt64> _clsVar2; private Vector128<UInt64> _fld1; private Vector128<UInt64> _fld2; private DataTable _dataTable; static SimpleBinaryOpTest__AddPairwise_Vector128_UInt64() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar2), ref Unsafe.As<UInt64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); } public SimpleBinaryOpTest__AddPairwise_Vector128_UInt64() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld2), ref Unsafe.As<UInt64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); } public bool IsSupported => AdvSimd.Arm64.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = AdvSimd.Arm64.AddPairwise( Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray2Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddPairwise), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<UInt64>) }) .Invoke(null, new object[] { Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray2Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddPairwise), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<UInt64>) }) .Invoke(null, new object[] { AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = AdvSimd.Arm64.AddPairwise( _clsVar1, _clsVar2 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunClsVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); fixed (Vector128<UInt64>* pClsVar1 = &_clsVar1) fixed (Vector128<UInt64>* pClsVar2 = &_clsVar2) { var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(pClsVar1)), AdvSimd.LoadVector128((UInt64*)(pClsVar2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray2Ptr); var result = AdvSimd.Arm64.AddPairwise(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var op1 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)); var op2 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)); var result = AdvSimd.Arm64.AddPairwise(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new SimpleBinaryOpTest__AddPairwise_Vector128_UInt64(); var result = AdvSimd.Arm64.AddPairwise(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); var test = new SimpleBinaryOpTest__AddPairwise_Vector128_UInt64(); fixed (Vector128<UInt64>* pFld1 = &test._fld1) fixed (Vector128<UInt64>* pFld2 = &test._fld2) { var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(pFld1)), AdvSimd.LoadVector128((UInt64*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = AdvSimd.Arm64.AddPairwise(_fld1, _fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); fixed (Vector128<UInt64>* pFld1 = &_fld1) fixed (Vector128<UInt64>* pFld2 = &_fld2) { var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(pFld1)), AdvSimd.LoadVector128((UInt64*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = AdvSimd.Arm64.AddPairwise(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); var test = TestStruct.Create(); var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(&test._fld1)), AdvSimd.LoadVector128((UInt64*)(&test._fld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunStructFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); var test = TestStruct.Create(); test.RunStructFldScenario_Load(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult(Vector128<UInt64> op1, Vector128<UInt64> op2, void* result, [CallerMemberName] string method = "") { UInt64[] inArray1 = new UInt64[Op1ElementCount]; UInt64[] inArray2 = new UInt64[Op2ElementCount]; UInt64[] outArray = new UInt64[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray2[0]), op2); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") { UInt64[] inArray1 = new UInt64[Op1ElementCount]; UInt64[] inArray2 = new UInt64[Op2ElementCount]; UInt64[] outArray = new UInt64[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") { bool succeeded = true; for (var i = 0; i < RetElementCount; i++) { if (Helpers.AddPairwise(left, right, i) != result[i]) { succeeded = false; break; } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.AddPairwise)}<UInt64>(Vector128<UInt64>, Vector128<UInt64>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.Arm; namespace JIT.HardwareIntrinsics.Arm { public static partial class Program { private static void AddPairwise_Vector128_UInt64() { var test = new SimpleBinaryOpTest__AddPairwise_Vector128_UInt64(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); } // Validates passing a static member works test.RunClsVarScenario(); if (AdvSimd.IsSupported) { // Validates passing a static member works, using pinning and Load test.RunClsVarScenario_Load(); } // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local class works, using pinning and Load test.RunClassLclFldScenario_Load(); } // Validates passing an instance member of a class works test.RunClassFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a class works, using pinning and Load test.RunClassFldScenario_Load(); } // Validates passing the field of a local struct works test.RunStructLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local struct works, using pinning and Load test.RunStructLclFldScenario_Load(); } // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a struct works, using pinning and Load test.RunStructFldScenario_Load(); } } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class SimpleBinaryOpTest__AddPairwise_Vector128_UInt64 { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; private ulong alignment; public DataTable(UInt64[] inArray1, UInt64[] inArray2, UInt64[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt64>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt64>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt64>(); if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt64, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt64, byte>(ref inArray2[0]), (uint)sizeOfinArray2); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector128<UInt64> _fld1; public Vector128<UInt64> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); return testStruct; } public void RunStructFldScenario(SimpleBinaryOpTest__AddPairwise_Vector128_UInt64 testClass) { var result = AdvSimd.Arm64.AddPairwise(_fld1, _fld2); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } public void RunStructFldScenario_Load(SimpleBinaryOpTest__AddPairwise_Vector128_UInt64 testClass) { fixed (Vector128<UInt64>* pFld1 = &_fld1) fixed (Vector128<UInt64>* pFld2 = &_fld2) { var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(pFld1)), AdvSimd.LoadVector128((UInt64*)(pFld2)) ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } } private static readonly int LargestVectorSize = 16; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64); private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64); private static UInt64[] _data1 = new UInt64[Op1ElementCount]; private static UInt64[] _data2 = new UInt64[Op2ElementCount]; private static Vector128<UInt64> _clsVar1; private static Vector128<UInt64> _clsVar2; private Vector128<UInt64> _fld1; private Vector128<UInt64> _fld2; private DataTable _dataTable; static SimpleBinaryOpTest__AddPairwise_Vector128_UInt64() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar2), ref Unsafe.As<UInt64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); } public SimpleBinaryOpTest__AddPairwise_Vector128_UInt64() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld1), ref Unsafe.As<UInt64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld2), ref Unsafe.As<UInt64, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt64(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt64(); } _dataTable = new DataTable(_data1, _data2, new UInt64[RetElementCount], LargestVectorSize); } public bool IsSupported => AdvSimd.Arm64.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = AdvSimd.Arm64.AddPairwise( Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray2Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddPairwise), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<UInt64>) }) .Invoke(null, new object[] { Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray2Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddPairwise), new Type[] { typeof(Vector128<UInt64>), typeof(Vector128<UInt64>) }) .Invoke(null, new object[] { AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt64>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = AdvSimd.Arm64.AddPairwise( _clsVar1, _clsVar2 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunClsVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); fixed (Vector128<UInt64>* pClsVar1 = &_clsVar1) fixed (Vector128<UInt64>* pClsVar2 = &_clsVar2) { var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(pClsVar1)), AdvSimd.LoadVector128((UInt64*)(pClsVar2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector128<UInt64>>(_dataTable.inArray2Ptr); var result = AdvSimd.Arm64.AddPairwise(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var op1 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray1Ptr)); var op2 = AdvSimd.LoadVector128((UInt64*)(_dataTable.inArray2Ptr)); var result = AdvSimd.Arm64.AddPairwise(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new SimpleBinaryOpTest__AddPairwise_Vector128_UInt64(); var result = AdvSimd.Arm64.AddPairwise(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); var test = new SimpleBinaryOpTest__AddPairwise_Vector128_UInt64(); fixed (Vector128<UInt64>* pFld1 = &test._fld1) fixed (Vector128<UInt64>* pFld2 = &test._fld2) { var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(pFld1)), AdvSimd.LoadVector128((UInt64*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = AdvSimd.Arm64.AddPairwise(_fld1, _fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); fixed (Vector128<UInt64>* pFld1 = &_fld1) fixed (Vector128<UInt64>* pFld2 = &_fld2) { var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(pFld1)), AdvSimd.LoadVector128((UInt64*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = AdvSimd.Arm64.AddPairwise(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); var test = TestStruct.Create(); var result = AdvSimd.Arm64.AddPairwise( AdvSimd.LoadVector128((UInt64*)(&test._fld1)), AdvSimd.LoadVector128((UInt64*)(&test._fld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunStructFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); var test = TestStruct.Create(); test.RunStructFldScenario_Load(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult(Vector128<UInt64> op1, Vector128<UInt64> op2, void* result, [CallerMemberName] string method = "") { UInt64[] inArray1 = new UInt64[Op1ElementCount]; UInt64[] inArray2 = new UInt64[Op2ElementCount]; UInt64[] outArray = new UInt64[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray2[0]), op2); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") { UInt64[] inArray1 = new UInt64[Op1ElementCount]; UInt64[] inArray2 = new UInt64[Op2ElementCount]; UInt64[] outArray = new UInt64[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(UInt64[] left, UInt64[] right, UInt64[] result, [CallerMemberName] string method = "") { bool succeeded = true; for (var i = 0; i < RetElementCount; i++) { if (Helpers.AddPairwise(left, right, i) != result[i]) { succeeded = false; break; } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.AddPairwise)}<UInt64>(Vector128<UInt64>, Vector128<UInt64>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.ObjectModel/ref/System.ObjectModel.Forwards.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.ObjectModel.ReadOnlyDictionary<,>))]
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. [assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.ObjectModel.ReadOnlyDictionary<,>))]
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b30125/b30125.il
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } .assembly 'b30125' {} .assembly extern xunit.core {} .class ILGEN_0x5a59b03c { .method static int32 Method_0x1001() { .maxstack 3 .locals (unsigned int16 local_0x3) ldc.i4 0x74464a0b stloc local_0x3 ldloc local_0x3 conv.ovf.u2 ret } .method static int32 Main() { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) .entrypoint .maxstack 2 call int32 ILGEN_0x5a59b03c::Method_0x1001() ldc.i4 18955 sub ldc.i4 100 add ret } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } .assembly 'b30125' {} .assembly extern xunit.core {} .class ILGEN_0x5a59b03c { .method static int32 Method_0x1001() { .maxstack 3 .locals (unsigned int16 local_0x3) ldc.i4 0x74464a0b stloc local_0x3 ldloc local_0x3 conv.ovf.u2 ret } .method static int32 Main() { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) .entrypoint .maxstack 2 call int32 ILGEN_0x5a59b03c::Method_0x1001() ldc.i4 18955 sub ldc.i4 100 add ret } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.Linq.Parallel/src/System/Linq/Parallel/Utils/HashLookup.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // HashLookup.cs // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; namespace System.Linq.Parallel { /// <summary> /// A simple hash map data structure, derived from the LINQ set we also use. /// </summary> /// <typeparam name="TKey">The kind of keys contained within.</typeparam> /// <typeparam name="TValue">The kind of values contained within.</typeparam> internal sealed class HashLookup<TKey, TValue> { private int[] buckets; private Slot[] slots; private int count; private int freeList; private readonly IEqualityComparer<TKey>? comparer; private const int HashCodeMask = 0x7fffffff; internal HashLookup() : this(null) { } internal HashLookup(IEqualityComparer<TKey>? comparer) { this.comparer = comparer; buckets = new int[7]; slots = new Slot[7]; freeList = -1; } // If value is not in set, add it and return true; otherwise return false internal bool Add(TKey key, TValue value) { return !Find(key, true, false, ref value!); } // Check whether value is in set internal bool TryGetValue(TKey key, [MaybeNullWhen(false), AllowNull] ref TValue value) { return Find(key, false, false, ref value!); } internal TValue this[TKey key] { set { TValue? v = value; Find(key, false, true, ref v); } } private int GetKeyHashCode(TKey key) { return HashCodeMask & (key == null ? 0 : (comparer?.GetHashCode(key) ?? key.GetHashCode())); } private bool AreKeysEqual(TKey key1, TKey key2) { return (comparer == null ? ((key1 == null && key2 == null) || (key1 != null && key1.Equals(key2))) : comparer.Equals(key1, key2)); } private bool Find(TKey key, bool add, bool set, [MaybeNullWhen(false)] ref TValue value) { int hashCode = GetKeyHashCode(key); for (int i = buckets[hashCode % buckets.Length] - 1; i >= 0; i = slots[i].next) { if (slots[i].hashCode == hashCode && AreKeysEqual(slots[i].key, key)) { if (set) { slots[i].value = value; return true; } else { value = slots[i].value; return true; } } } if (add) { int index; if (freeList >= 0) { index = freeList; freeList = slots[index].next; } else { if (count == slots.Length) Resize(); index = count; count++; } int bucket = hashCode % buckets.Length; slots[index].hashCode = hashCode; slots[index].key = key; slots[index].value = value; slots[index].next = buckets[bucket] - 1; buckets[bucket] = index + 1; } return false; } private void Resize() { int newSize = checked(count * 2 + 1); int[] newBuckets = new int[newSize]; Slot[] newSlots = new Slot[newSize]; Array.Copy(slots, newSlots, count); for (int i = 0; i < count; i++) { int bucket = newSlots[i].hashCode % newSize; newSlots[i].next = newBuckets[bucket] - 1; newBuckets[bucket] = i + 1; } buckets = newBuckets; slots = newSlots; } internal int Count { get { return count; } } internal KeyValuePair<TKey, TValue> this[int index] { get { return new KeyValuePair<TKey, TValue>(slots[index].key, slots[index].value); } } internal struct Slot { internal int hashCode; internal int next; internal TKey key; internal TValue value; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // HashLookup.cs // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; namespace System.Linq.Parallel { /// <summary> /// A simple hash map data structure, derived from the LINQ set we also use. /// </summary> /// <typeparam name="TKey">The kind of keys contained within.</typeparam> /// <typeparam name="TValue">The kind of values contained within.</typeparam> internal sealed class HashLookup<TKey, TValue> { private int[] buckets; private Slot[] slots; private int count; private int freeList; private readonly IEqualityComparer<TKey>? comparer; private const int HashCodeMask = 0x7fffffff; internal HashLookup() : this(null) { } internal HashLookup(IEqualityComparer<TKey>? comparer) { this.comparer = comparer; buckets = new int[7]; slots = new Slot[7]; freeList = -1; } // If value is not in set, add it and return true; otherwise return false internal bool Add(TKey key, TValue value) { return !Find(key, true, false, ref value!); } // Check whether value is in set internal bool TryGetValue(TKey key, [MaybeNullWhen(false), AllowNull] ref TValue value) { return Find(key, false, false, ref value!); } internal TValue this[TKey key] { set { TValue? v = value; Find(key, false, true, ref v); } } private int GetKeyHashCode(TKey key) { return HashCodeMask & (key == null ? 0 : (comparer?.GetHashCode(key) ?? key.GetHashCode())); } private bool AreKeysEqual(TKey key1, TKey key2) { return (comparer == null ? ((key1 == null && key2 == null) || (key1 != null && key1.Equals(key2))) : comparer.Equals(key1, key2)); } private bool Find(TKey key, bool add, bool set, [MaybeNullWhen(false)] ref TValue value) { int hashCode = GetKeyHashCode(key); for (int i = buckets[hashCode % buckets.Length] - 1; i >= 0; i = slots[i].next) { if (slots[i].hashCode == hashCode && AreKeysEqual(slots[i].key, key)) { if (set) { slots[i].value = value; return true; } else { value = slots[i].value; return true; } } } if (add) { int index; if (freeList >= 0) { index = freeList; freeList = slots[index].next; } else { if (count == slots.Length) Resize(); index = count; count++; } int bucket = hashCode % buckets.Length; slots[index].hashCode = hashCode; slots[index].key = key; slots[index].value = value; slots[index].next = buckets[bucket] - 1; buckets[bucket] = index + 1; } return false; } private void Resize() { int newSize = checked(count * 2 + 1); int[] newBuckets = new int[newSize]; Slot[] newSlots = new Slot[newSize]; Array.Copy(slots, newSlots, count); for (int i = 0; i < count; i++) { int bucket = newSlots[i].hashCode % newSize; newSlots[i].next = newBuckets[bucket] - 1; newBuckets[bucket] = i + 1; } buckets = newBuckets; slots = newSlots; } internal int Count { get { return count; } } internal KeyValuePair<TKey, TValue> this[int index] { get { return new KeyValuePair<TKey, TValue>(slots[index].key, slots[index].value); } } internal struct Slot { internal int hashCode; internal int next; internal TKey key; internal TValue value; } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/ReflectionModel/ReflectionParameterImportDefinitionTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; using System.ComponentModel.Composition.Factories; using System.ComponentModel.Composition.Primitives; using System.Linq; using System.Reflection; using Microsoft.Internal; using Xunit; namespace System.ComponentModel.Composition.ReflectionModel { public class ReflectionParameterImportDefinitionTests { [Fact] public void Constructor() { Lazy<ParameterInfo> parameter = CreateLazyParameter(); IEnumerable<KeyValuePair<string, Type>> requiredMetadata = new KeyValuePair<string, Type>[] { new KeyValuePair<string, Type>("Foo", typeof(object)) }; IDictionary<string, object> metadata = new Dictionary<string, object>(); metadata["Key"] = "value"; ReflectionParameterImportDefinition definition = new ReflectionParameterImportDefinition( parameter, "Contract", (string)null, requiredMetadata, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, metadata, null); Assert.Same(parameter, definition.ImportingLazyParameter); Assert.Equal("Contract", definition.ContractName); Assert.Same(requiredMetadata, definition.RequiredMetadata); Assert.Same(metadata, definition.Metadata); Assert.Equal(CreationPolicy.NonShared, definition.RequiredCreationPolicy); Assert.False(definition.IsRecomposable); Assert.True(definition.IsPrerequisite); Assert.Null(((ICompositionElement)definition).Origin); Assert.NotNull(((ICompositionElement)definition).DisplayName); } [Fact] public void Constructor_WithNullRequiredMetadata() { Lazy<ParameterInfo> parameter = CreateLazyParameter(); ReflectionParameterImportDefinition definition = new ReflectionParameterImportDefinition( parameter, "Contract", (string)null, null, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, null, null); Assert.NotNull(definition.RequiredMetadata); Assert.Equal(0, definition.RequiredMetadata.Count()); } [Fact] public void SetDefinition_OriginIsSet() { Lazy<ParameterInfo> parameter = CreateLazyParameter(); var expectedPartDefinition = PartDefinitionFactory.CreateAttributed(typeof(object)); ReflectionParameterImportDefinition definition = new ReflectionParameterImportDefinition( parameter, "Contract", (string)null, null, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, null, expectedPartDefinition); Assert.Same(expectedPartDefinition, ((ICompositionElement)definition).Origin); } [Fact] public void ICompositionElementDisplayName_ValueAsParameter_ShouldIncludeParameterName() { var names = Expectations.GetContractNamesWithEmpty(); Assert.All(names, name => { var definition = CreateReflectionParameterImportDefinition(name); var e = CreateDisplayNameExpectationFromParameterName(definition, name); Assert.Equal(e, ((ICompositionElement)definition).DisplayName); }); } [Fact] public void ICompositionElementDisplayName_ValueAsParameter_ShouldIncludeContractName() { var types = Expectations.GetTypes(); Assert.All(types, type => { var definition = CreateReflectionParameterImportDefinition(type); var e = CreateDisplayNameExpectationFromContractName(definition, type); Assert.Equal(e, ((ICompositionElement)definition).DisplayName); }); } private Lazy<ParameterInfo> CreateLazyParameter() { return typeof(SimpleConstructorInjectedObject).GetConstructors().First().GetParameters().First().AsLazy(); } private static string CreateDisplayNameExpectationFromContractName(ReflectionParameterImportDefinition definition, Type type) { string contractName = AttributedModelServices.GetContractName(type); return string.Format("{0} (Parameter=\"\", ContractName=\"{1}\")", definition.ImportingLazyParameter.Value.Member.GetDisplayName(), contractName); } private static string CreateDisplayNameExpectationFromParameterName(ReflectionParameterImportDefinition definition, string name) { return string.Format("{0} (Parameter=\"{1}\", ContractName=\"System.String\")", definition.ImportingLazyParameter.Value.Member.GetDisplayName(), name); } private static ReflectionParameterImportDefinition CreateReflectionParameterImportDefinition(Type parameterType) { var parameter = ReflectionFactory.CreateParameter(parameterType); return CreateReflectionParameterImportDefinition(parameter); } private static ReflectionParameterImportDefinition CreateReflectionParameterImportDefinition(string name) { var parameter = ReflectionFactory.CreateParameter(name); return CreateReflectionParameterImportDefinition(parameter); } private static ReflectionParameterImportDefinition CreateReflectionParameterImportDefinition(ParameterInfo parameter) { return new ReflectionParameterImportDefinition( parameter.AsLazy(), AttributedModelServices.GetContractName(parameter.ParameterType), (string)null, null, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, null, null); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; using System.ComponentModel.Composition.Factories; using System.ComponentModel.Composition.Primitives; using System.Linq; using System.Reflection; using Microsoft.Internal; using Xunit; namespace System.ComponentModel.Composition.ReflectionModel { public class ReflectionParameterImportDefinitionTests { [Fact] public void Constructor() { Lazy<ParameterInfo> parameter = CreateLazyParameter(); IEnumerable<KeyValuePair<string, Type>> requiredMetadata = new KeyValuePair<string, Type>[] { new KeyValuePair<string, Type>("Foo", typeof(object)) }; IDictionary<string, object> metadata = new Dictionary<string, object>(); metadata["Key"] = "value"; ReflectionParameterImportDefinition definition = new ReflectionParameterImportDefinition( parameter, "Contract", (string)null, requiredMetadata, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, metadata, null); Assert.Same(parameter, definition.ImportingLazyParameter); Assert.Equal("Contract", definition.ContractName); Assert.Same(requiredMetadata, definition.RequiredMetadata); Assert.Same(metadata, definition.Metadata); Assert.Equal(CreationPolicy.NonShared, definition.RequiredCreationPolicy); Assert.False(definition.IsRecomposable); Assert.True(definition.IsPrerequisite); Assert.Null(((ICompositionElement)definition).Origin); Assert.NotNull(((ICompositionElement)definition).DisplayName); } [Fact] public void Constructor_WithNullRequiredMetadata() { Lazy<ParameterInfo> parameter = CreateLazyParameter(); ReflectionParameterImportDefinition definition = new ReflectionParameterImportDefinition( parameter, "Contract", (string)null, null, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, null, null); Assert.NotNull(definition.RequiredMetadata); Assert.Equal(0, definition.RequiredMetadata.Count()); } [Fact] public void SetDefinition_OriginIsSet() { Lazy<ParameterInfo> parameter = CreateLazyParameter(); var expectedPartDefinition = PartDefinitionFactory.CreateAttributed(typeof(object)); ReflectionParameterImportDefinition definition = new ReflectionParameterImportDefinition( parameter, "Contract", (string)null, null, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, null, expectedPartDefinition); Assert.Same(expectedPartDefinition, ((ICompositionElement)definition).Origin); } [Fact] public void ICompositionElementDisplayName_ValueAsParameter_ShouldIncludeParameterName() { var names = Expectations.GetContractNamesWithEmpty(); Assert.All(names, name => { var definition = CreateReflectionParameterImportDefinition(name); var e = CreateDisplayNameExpectationFromParameterName(definition, name); Assert.Equal(e, ((ICompositionElement)definition).DisplayName); }); } [Fact] public void ICompositionElementDisplayName_ValueAsParameter_ShouldIncludeContractName() { var types = Expectations.GetTypes(); Assert.All(types, type => { var definition = CreateReflectionParameterImportDefinition(type); var e = CreateDisplayNameExpectationFromContractName(definition, type); Assert.Equal(e, ((ICompositionElement)definition).DisplayName); }); } private Lazy<ParameterInfo> CreateLazyParameter() { return typeof(SimpleConstructorInjectedObject).GetConstructors().First().GetParameters().First().AsLazy(); } private static string CreateDisplayNameExpectationFromContractName(ReflectionParameterImportDefinition definition, Type type) { string contractName = AttributedModelServices.GetContractName(type); return string.Format("{0} (Parameter=\"\", ContractName=\"{1}\")", definition.ImportingLazyParameter.Value.Member.GetDisplayName(), contractName); } private static string CreateDisplayNameExpectationFromParameterName(ReflectionParameterImportDefinition definition, string name) { return string.Format("{0} (Parameter=\"{1}\", ContractName=\"System.String\")", definition.ImportingLazyParameter.Value.Member.GetDisplayName(), name); } private static ReflectionParameterImportDefinition CreateReflectionParameterImportDefinition(Type parameterType) { var parameter = ReflectionFactory.CreateParameter(parameterType); return CreateReflectionParameterImportDefinition(parameter); } private static ReflectionParameterImportDefinition CreateReflectionParameterImportDefinition(string name) { var parameter = ReflectionFactory.CreateParameter(name); return CreateReflectionParameterImportDefinition(parameter); } private static ReflectionParameterImportDefinition CreateReflectionParameterImportDefinition(ParameterInfo parameter) { return new ReflectionParameterImportDefinition( parameter.AsLazy(), AttributedModelServices.GetContractName(parameter.ParameterType), (string)null, null, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, null, null); } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/TestClock.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; namespace Microsoft.Extensions.FileProviders.Physical.Internal { public class TestClock : IClock { public DateTime UtcNow { get; private set; } = DateTime.UtcNow; public void Increment() { UtcNow = UtcNow.Add(PhysicalFilesWatcher.DefaultPollingInterval); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; namespace Microsoft.Extensions.FileProviders.Physical.Internal { public class TestClock : IClock { public DateTime UtcNow { get; private set; } = DateTime.UtcNow; public void Increment() { UtcNow = UtcNow.Add(PhysicalFilesWatcher.DefaultPollingInterval); } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintDocument.Unix.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // // System.Drawing.PrintDocument.cs // // Authors: // Dennis Hayes ([email protected]) // Herve Poussineau ([email protected]) // Andreas Nahr ([email protected]) // // (C) 2002 Ximian, Inc // // // Copyright (C) 2004 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.ComponentModel; namespace System.Drawing.Printing { [DefaultProperty("DocumentName"), DefaultEvent("PrintPage")] public class PrintDocument : System.ComponentModel.Component { private PageSettings defaultpagesettings; private PrinterSettings printersettings; private PrintController printcontroller; private string documentname; private bool originAtMargins; // .NET V1.1 Beta public PrintDocument() { documentname = "document"; //offical default. printersettings = new PrinterSettings(); // use default values defaultpagesettings = (PageSettings)printersettings.DefaultPageSettings.Clone(); printcontroller = new StandardPrintController(); } // properties [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [Browsable(false)] [SRDescription("The settings for the current page.")] public PageSettings DefaultPageSettings { get { return defaultpagesettings; } set { defaultpagesettings = value; } } // Name of the document, not the file! [DefaultValue("document")] [SRDescription("The name of the document.")] public string DocumentName { get { return documentname; } set { documentname = value; } } [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [Browsable(false)] [SRDescription("The print controller object.")] public PrintController PrintController { get { return printcontroller; } set { printcontroller = value; } } [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [Browsable(false)] [SRDescription("The current settings for the active printer.")] public PrinterSettings PrinterSettings { get { return printersettings; } set { printersettings = value == null ? new PrinterSettings() : value; } } [DefaultValue(false)] [SRDescription("Determines if the origin is set at the specified margins.")] public bool OriginAtMargins { get { return originAtMargins; } set { originAtMargins = value; } } // methods public void Print() { PrintEventArgs printArgs = new PrintEventArgs(); this.OnBeginPrint(printArgs); if (printArgs.Cancel) return; PrintController.OnStartPrint(this, printArgs); if (printArgs.Cancel) return; Graphics? g = null; if (printArgs.GraphicsContext != null) { g = Graphics.FromHdc(printArgs.GraphicsContext.Hdc); printArgs.GraphicsContext.Graphics = g; } // while there are more pages PrintPageEventArgs printPageArgs; do { QueryPageSettingsEventArgs queryPageSettingsArgs = new QueryPageSettingsEventArgs( (DefaultPageSettings.Clone() as PageSettings)!); OnQueryPageSettings(queryPageSettingsArgs); PageSettings pageSettings = queryPageSettingsArgs.PageSettings; printPageArgs = new PrintPageEventArgs( g, pageSettings.Bounds, new Rectangle(0, 0, pageSettings.PaperSize.Width, pageSettings.PaperSize.Height), pageSettings); // TODO: We should create a graphics context for each page since they can have diferent paper // size, orientation, etc. We use a single graphic for now to keep Cairo using a single PDF file. printPageArgs.GraphicsContext = printArgs.GraphicsContext; Graphics? pg = PrintController.OnStartPage(this, printPageArgs); // assign Graphics in printPageArgs printPageArgs.SetGraphics(pg); if (!printPageArgs.Cancel) this.OnPrintPage(printPageArgs); PrintController.OnEndPage(this, printPageArgs); if (printPageArgs.Cancel) break; } while (printPageArgs.HasMorePages); this.OnEndPrint(printArgs); PrintController.OnEndPrint(this, printArgs); } public override string ToString() => $"[PrintDocument {this.DocumentName}]"; // events protected virtual void OnBeginPrint(PrintEventArgs e) { //fire the event if (BeginPrint != null) BeginPrint(this, e); } protected virtual void OnEndPrint(PrintEventArgs e) { //fire the event if (EndPrint != null) EndPrint(this, e); } protected virtual void OnPrintPage(PrintPageEventArgs e) { //fire the event if (PrintPage != null) PrintPage(this, e); } protected virtual void OnQueryPageSettings(QueryPageSettingsEventArgs e) { //fire the event if (QueryPageSettings != null) QueryPageSettings(this, e); } [SRDescription("Raised when printing begins")] public event PrintEventHandler? BeginPrint; [SRDescription("Raised when printing ends")] public event PrintEventHandler? EndPrint; [SRDescription("Raised when printing of a new page begins")] public event PrintPageEventHandler? PrintPage; [SRDescription("Raised before printing of a new page begins")] public event QueryPageSettingsEventHandler? QueryPageSettings; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // // System.Drawing.PrintDocument.cs // // Authors: // Dennis Hayes ([email protected]) // Herve Poussineau ([email protected]) // Andreas Nahr ([email protected]) // // (C) 2002 Ximian, Inc // // // Copyright (C) 2004 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.ComponentModel; namespace System.Drawing.Printing { [DefaultProperty("DocumentName"), DefaultEvent("PrintPage")] public class PrintDocument : System.ComponentModel.Component { private PageSettings defaultpagesettings; private PrinterSettings printersettings; private PrintController printcontroller; private string documentname; private bool originAtMargins; // .NET V1.1 Beta public PrintDocument() { documentname = "document"; //offical default. printersettings = new PrinterSettings(); // use default values defaultpagesettings = (PageSettings)printersettings.DefaultPageSettings.Clone(); printcontroller = new StandardPrintController(); } // properties [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [Browsable(false)] [SRDescription("The settings for the current page.")] public PageSettings DefaultPageSettings { get { return defaultpagesettings; } set { defaultpagesettings = value; } } // Name of the document, not the file! [DefaultValue("document")] [SRDescription("The name of the document.")] public string DocumentName { get { return documentname; } set { documentname = value; } } [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [Browsable(false)] [SRDescription("The print controller object.")] public PrintController PrintController { get { return printcontroller; } set { printcontroller = value; } } [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [Browsable(false)] [SRDescription("The current settings for the active printer.")] public PrinterSettings PrinterSettings { get { return printersettings; } set { printersettings = value == null ? new PrinterSettings() : value; } } [DefaultValue(false)] [SRDescription("Determines if the origin is set at the specified margins.")] public bool OriginAtMargins { get { return originAtMargins; } set { originAtMargins = value; } } // methods public void Print() { PrintEventArgs printArgs = new PrintEventArgs(); this.OnBeginPrint(printArgs); if (printArgs.Cancel) return; PrintController.OnStartPrint(this, printArgs); if (printArgs.Cancel) return; Graphics? g = null; if (printArgs.GraphicsContext != null) { g = Graphics.FromHdc(printArgs.GraphicsContext.Hdc); printArgs.GraphicsContext.Graphics = g; } // while there are more pages PrintPageEventArgs printPageArgs; do { QueryPageSettingsEventArgs queryPageSettingsArgs = new QueryPageSettingsEventArgs( (DefaultPageSettings.Clone() as PageSettings)!); OnQueryPageSettings(queryPageSettingsArgs); PageSettings pageSettings = queryPageSettingsArgs.PageSettings; printPageArgs = new PrintPageEventArgs( g, pageSettings.Bounds, new Rectangle(0, 0, pageSettings.PaperSize.Width, pageSettings.PaperSize.Height), pageSettings); // TODO: We should create a graphics context for each page since they can have diferent paper // size, orientation, etc. We use a single graphic for now to keep Cairo using a single PDF file. printPageArgs.GraphicsContext = printArgs.GraphicsContext; Graphics? pg = PrintController.OnStartPage(this, printPageArgs); // assign Graphics in printPageArgs printPageArgs.SetGraphics(pg); if (!printPageArgs.Cancel) this.OnPrintPage(printPageArgs); PrintController.OnEndPage(this, printPageArgs); if (printPageArgs.Cancel) break; } while (printPageArgs.HasMorePages); this.OnEndPrint(printArgs); PrintController.OnEndPrint(this, printArgs); } public override string ToString() => $"[PrintDocument {this.DocumentName}]"; // events protected virtual void OnBeginPrint(PrintEventArgs e) { //fire the event if (BeginPrint != null) BeginPrint(this, e); } protected virtual void OnEndPrint(PrintEventArgs e) { //fire the event if (EndPrint != null) EndPrint(this, e); } protected virtual void OnPrintPage(PrintPageEventArgs e) { //fire the event if (PrintPage != null) PrintPage(this, e); } protected virtual void OnQueryPageSettings(QueryPageSettingsEventArgs e) { //fire the event if (QueryPageSettings != null) QueryPageSettings(this, e); } [SRDescription("Raised when printing begins")] public event PrintEventHandler? BeginPrint; [SRDescription("Raised when printing ends")] public event PrintEventHandler? EndPrint; [SRDescription("Raised when printing of a new page begins")] public event PrintPageEventHandler? PrintPage; [SRDescription("Raised before printing of a new page begins")] public event QueryPageSettingsEventHandler? QueryPageSettings; } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/Loader/classloader/StaticVirtualMethods/NegativeTestCases/MethodFlags.il
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} .assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} .assembly 'MethodFlags' {} .class public auto ansi BaseScenario1 extends [System.Runtime]System.Object { // Test virtual flag .method public static virtual int32 Method() cil managed noinlining { .locals init (int32 V_O) ldloca.s 0 initobj int32 ldloc.0 ret } // end of method Method } // end of class BaseScenario1 .class public auto ansi abstract BaseScenario2 extends [System.Runtime]System.Object { // Test abstract flag .method public static virtual abstract int32 Method() cil managed noinlining { } // end of method Method } // end of class BaseScenario2 .class public auto ansi TestEntrypoint extends [System.Runtime]System.Object { .method public static void Test_Scenario1() cil managed noinlining { ldtoken BaseScenario1 pop ret } // end of method Test_Scenario1 .method public static void Test_Scenario2() cil managed noinlining { ldtoken BaseScenario2 pop ret } // end of method Test_Scenario1 .method public static int32 Main() cil managed noinlining { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { call void TestEntrypoint::Test_Scenario1() ldstr "Virtual flag set on static class method" ldstr "TypeLoadException" ldstr "Did not throw exception" call void [TypeHierarchyCommonCs]Statics::CheckForFailure(string,string,string) leave.s VirtualFlagOnClassStaticDone } catch [System.Runtime]System.Exception { stloc.0 ldstr "Virtual flag set on static class method" ldstr "TypeLoadException" ldloc.0 callvirt instance class [System.Runtime]System.Type [System.Runtime]System.Exception::GetType() callvirt instance string [System.Runtime]System.Reflection.MemberInfo::get_Name() call void [TypeHierarchyCommonCs]Statics::CheckForFailure(string,string,string) leave.s VirtualFlagOnClassStaticDone } VirtualFlagOnClassStaticDone: nop .try { call void TestEntrypoint::Test_Scenario2() ldstr "Abstract flag set on static class method" ldstr "TypeLoadException" ldstr "Did not throw exception" call void [TypeHierarchyCommonCs]Statics::CheckForFailure(string,string,string) leave.s AbstractFlagOnClassStaticDone } catch [System.Runtime]System.Exception { stloc.0 ldstr "Abstract flag set on static class method" ldstr "TypeLoadException" ldloc.0 callvirt instance class [System.Runtime]System.Type [System.Runtime]System.Exception::GetType() callvirt instance string [System.Runtime]System.Reflection.MemberInfo::get_Name() call void [TypeHierarchyCommonCs]Statics::CheckForFailure(string,string,string) leave.s AbstractFlagOnClassStaticDone } AbstractFlagOnClassStaticDone: nop call int32 [TypeHierarchyCommonCs]Statics::ReportResults() ret } // end of method Main } // end of class TestEntrypoint
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console {} .assembly extern xunit.core {} .assembly extern mscorlib {} .assembly extern System.Runtime {} .assembly extern TypeHierarchyCommonCs {} .assembly 'MethodFlags' {} .class public auto ansi BaseScenario1 extends [System.Runtime]System.Object { // Test virtual flag .method public static virtual int32 Method() cil managed noinlining { .locals init (int32 V_O) ldloca.s 0 initobj int32 ldloc.0 ret } // end of method Method } // end of class BaseScenario1 .class public auto ansi abstract BaseScenario2 extends [System.Runtime]System.Object { // Test abstract flag .method public static virtual abstract int32 Method() cil managed noinlining { } // end of method Method } // end of class BaseScenario2 .class public auto ansi TestEntrypoint extends [System.Runtime]System.Object { .method public static void Test_Scenario1() cil managed noinlining { ldtoken BaseScenario1 pop ret } // end of method Test_Scenario1 .method public static void Test_Scenario2() cil managed noinlining { ldtoken BaseScenario2 pop ret } // end of method Test_Scenario1 .method public static int32 Main() cil managed noinlining { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) .entrypoint .locals init (class [System.Runtime]System.Exception V_0) .try { call void TestEntrypoint::Test_Scenario1() ldstr "Virtual flag set on static class method" ldstr "TypeLoadException" ldstr "Did not throw exception" call void [TypeHierarchyCommonCs]Statics::CheckForFailure(string,string,string) leave.s VirtualFlagOnClassStaticDone } catch [System.Runtime]System.Exception { stloc.0 ldstr "Virtual flag set on static class method" ldstr "TypeLoadException" ldloc.0 callvirt instance class [System.Runtime]System.Type [System.Runtime]System.Exception::GetType() callvirt instance string [System.Runtime]System.Reflection.MemberInfo::get_Name() call void [TypeHierarchyCommonCs]Statics::CheckForFailure(string,string,string) leave.s VirtualFlagOnClassStaticDone } VirtualFlagOnClassStaticDone: nop .try { call void TestEntrypoint::Test_Scenario2() ldstr "Abstract flag set on static class method" ldstr "TypeLoadException" ldstr "Did not throw exception" call void [TypeHierarchyCommonCs]Statics::CheckForFailure(string,string,string) leave.s AbstractFlagOnClassStaticDone } catch [System.Runtime]System.Exception { stloc.0 ldstr "Abstract flag set on static class method" ldstr "TypeLoadException" ldloc.0 callvirt instance class [System.Runtime]System.Type [System.Runtime]System.Exception::GetType() callvirt instance string [System.Runtime]System.Reflection.MemberInfo::get_Name() call void [TypeHierarchyCommonCs]Statics::CheckForFailure(string,string,string) leave.s AbstractFlagOnClassStaticDone } AbstractFlagOnClassStaticDone: nop call int32 [TypeHierarchyCommonCs]Statics::ReportResults() ret } // end of method Main } // end of class TestEntrypoint
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Threading.Tasks; using Microsoft.WebAssembly.Diagnostics; using Newtonsoft.Json.Linq; using System.IO; using Xunit; using Xunit.Sdk; namespace DebuggerTests { public class BreakpointTests : DebuggerTestBase { [Fact] public async Task CreateGoodBreakpoint() { var bp1_res = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8); Assert.EndsWith("debugger-test.cs", bp1_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count); var loc = bp1_res.Value["locations"]?.Value<JArray>()[0]; Assert.NotNull(loc["scriptId"]); Assert.Equal("dotnet://debugger-test.dll/debugger-test.cs", scripts[loc["scriptId"]?.Value<string>()]); Assert.Equal(10, (int)loc["lineNumber"]); Assert.Equal(8, (int)loc["columnNumber"]); } [Fact] public async Task CreateJSBreakpoint() { // Test that js breakpoints get set correctly // 13 24 // 13 53 var bp1_res = await SetBreakpoint("/debugger-driver.html", 13, 24); Assert.EndsWith("debugger-driver.html", bp1_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count); var loc = bp1_res.Value["locations"]?.Value<JArray>()[0]; Assert.NotNull(loc["scriptId"]); Assert.Equal(13, (int)loc["lineNumber"]); Assert.Equal(24, (int)loc["columnNumber"]); var bp2_res = await SetBreakpoint("/debugger-driver.html", 13, 53); Assert.EndsWith("debugger-driver.html", bp2_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp2_res.Value["locations"]?.Value<JArray>()?.Count); var loc2 = bp2_res.Value["locations"]?.Value<JArray>()[0]; Assert.NotNull(loc2["scriptId"]); Assert.Equal(13, (int)loc2["lineNumber"]); Assert.Equal(53, (int)loc2["columnNumber"]); } [Fact] public async Task CreateJS0Breakpoint() { // 13 24 // 13 53 var bp1_res = await SetBreakpoint("/debugger-driver.html", 13, 0); Assert.EndsWith("debugger-driver.html", bp1_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count); var loc = bp1_res.Value["locations"]?.Value<JArray>()[0]; Assert.NotNull(loc["scriptId"]); Assert.Equal(13, (int)loc["lineNumber"]); Assert.Equal(4, (int)loc["columnNumber"]); var bp2_res = await SetBreakpoint("/debugger-driver.html", 13, 53); Assert.EndsWith("debugger-driver.html", bp2_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp2_res.Value["locations"]?.Value<JArray>()?.Count); var loc2 = bp2_res.Value["locations"]?.Value<JArray>()[0]; Assert.NotNull(loc2["scriptId"]); Assert.Equal(13, (int)loc2["lineNumber"]); Assert.Equal(53, (int)loc2["columnNumber"]); } [Theory] [InlineData(0)] [InlineData(50)] public async Task CheckMultipleBreakpointsOnSameLine(int col) { var bp1_res = await SetBreakpoint("dotnet://debugger-test.dll/debugger-array-test.cs", 219, col); Assert.EndsWith("debugger-array-test.cs", bp1_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count); var loc = bp1_res.Value["locations"]?.Value<JArray>()[0]; CheckLocation("dotnet://debugger-test.dll/debugger-array-test.cs", 219, 50, scripts, loc); var bp2_res = await SetBreakpoint("dotnet://debugger-test.dll/debugger-array-test.cs", 219, 55); Assert.EndsWith("debugger-array-test.cs", bp2_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp2_res.Value["locations"]?.Value<JArray>()?.Count); var loc2 = bp2_res.Value["locations"]?.Value<JArray>()[0]; CheckLocation("dotnet://debugger-test.dll/debugger-array-test.cs", 219, 55, scripts, loc2); } [Fact] public async Task CreateBadBreakpoint() { var bp1_req = JObject.FromObject(new { lineNumber = 8, columnNumber = 2, url = "dotnet://debugger-test.dll/this-file-doesnt-exist.cs", }); var bp1_res = await cli.SendCommand("Debugger.setBreakpointByUrl", bp1_req, token); Assert.True(bp1_res.IsOk); Assert.Empty(bp1_res.Value["locations"].Values<object>()); //Assert.Equal ((int)MonoErrorCodes.BpNotFound, bp1_res.Error ["code"]?.Value<int> ()); } [Fact] public async Task CreateGoodBreakpointAndHit() { var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8); await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd", wait_for_event_fn: (pause_location) => { Assert.Equal("other", pause_location["reason"]?.Value<string>()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>()); var top_frame = pause_location["callFrames"][0]; Assert.Equal("IntAdd", top_frame["functionName"].Value<string>()); Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>()); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]); //now check the scope var scope = top_frame["scopeChain"][0]; Assert.Equal("local", scope["type"]); Assert.Equal("IntAdd", scope["name"]); Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); return Task.CompletedTask; } ); } public static TheoryData<string, string, string, bool> FalseConditions = new TheoryData<string, string, string, bool> { { "invoke_add()", "IntAdd", "0.0", false }, { "invoke_add()", "IntAdd", "c == 40", false }, { "invoke_add()", "IntAdd", "c < 0", false }, }; public static TheoryData<string, string, string, bool> TrueConditions = new TheoryData<string, string, string, bool> { { "invoke_add()", "IntAdd", "c == 30", true }, { "invoke_add()", "IntAdd", "true", true }, { "invoke_add()", "IntAdd", "5", true }, { "invoke_add()", "IntAdd", "c < 40", true }, { "invoke_use_complex()", "UseComplex", "complex.A == 10", true }, { "invoke_add()", "IntAdd", "1.0", true }, { "invoke_add()", "IntAdd", "\"foo\"", true }, { "invoke_add()", "IntAdd", "\"true\"", true }, { "invoke_add()", "IntAdd", "\"false\"", true }, }; public static TheoryData<string, string, string, bool> InvalidConditions = new TheoryData<string, string, string, bool> { { "invoke_add()", "IntAdd", "foo.bar", false }, { "invoke_add()", "IntAdd", "Math.IntAdd()", false }, { "invoke_add()", "IntAdd", "c == \"xyz\"", false }, { "invoke_add()", "IntAdd", "Math.NonExistantProperty", false }, { "invoke_add()", "IntAdd", "g == 40", false }, { "invoke_add()", "IntAdd", "null", false }, }; [Theory] [MemberData(nameof(FalseConditions))] [MemberData(nameof(TrueConditions))] [MemberData(nameof(InvalidConditions))] public async Task ConditionalBreakpoint(string function_to_call, string method_to_stop, string condition, bool bp_stop_expected) { Result [] bps = new Result[2]; bps[0] = await SetBreakpointInMethod("debugger-test.dll", "Math", method_to_stop, 3, condition:condition); bps[1] = await SetBreakpointInMethod("debugger-test.dll", "Math", method_to_stop, 4); await EvaluateAndCheck( "window.setTimeout(function() { " + function_to_call + "; }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bps[bp_stop_expected ? 0 : 1].Value["locations"][0]["lineNumber"].Value<int>(), bps[bp_stop_expected ? 0 : 1].Value["locations"][0]["columnNumber"].Value<int>(), method_to_stop); } [Theory] [InlineData("c == 15", 78, 3, 78, 11)] [InlineData("c == 17", 78, 3, 79, 3)] [InlineData("g == 17", 78, 3, 79, 3)] [InlineData("true", 78, 3, 78, 11)] [InlineData("\"false\"", 78, 3, 78, 11)] [InlineData("\"true\"", 78, 3, 78, 11)] [InlineData("5", 78, 3, 78, 11)] [InlineData("p", 78, 3, 79, 3)] [InlineData("0.0", 78, 3, 79, 3)] public async Task JSConditionalBreakpoint(string condition, int line_bp, int column_bp, int line_expected, int column_expected) { await SetBreakpoint("/debugger-driver.html", line_bp, column_bp, condition: condition); await SetBreakpoint("/debugger-driver.html", 79, 3); await EvaluateAndCheck( "window.setTimeout(function() { conditional_breakpoint_test(5, 10, null); }, 1);", "debugger-driver.html", line_expected, column_expected, "conditional_breakpoint_test"); } [Theory] [InlineData("invoke_add_with_parms(10, 20)", "invoke_add_with_parms(10, 20)", "IntAdd", "c == 30", true, true)] [InlineData("invoke_add_with_parms(5, 10)", "invoke_add_with_parms(10, 20)", "IntAdd", "c == 30", false, true)] [InlineData("invoke_add_with_parms(10, 20)", "invoke_add_with_parms(5, 10)", "IntAdd", "c == 30", true, false)] public async Task ConditionalBreakpointHitTwice(string function_to_call, string function_to_call2, string method_to_stop, string condition, bool bp_stop_expected, bool bp_stop_expected2) { Result [] bps = new Result[2]; bps[0] = await SetBreakpointInMethod("debugger-test.dll", "Math", method_to_stop, 3, condition:condition); bps[1] = await SetBreakpointInMethod("debugger-test.dll", "Math", method_to_stop, 4); await EvaluateAndCheck( "window.setTimeout(function() { " + function_to_call + "; " + function_to_call2 + ";}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bps[bp_stop_expected ? 0 : 1].Value["locations"][0]["lineNumber"].Value<int>(), bps[bp_stop_expected ? 0 : 1].Value["locations"][0]["columnNumber"].Value<int>(), method_to_stop); await SendCommandAndCheck(null, "Debugger.resume", null, bps[bp_stop_expected2 ? 0 : 1].Value["locations"][0]["lineNumber"].Value<int>(), bps[bp_stop_expected2 ? 0 : 1].Value["locations"][0]["columnNumber"].Value<int>(), method_to_stop); } [Fact] public async Task BreakOnDebuggerBreak() { await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method_async('[debugger-test] UserBreak:BreakOnDebuggerBreakCommand'); }, 1);", "dotnet://debugger-test.dll/debugger-test2.cs", 58, 8, "BreakOnDebuggerBreakCommand", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 59, 8, "BreakOnDebuggerBreakCommand", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 60, 8, "BreakOnDebuggerBreakCommand", locals_fn: async (locals) => { CheckNumber(locals, "a", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 61, 8, "BreakOnDebuggerBreakCommand", locals_fn: async (locals) => { CheckNumber(locals, "a", 50); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 62, 4, "BreakOnDebuggerBreakCommand", locals_fn: async (locals) => { CheckNumber(locals, "a", 100); await Task.CompletedTask; } ); } [Fact] public async Task BreakpointInAssemblyUsingTypeFromAnotherAssembly_BothDynamicallyLoaded() { int line = 7; // Start the task earlier than loading the assemblies, so we don't miss the event Task<JObject> bpResolved = WaitForBreakpointResolvedEvent(); await SetBreakpoint(".*/library-dependency-debugger-test1.cs$", line, 0, use_regex: true); await LoadAssemblyDynamically( Path.Combine(DebuggerTestAppPath, "library-dependency-debugger-test2.dll"), Path.Combine(DebuggerTestAppPath, "library-dependency-debugger-test2.pdb")); await LoadAssemblyDynamically( Path.Combine(DebuggerTestAppPath, "library-dependency-debugger-test1.dll"), Path.Combine(DebuggerTestAppPath, "library-dependency-debugger-test1.pdb")); var source_location = "dotnet://library-dependency-debugger-test1.dll/library-dependency-debugger-test1.cs"; Assert.Contains(source_location, scripts.Values); await bpResolved; var pause_location = await EvaluateAndCheck( "window.setTimeout(function () { invoke_static_method('[library-dependency-debugger-test1] TestDependency:IntAdd', 5, 10); }, 1);", source_location, line, 8, "IntAdd"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 5); CheckNumber(locals, "b", 10); } [Fact] public async Task DebugHotReloadMethodChangedUserBreak() { var pause_location = await LoadAssemblyAndTestHotReload( Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"), Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"), Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"), "MethodBody1", "StaticMethod1"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 12, 16, "StaticMethod1"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "b", 15); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 12, 12, "StaticMethod1"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); await CheckBool(locals, "c", true); } [Fact] public async Task DebugHotReloadMethodUnchanged() { var pause_location = await LoadAssemblyAndTestHotReload( Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"), Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"), Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"), "MethodBody2", "StaticMethod1"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 21, 12, "StaticMethod1"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 21, 12, "StaticMethod1"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); } [Fact] public async Task DebugHotReloadMethodAddBreakpoint() { int line = 30; await SetBreakpoint(".*/MethodBody1.cs$", line, 12, use_regex: true); var pause_location = await LoadAssemblyAndTestHotReload( Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"), Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"), Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"), "MethodBody3", "StaticMethod3"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 30, 12, "StaticMethod3"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "b", 15); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 30, 12, "StaticMethod3"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); await CheckBool(locals, "c", true); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 31, 12, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 32, 12, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 33, 8, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); CheckNumber(locals, "f", 50); await Task.CompletedTask; } ); } [Fact] public async Task DebugHotReloadMethodEmpty() { int line = 38; await SetBreakpoint(".*/MethodBody1.cs$", line, 0, use_regex: true); var pause_location = await LoadAssemblyAndTestHotReload( Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"), Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"), Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"), "MethodBody4", "StaticMethod4"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 38, 12, "StaticMethod4"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 39, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 40, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 41, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 42, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 43, 8, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 38, 8, "StaticMethod4"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); } [Fact] public async Task ConditionalBreakpointInALoop() { var bp_conditional = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 4, condition:"i == 3"); var bp_check = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 5); await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] LoopClass:LoopToBreak'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 3); await Task.CompletedTask; } ); await SendCommandAndCheck(null, "Debugger.resume", null, bp_check.Value["locations"][0]["lineNumber"].Value<int>(), bp_check.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak"); } [Fact] public async Task ConditionalBreakpointInALoopStopMoreThanOnce() { var bp_conditional = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 4, condition:"i % 3 == 0"); var bp_check = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 5); await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] LoopClass:LoopToBreak'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 0); await Task.CompletedTask; } ); await SendCommandAndCheck(null, "Debugger.resume", null, bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 3); await Task.CompletedTask; }); await SendCommandAndCheck(null, "Debugger.resume", null, bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 6); await Task.CompletedTask; }); await SendCommandAndCheck(null, "Debugger.resume", null, bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 9); await Task.CompletedTask; }); await SendCommandAndCheck(null, "Debugger.resume", null, bp_check.Value["locations"][0]["lineNumber"].Value<int>(), bp_check.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak"); } [Fact] public async Task ConditionalBreakpointNoStopInALoop() { var bp_conditional = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 4, condition:"i == \"10\""); var bp_check = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 5); await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] LoopClass:LoopToBreak'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_check.Value["locations"][0]["lineNumber"].Value<int>(), bp_check.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak" ); } [Fact] public async Task ConditionalBreakpointNotBooleanInALoop() { var bp_conditional = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 4, condition:"i + 4"); await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] LoopClass:LoopToBreak'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 0); await Task.CompletedTask; } ); await SendCommandAndCheck(null, "Debugger.resume", null, bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 1); await Task.CompletedTask; }); await SendCommandAndCheck(null, "Debugger.resume", null, bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 2); await Task.CompletedTask; }); } [Fact] public async Task CreateGoodBreakpointAndHitGoToNonWasmPageComeBackAndHitAgain() { var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8); var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd"); Assert.Equal("other", pause_location["reason"]?.Value<string>()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>()); var top_frame = pause_location["callFrames"][0]; Assert.Equal("IntAdd", top_frame["functionName"].Value<string>()); Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>()); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]); //now check the scope var scope = top_frame["scopeChain"][0]; Assert.Equal("local", scope["type"]); Assert.Equal("IntAdd", scope["name"]); Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); await cli.SendCommand("Debugger.resume", null, token); var run_method = JObject.FromObject(new { expression = "window.setTimeout(function() { load_non_wasm_page(); }, 1);" }); await cli.SendCommand("Runtime.evaluate", run_method, token); await Task.Delay(1000, token); run_method = JObject.FromObject(new { expression = "window.setTimeout(function() { reload_wasm_page(); }, 1);" }); await cli.SendCommand("Runtime.evaluate", run_method, token); await insp.WaitFor(Inspector.READY); await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd", wait_for_event_fn: (pause_location) => { Assert.Equal("other", pause_location["reason"]?.Value<string>()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>()); var top_frame = pause_location["callFrames"][0]; Assert.Equal("IntAdd", top_frame["functionName"].Value<string>()); Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>()); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]); //now check the scope var scope = top_frame["scopeChain"][0]; Assert.Equal("local", scope["type"]); Assert.Equal("IntAdd", scope["name"]); Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); return Task.CompletedTask; } ); } [Theory] [InlineData("RunDebuggerHidden", "HiddenMethod")] [InlineData("RunStepThroughWithHidden", "StepThroughWithHiddenBp")] // debuggerHidden shadows the effect of stepThrough [InlineData("RunNonUserCodeWithHidden", "NonUserCodeWithHiddenBp")] // and nonUserCode public async Task DebuggerHiddenNoStopOnBp(string evalFunName, string decoratedFunName) { var bp_hidden = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", decoratedFunName, 1); var bp_final = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 2); Assert.Empty(bp_hidden.Value["locations"]); await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_final.Value["locations"][0]["lineNumber"].Value<int>(), bp_final.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); } [Theory] [InlineData("RunDebuggerHidden")] [InlineData("RunStepThroughWithHidden")] // debuggerHidden shadows the effect of stepThrough [InlineData("RunNonUserCodeWithHidden")] // and nonUserCode public async Task DebuggerHiddenStopOnUserBp(string evalFunName) { var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 2); var bp_final = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 3); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 2);", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); await SendCommandAndCheck(null, "Debugger.resume", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName); await SendCommandAndCheck(null, "Debugger.resume", "dotnet://debugger-test.dll/debugger-test.cs", bp_final.Value["locations"][0]["lineNumber"].Value<int>(), bp_final.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName); } [Fact] public async Task DebugHotReloadMethodChangedUserBreakUsingSDB() { string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"); string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"); string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"); var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges( asm_file, pdb_file, "MethodBody1", "StaticMethod1"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody1", "StaticMethod1", 1); JToken top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 12, 16, scripts, top_frame["location"]); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "b", 15); pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody1", "StaticMethod1", 2); top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 12, 12, scripts, top_frame["location"]); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); await CheckBool(locals, "c", true); } [Fact] public async Task DebugHotReloadMethodUnchangedUsingSDB() { string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"); string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"); string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"); var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges( asm_file, pdb_file, "MethodBody2", "StaticMethod1"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody2", "StaticMethod1", 1); JToken top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 21, 12, scripts, top_frame["location"]); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody2", "StaticMethod1", 2); top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 21, 12, scripts, top_frame["location"]); } [Fact] public async Task DebugHotReloadMethodAddBreakpointUsingSDB() { string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"); string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"); string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"); int line = 30; await SetBreakpoint(".*/MethodBody1.cs$", line, 12, use_regex: true); var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges( asm_file, pdb_file, "MethodBody3", "StaticMethod3"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); //apply first update pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody3", "StaticMethod3", 1); JToken top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod3", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 30, 12, scripts, top_frame["location"]); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "b", 15); //apply second update pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody3", "StaticMethod3", 2); top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod3", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 30, 12, scripts, top_frame["location"]); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); await CheckBool(locals, "c", true); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 31, 12, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 32, 12, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 33, 8, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); CheckNumber(locals, "f", 50); await Task.CompletedTask; } ); } [Fact] public async Task DebugHotReloadMethodEmptyUsingSDB() { string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"); string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"); string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"); int line = 38; await SetBreakpoint(".*/MethodBody1.cs$", line, 0, use_regex: true); var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges( asm_file, pdb_file, "MethodBody4", "StaticMethod4"); //apply first update pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody4", "StaticMethod4", 1); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 39, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 40, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 41, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 42, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 43, 8, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); //pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 38, 8, "StaticMethod4"); } [Theory] [InlineData(false, "RunStepThrough", 847, 8)] [InlineData(true, "RunStepThrough", 847, 8)] [InlineData(false, "RunNonUserCode", 852, 4, "NonUserCodeBp")] [InlineData(true, "RunNonUserCode", 867, 8)] [InlineData(false, "RunStepThroughWithNonUserCode", 933, 8)] [InlineData(true, "RunStepThroughWithNonUserCode", 933, 8)] public async Task StepThroughOrNonUserCodeAttributeStepInNoBp(bool justMyCodeEnabled, string evalFunName, int line, int col, string funcName="") { var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 1); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); await SetJustMyCode(justMyCodeEnabled); if (funcName == "") funcName = evalFunName; await SendCommandAndCheck(null, "Debugger.stepInto", "dotnet://debugger-test.dll/debugger-test.cs", line, col, funcName); } [Theory] [InlineData(false, "RunStepThrough", "StepThrougBp", "", 846, 8)] [InlineData(true, "RunStepThrough", "StepThrougBp", "RunStepThrough", 847, 8)] [InlineData(false, "RunNonUserCode", "NonUserCodeBp", "NonUserCodeBp", 852, 4)] [InlineData(true, "RunNonUserCode", "NonUserCodeBp", "RunNonUserCode", 867, 8)] [InlineData(false, "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeBp", "", 932, 8)] [InlineData(true, "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeBp", "RunStepThroughWithNonUserCode", 933, 8)] public async Task StepThroughOrNonUserCodeAttributeStepInWithBp( bool justMyCodeEnabled, string evalFunName, string decoratedFunName, string funName, int line, int col) { var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 1); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); await SetJustMyCode(justMyCodeEnabled); if (!justMyCodeEnabled && funName == "") { var bp1_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", decoratedFunName, 1); var bp2_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", decoratedFunName, 3); var line1 = bp1_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); var line2 = bp2_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); await SendCommandAndCheck(null, "Debugger.stepInto", "dotnet://debugger-test.dll/debugger-test.cs", line1, 8, decoratedFunName); await SendCommandAndCheck(null, "Debugger.stepInto", "dotnet://debugger-test.dll/debugger-test.cs", line2, 8, decoratedFunName); funName = evalFunName; } await SendCommandAndCheck(null, "Debugger.stepInto", "dotnet://debugger-test.dll/debugger-test.cs", line, col, funName); } [Theory] [InlineData(false, "RunStepThrough", "StepThrougBp")] [InlineData(true, "RunStepThrough", "StepThrougBp")] [InlineData(true, "RunNonUserCode", "NonUserCodeBp")] [InlineData(false, "RunNonUserCode", "NonUserCodeBp")] [InlineData(false, "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeBp")] [InlineData(true, "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeBp")] public async Task StepThroughOrNonUserCodeAttributeResumeWithBp(bool justMyCodeEnabled, string evalFunName, string decoratedFunName) { var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 1); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); await SetJustMyCode(justMyCodeEnabled); if (!justMyCodeEnabled) { var bp1_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", decoratedFunName, 1); var line1 = bp1_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); await SendCommandAndCheck(null, "Debugger.resume", "dotnet://debugger-test.dll/debugger-test.cs", line1, 8, decoratedFunName); } var bp_outside_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 2); var line2 = bp_outside_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); await SendCommandAndCheck(null, "Debugger.resume", "dotnet://debugger-test.dll/debugger-test.cs", line2, 8, evalFunName); } [Theory] [InlineData(false, "Debugger.stepInto", "RunStepThrough", "StepThrougUserBp", 841, 8, "RunStepThrough", 848, 4)] [InlineData(true, "Debugger.stepInto", "RunStepThrough", "RunStepThrough", -1, 8, "RunStepThrough", -1, 4)] [InlineData(false, "Debugger.resume", "RunStepThrough", "StepThrougUserBp", 841, 8, "RunStepThrough", 848, 4)] [InlineData(true, "Debugger.resume", "RunStepThrough", "RunStepThrough", -1, 8, "RunStepThrough", -1, 4)] [InlineData(false, "Debugger.stepInto", "RunNonUserCode", "NonUserCodeUserBp", 860, 4, "NonUserCodeUserBp", 861, 8)] [InlineData(true, "Debugger.stepInto", "RunNonUserCode", "RunNonUserCode", -1, 8, "RunNonUserCode", -1, 4)] [InlineData(false, "Debugger.resume", "RunNonUserCode", "NonUserCodeUserBp", 861, 8, "RunNonUserCode", -1, 4)] [InlineData(true, "Debugger.resume", "RunNonUserCode", "RunNonUserCode", -1, 8, "RunNonUserCode", -1, 4)] [InlineData(false, "Debugger.stepInto", "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeUserBp", 927, 8, "RunStepThroughWithNonUserCode", 934, 4)] [InlineData(true, "Debugger.stepInto", "RunStepThroughWithNonUserCode", "RunStepThroughWithNonUserCode", -1, 8, "RunStepThroughWithNonUserCode", -1, 4)] [InlineData(false, "Debugger.resume", "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeUserBp", 927, 8, "RunStepThroughWithNonUserCode", -1, 4)] [InlineData(true, "Debugger.resume", "RunStepThroughWithNonUserCode", "RunStepThroughWithNonUserCode", -1, 8, "RunStepThroughWithNonUserCode", -1, 4)] public async Task StepThroughOrNonUserCodeAttributeWithUserBp( bool justMyCodeEnabled, string debuggingFunction, string evalFunName, string functionNameCheck1, int line1, int col1, string functionNameCheck2, int line2, int col2) { var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 2); var bp_outside_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 3); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); await SetJustMyCode(justMyCodeEnabled); if (line1 == -1) line1 = bp_outside_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>() - 1; if (line2 == -1) line2 = bp_outside_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); await SendCommandAndCheck(null, debuggingFunction, "dotnet://debugger-test.dll/debugger-test.cs", line1, col1, functionNameCheck1); await SendCommandAndCheck(null, debuggingFunction, "dotnet://debugger-test.dll/debugger-test.cs", line2, col2, functionNameCheck2); } [Theory] [InlineData("Debugger.stepInto", 1, 2, false)] [InlineData("Debugger.stepInto", 1, 2, true)] [InlineData("Debugger.resume", 1, 2, true)] [InlineData("Debugger.stepInto", 2, 3, false)] [InlineData("Debugger.resume", 2, 3, false)] public async Task StepperBoundary(string debuggingAction, int lineBpInit, int lineBpFinal, bool hasBpInDecoratedFun) { // behavior of StepperBoundary is the same for JMC enabled and disabled // but the effect of NonUserCode escape is better visible for JMC: enabled await SetJustMyCode(true); var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "RunNoBoundary", lineBpInit); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:RunNoBoundary'); }}, {lineBpInit});", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), "RunNoBoundary" ); var bp_final = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "RunNoBoundary", lineBpFinal); if (hasBpInDecoratedFun) { var bp_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "BoundaryBp", 2); var line_decorated_fun = bp_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); var col_decorated_fun = bp_decorated_fun.Value["locations"][0]["columnNumber"].Value<int>(); await SendCommandAndCheck(null, debuggingAction, "dotnet://debugger-test.dll/debugger-test.cs", line_decorated_fun, col_decorated_fun, "BoundaryBp"); } if (lineBpInit == 2) await SendCommandAndCheck(null, debuggingAction, "dotnet://debugger-test.dll/debugger-test.cs", 879, 8, "BoundaryUserBp"); var line = bp_final.Value["locations"][0]["lineNumber"].Value<int>(); var col = bp_final.Value["locations"][0]["columnNumber"].Value<int>(); await SendCommandAndCheck(null, debuggingAction, "dotnet://debugger-test.dll/debugger-test.cs", line, col, "RunNoBoundary"); } [Fact] public async Task CreateGoodBreakpointAndHitGoToWasmPageWithoutAssetsComeBackAndHitAgain() { var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8); var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd"); Assert.Equal("other", pause_location["reason"]?.Value<string>()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>()); var top_frame = pause_location["callFrames"][0]; Assert.Equal("IntAdd", top_frame["functionName"].Value<string>()); Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>()); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]); //now check the scope var scope = top_frame["scopeChain"][0]; Assert.Equal("local", scope["type"]); Assert.Equal("IntAdd", scope["name"]); Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); await cli.SendCommand("Debugger.resume", null, token); var run_method = JObject.FromObject(new { expression = "window.setTimeout(function() { load_wasm_page_without_assets(); }, 1);" }); await cli.SendCommand("Runtime.evaluate", run_method, token); await insp.WaitFor(Inspector.READY); run_method = JObject.FromObject(new { expression = "window.setTimeout(function() { reload_wasm_page(); }, 1);" }); await cli.SendCommand("Runtime.evaluate", run_method, token); await insp.WaitFor(Inspector.READY); await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd", wait_for_event_fn: async (pause_location) => { Assert.Equal("other", pause_location["reason"]?.Value<string>()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>()); var top_frame = pause_location["callFrames"][0]; Assert.Equal("IntAdd", top_frame["functionName"].Value<string>()); Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>()); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]); //now check the scope var scope = top_frame["scopeChain"][0]; Assert.Equal("local", scope["type"]); Assert.Equal("IntAdd", scope["name"]); Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); await Task.CompletedTask; } ); } [Fact] public async Task DebugHotReloadMethod_CheckBreakpointLineUpdated_ByVS_Simulated() { string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"); string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"); string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"); var bp = await SetBreakpoint(".*/MethodBody1.cs$", 48, 12, use_regex: true); var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges( asm_file, pdb_file, "MethodBody5", "StaticMethod1"); //apply first update pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody5", "StaticMethod1", 1, rebindBreakpoint : async () => { await RemoveBreakpoint(bp.Value["breakpointId"].Value<string>()); await SetBreakpoint(".*/MethodBody1.cs$", 49, 12, use_regex: true); }); JToken top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 49, 12, scripts, top_frame["location"]); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Threading.Tasks; using Microsoft.WebAssembly.Diagnostics; using Newtonsoft.Json.Linq; using System.IO; using Xunit; using Xunit.Sdk; namespace DebuggerTests { public class BreakpointTests : DebuggerTestBase { [Fact] public async Task CreateGoodBreakpoint() { var bp1_res = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8); Assert.EndsWith("debugger-test.cs", bp1_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count); var loc = bp1_res.Value["locations"]?.Value<JArray>()[0]; Assert.NotNull(loc["scriptId"]); Assert.Equal("dotnet://debugger-test.dll/debugger-test.cs", scripts[loc["scriptId"]?.Value<string>()]); Assert.Equal(10, (int)loc["lineNumber"]); Assert.Equal(8, (int)loc["columnNumber"]); } [Fact] public async Task CreateJSBreakpoint() { // Test that js breakpoints get set correctly // 13 24 // 13 53 var bp1_res = await SetBreakpoint("/debugger-driver.html", 13, 24); Assert.EndsWith("debugger-driver.html", bp1_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count); var loc = bp1_res.Value["locations"]?.Value<JArray>()[0]; Assert.NotNull(loc["scriptId"]); Assert.Equal(13, (int)loc["lineNumber"]); Assert.Equal(24, (int)loc["columnNumber"]); var bp2_res = await SetBreakpoint("/debugger-driver.html", 13, 53); Assert.EndsWith("debugger-driver.html", bp2_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp2_res.Value["locations"]?.Value<JArray>()?.Count); var loc2 = bp2_res.Value["locations"]?.Value<JArray>()[0]; Assert.NotNull(loc2["scriptId"]); Assert.Equal(13, (int)loc2["lineNumber"]); Assert.Equal(53, (int)loc2["columnNumber"]); } [Fact] public async Task CreateJS0Breakpoint() { // 13 24 // 13 53 var bp1_res = await SetBreakpoint("/debugger-driver.html", 13, 0); Assert.EndsWith("debugger-driver.html", bp1_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count); var loc = bp1_res.Value["locations"]?.Value<JArray>()[0]; Assert.NotNull(loc["scriptId"]); Assert.Equal(13, (int)loc["lineNumber"]); Assert.Equal(4, (int)loc["columnNumber"]); var bp2_res = await SetBreakpoint("/debugger-driver.html", 13, 53); Assert.EndsWith("debugger-driver.html", bp2_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp2_res.Value["locations"]?.Value<JArray>()?.Count); var loc2 = bp2_res.Value["locations"]?.Value<JArray>()[0]; Assert.NotNull(loc2["scriptId"]); Assert.Equal(13, (int)loc2["lineNumber"]); Assert.Equal(53, (int)loc2["columnNumber"]); } [Theory] [InlineData(0)] [InlineData(50)] public async Task CheckMultipleBreakpointsOnSameLine(int col) { var bp1_res = await SetBreakpoint("dotnet://debugger-test.dll/debugger-array-test.cs", 219, col); Assert.EndsWith("debugger-array-test.cs", bp1_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp1_res.Value["locations"]?.Value<JArray>()?.Count); var loc = bp1_res.Value["locations"]?.Value<JArray>()[0]; CheckLocation("dotnet://debugger-test.dll/debugger-array-test.cs", 219, 50, scripts, loc); var bp2_res = await SetBreakpoint("dotnet://debugger-test.dll/debugger-array-test.cs", 219, 55); Assert.EndsWith("debugger-array-test.cs", bp2_res.Value["breakpointId"].ToString()); Assert.Equal(1, bp2_res.Value["locations"]?.Value<JArray>()?.Count); var loc2 = bp2_res.Value["locations"]?.Value<JArray>()[0]; CheckLocation("dotnet://debugger-test.dll/debugger-array-test.cs", 219, 55, scripts, loc2); } [Fact] public async Task CreateBadBreakpoint() { var bp1_req = JObject.FromObject(new { lineNumber = 8, columnNumber = 2, url = "dotnet://debugger-test.dll/this-file-doesnt-exist.cs", }); var bp1_res = await cli.SendCommand("Debugger.setBreakpointByUrl", bp1_req, token); Assert.True(bp1_res.IsOk); Assert.Empty(bp1_res.Value["locations"].Values<object>()); //Assert.Equal ((int)MonoErrorCodes.BpNotFound, bp1_res.Error ["code"]?.Value<int> ()); } [Fact] public async Task CreateGoodBreakpointAndHit() { var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8); await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd", wait_for_event_fn: (pause_location) => { Assert.Equal("other", pause_location["reason"]?.Value<string>()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>()); var top_frame = pause_location["callFrames"][0]; Assert.Equal("IntAdd", top_frame["functionName"].Value<string>()); Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>()); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]); //now check the scope var scope = top_frame["scopeChain"][0]; Assert.Equal("local", scope["type"]); Assert.Equal("IntAdd", scope["name"]); Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); return Task.CompletedTask; } ); } public static TheoryData<string, string, string, bool> FalseConditions = new TheoryData<string, string, string, bool> { { "invoke_add()", "IntAdd", "0.0", false }, { "invoke_add()", "IntAdd", "c == 40", false }, { "invoke_add()", "IntAdd", "c < 0", false }, }; public static TheoryData<string, string, string, bool> TrueConditions = new TheoryData<string, string, string, bool> { { "invoke_add()", "IntAdd", "c == 30", true }, { "invoke_add()", "IntAdd", "true", true }, { "invoke_add()", "IntAdd", "5", true }, { "invoke_add()", "IntAdd", "c < 40", true }, { "invoke_use_complex()", "UseComplex", "complex.A == 10", true }, { "invoke_add()", "IntAdd", "1.0", true }, { "invoke_add()", "IntAdd", "\"foo\"", true }, { "invoke_add()", "IntAdd", "\"true\"", true }, { "invoke_add()", "IntAdd", "\"false\"", true }, }; public static TheoryData<string, string, string, bool> InvalidConditions = new TheoryData<string, string, string, bool> { { "invoke_add()", "IntAdd", "foo.bar", false }, { "invoke_add()", "IntAdd", "Math.IntAdd()", false }, { "invoke_add()", "IntAdd", "c == \"xyz\"", false }, { "invoke_add()", "IntAdd", "Math.NonExistantProperty", false }, { "invoke_add()", "IntAdd", "g == 40", false }, { "invoke_add()", "IntAdd", "null", false }, }; [Theory] [MemberData(nameof(FalseConditions))] [MemberData(nameof(TrueConditions))] [MemberData(nameof(InvalidConditions))] public async Task ConditionalBreakpoint(string function_to_call, string method_to_stop, string condition, bool bp_stop_expected) { Result [] bps = new Result[2]; bps[0] = await SetBreakpointInMethod("debugger-test.dll", "Math", method_to_stop, 3, condition:condition); bps[1] = await SetBreakpointInMethod("debugger-test.dll", "Math", method_to_stop, 4); await EvaluateAndCheck( "window.setTimeout(function() { " + function_to_call + "; }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bps[bp_stop_expected ? 0 : 1].Value["locations"][0]["lineNumber"].Value<int>(), bps[bp_stop_expected ? 0 : 1].Value["locations"][0]["columnNumber"].Value<int>(), method_to_stop); } [Theory] [InlineData("c == 15", 78, 3, 78, 11)] [InlineData("c == 17", 78, 3, 79, 3)] [InlineData("g == 17", 78, 3, 79, 3)] [InlineData("true", 78, 3, 78, 11)] [InlineData("\"false\"", 78, 3, 78, 11)] [InlineData("\"true\"", 78, 3, 78, 11)] [InlineData("5", 78, 3, 78, 11)] [InlineData("p", 78, 3, 79, 3)] [InlineData("0.0", 78, 3, 79, 3)] public async Task JSConditionalBreakpoint(string condition, int line_bp, int column_bp, int line_expected, int column_expected) { await SetBreakpoint("/debugger-driver.html", line_bp, column_bp, condition: condition); await SetBreakpoint("/debugger-driver.html", 79, 3); await EvaluateAndCheck( "window.setTimeout(function() { conditional_breakpoint_test(5, 10, null); }, 1);", "debugger-driver.html", line_expected, column_expected, "conditional_breakpoint_test"); } [Theory] [InlineData("invoke_add_with_parms(10, 20)", "invoke_add_with_parms(10, 20)", "IntAdd", "c == 30", true, true)] [InlineData("invoke_add_with_parms(5, 10)", "invoke_add_with_parms(10, 20)", "IntAdd", "c == 30", false, true)] [InlineData("invoke_add_with_parms(10, 20)", "invoke_add_with_parms(5, 10)", "IntAdd", "c == 30", true, false)] public async Task ConditionalBreakpointHitTwice(string function_to_call, string function_to_call2, string method_to_stop, string condition, bool bp_stop_expected, bool bp_stop_expected2) { Result [] bps = new Result[2]; bps[0] = await SetBreakpointInMethod("debugger-test.dll", "Math", method_to_stop, 3, condition:condition); bps[1] = await SetBreakpointInMethod("debugger-test.dll", "Math", method_to_stop, 4); await EvaluateAndCheck( "window.setTimeout(function() { " + function_to_call + "; " + function_to_call2 + ";}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bps[bp_stop_expected ? 0 : 1].Value["locations"][0]["lineNumber"].Value<int>(), bps[bp_stop_expected ? 0 : 1].Value["locations"][0]["columnNumber"].Value<int>(), method_to_stop); await SendCommandAndCheck(null, "Debugger.resume", null, bps[bp_stop_expected2 ? 0 : 1].Value["locations"][0]["lineNumber"].Value<int>(), bps[bp_stop_expected2 ? 0 : 1].Value["locations"][0]["columnNumber"].Value<int>(), method_to_stop); } [Fact] public async Task BreakOnDebuggerBreak() { await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method_async('[debugger-test] UserBreak:BreakOnDebuggerBreakCommand'); }, 1);", "dotnet://debugger-test.dll/debugger-test2.cs", 58, 8, "BreakOnDebuggerBreakCommand", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 59, 8, "BreakOnDebuggerBreakCommand", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 60, 8, "BreakOnDebuggerBreakCommand", locals_fn: async (locals) => { CheckNumber(locals, "a", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 61, 8, "BreakOnDebuggerBreakCommand", locals_fn: async (locals) => { CheckNumber(locals, "a", 50); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://debugger-test.dll/debugger-test2.cs", 62, 4, "BreakOnDebuggerBreakCommand", locals_fn: async (locals) => { CheckNumber(locals, "a", 100); await Task.CompletedTask; } ); } [Fact] public async Task BreakpointInAssemblyUsingTypeFromAnotherAssembly_BothDynamicallyLoaded() { int line = 7; // Start the task earlier than loading the assemblies, so we don't miss the event Task<JObject> bpResolved = WaitForBreakpointResolvedEvent(); await SetBreakpoint(".*/library-dependency-debugger-test1.cs$", line, 0, use_regex: true); await LoadAssemblyDynamically( Path.Combine(DebuggerTestAppPath, "library-dependency-debugger-test2.dll"), Path.Combine(DebuggerTestAppPath, "library-dependency-debugger-test2.pdb")); await LoadAssemblyDynamically( Path.Combine(DebuggerTestAppPath, "library-dependency-debugger-test1.dll"), Path.Combine(DebuggerTestAppPath, "library-dependency-debugger-test1.pdb")); var source_location = "dotnet://library-dependency-debugger-test1.dll/library-dependency-debugger-test1.cs"; Assert.Contains(source_location, scripts.Values); await bpResolved; var pause_location = await EvaluateAndCheck( "window.setTimeout(function () { invoke_static_method('[library-dependency-debugger-test1] TestDependency:IntAdd', 5, 10); }, 1);", source_location, line, 8, "IntAdd"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 5); CheckNumber(locals, "b", 10); } [Fact] public async Task DebugHotReloadMethodChangedUserBreak() { var pause_location = await LoadAssemblyAndTestHotReload( Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"), Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"), Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"), "MethodBody1", "StaticMethod1"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 12, 16, "StaticMethod1"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "b", 15); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 12, 12, "StaticMethod1"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); await CheckBool(locals, "c", true); } [Fact] public async Task DebugHotReloadMethodUnchanged() { var pause_location = await LoadAssemblyAndTestHotReload( Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"), Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"), Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"), "MethodBody2", "StaticMethod1"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 21, 12, "StaticMethod1"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 21, 12, "StaticMethod1"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); } [Fact] public async Task DebugHotReloadMethodAddBreakpoint() { int line = 30; await SetBreakpoint(".*/MethodBody1.cs$", line, 12, use_regex: true); var pause_location = await LoadAssemblyAndTestHotReload( Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"), Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"), Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"), "MethodBody3", "StaticMethod3"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 30, 12, "StaticMethod3"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "b", 15); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 30, 12, "StaticMethod3"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); await CheckBool(locals, "c", true); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 31, 12, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 32, 12, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 33, 8, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); CheckNumber(locals, "f", 50); await Task.CompletedTask; } ); } [Fact] public async Task DebugHotReloadMethodEmpty() { int line = 38; await SetBreakpoint(".*/MethodBody1.cs$", line, 0, use_regex: true); var pause_location = await LoadAssemblyAndTestHotReload( Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"), Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"), Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"), "MethodBody4", "StaticMethod4"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 38, 12, "StaticMethod4"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 39, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 40, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 41, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 42, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 43, 8, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 38, 8, "StaticMethod4"); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); } [Fact] public async Task ConditionalBreakpointInALoop() { var bp_conditional = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 4, condition:"i == 3"); var bp_check = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 5); await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] LoopClass:LoopToBreak'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 3); await Task.CompletedTask; } ); await SendCommandAndCheck(null, "Debugger.resume", null, bp_check.Value["locations"][0]["lineNumber"].Value<int>(), bp_check.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak"); } [Fact] public async Task ConditionalBreakpointInALoopStopMoreThanOnce() { var bp_conditional = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 4, condition:"i % 3 == 0"); var bp_check = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 5); await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] LoopClass:LoopToBreak'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 0); await Task.CompletedTask; } ); await SendCommandAndCheck(null, "Debugger.resume", null, bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 3); await Task.CompletedTask; }); await SendCommandAndCheck(null, "Debugger.resume", null, bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 6); await Task.CompletedTask; }); await SendCommandAndCheck(null, "Debugger.resume", null, bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 9); await Task.CompletedTask; }); await SendCommandAndCheck(null, "Debugger.resume", null, bp_check.Value["locations"][0]["lineNumber"].Value<int>(), bp_check.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak"); } [Fact] public async Task ConditionalBreakpointNoStopInALoop() { var bp_conditional = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 4, condition:"i == \"10\""); var bp_check = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 5); await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] LoopClass:LoopToBreak'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_check.Value["locations"][0]["lineNumber"].Value<int>(), bp_check.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak" ); } [Fact] public async Task ConditionalBreakpointNotBooleanInALoop() { var bp_conditional = await SetBreakpointInMethod("debugger-test.dll", "LoopClass", "LoopToBreak", 4, condition:"i + 4"); await EvaluateAndCheck( "window.setTimeout(function() { invoke_static_method('[debugger-test] LoopClass:LoopToBreak'); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 0); await Task.CompletedTask; } ); await SendCommandAndCheck(null, "Debugger.resume", null, bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 1); await Task.CompletedTask; }); await SendCommandAndCheck(null, "Debugger.resume", null, bp_conditional.Value["locations"][0]["lineNumber"].Value<int>(), bp_conditional.Value["locations"][0]["columnNumber"].Value<int>(), "LoopToBreak", locals_fn: async (locals) => { CheckNumber(locals, "i", 2); await Task.CompletedTask; }); } [Fact] public async Task CreateGoodBreakpointAndHitGoToNonWasmPageComeBackAndHitAgain() { var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8); var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd"); Assert.Equal("other", pause_location["reason"]?.Value<string>()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>()); var top_frame = pause_location["callFrames"][0]; Assert.Equal("IntAdd", top_frame["functionName"].Value<string>()); Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>()); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]); //now check the scope var scope = top_frame["scopeChain"][0]; Assert.Equal("local", scope["type"]); Assert.Equal("IntAdd", scope["name"]); Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); await cli.SendCommand("Debugger.resume", null, token); var run_method = JObject.FromObject(new { expression = "window.setTimeout(function() { load_non_wasm_page(); }, 1);" }); await cli.SendCommand("Runtime.evaluate", run_method, token); await Task.Delay(1000, token); run_method = JObject.FromObject(new { expression = "window.setTimeout(function() { reload_wasm_page(); }, 1);" }); await cli.SendCommand("Runtime.evaluate", run_method, token); await insp.WaitFor(Inspector.READY); await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd", wait_for_event_fn: (pause_location) => { Assert.Equal("other", pause_location["reason"]?.Value<string>()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>()); var top_frame = pause_location["callFrames"][0]; Assert.Equal("IntAdd", top_frame["functionName"].Value<string>()); Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>()); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]); //now check the scope var scope = top_frame["scopeChain"][0]; Assert.Equal("local", scope["type"]); Assert.Equal("IntAdd", scope["name"]); Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); return Task.CompletedTask; } ); } [Theory] [InlineData("RunDebuggerHidden", "HiddenMethod")] [InlineData("RunStepThroughWithHidden", "StepThroughWithHiddenBp")] // debuggerHidden shadows the effect of stepThrough [InlineData("RunNonUserCodeWithHidden", "NonUserCodeWithHiddenBp")] // and nonUserCode public async Task DebuggerHiddenNoStopOnBp(string evalFunName, string decoratedFunName) { var bp_hidden = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", decoratedFunName, 1); var bp_final = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 2); Assert.Empty(bp_hidden.Value["locations"]); await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_final.Value["locations"][0]["lineNumber"].Value<int>(), bp_final.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); } [Theory] [InlineData("RunDebuggerHidden")] [InlineData("RunStepThroughWithHidden")] // debuggerHidden shadows the effect of stepThrough [InlineData("RunNonUserCodeWithHidden")] // and nonUserCode public async Task DebuggerHiddenStopOnUserBp(string evalFunName) { var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 2); var bp_final = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 3); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 2);", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); await SendCommandAndCheck(null, "Debugger.resume", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName); await SendCommandAndCheck(null, "Debugger.resume", "dotnet://debugger-test.dll/debugger-test.cs", bp_final.Value["locations"][0]["lineNumber"].Value<int>(), bp_final.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName); } [Fact] public async Task DebugHotReloadMethodChangedUserBreakUsingSDB() { string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"); string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"); string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"); var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges( asm_file, pdb_file, "MethodBody1", "StaticMethod1"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody1", "StaticMethod1", 1); JToken top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 12, 16, scripts, top_frame["location"]); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "b", 15); pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody1", "StaticMethod1", 2); top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 12, 12, scripts, top_frame["location"]); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); await CheckBool(locals, "c", true); } [Fact] public async Task DebugHotReloadMethodUnchangedUsingSDB() { string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"); string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"); string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"); var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges( asm_file, pdb_file, "MethodBody2", "StaticMethod1"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody2", "StaticMethod1", 1); JToken top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 21, 12, scripts, top_frame["location"]); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody2", "StaticMethod1", 2); top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 21, 12, scripts, top_frame["location"]); } [Fact] public async Task DebugHotReloadMethodAddBreakpointUsingSDB() { string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"); string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"); string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"); int line = 30; await SetBreakpoint(".*/MethodBody1.cs$", line, 12, use_regex: true); var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges( asm_file, pdb_file, "MethodBody3", "StaticMethod3"); var locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "a", 10); //apply first update pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody3", "StaticMethod3", 1); JToken top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod3", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 30, 12, scripts, top_frame["location"]); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); CheckNumber(locals, "b", 15); //apply second update pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody3", "StaticMethod3", 2); top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod3", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 30, 12, scripts, top_frame["location"]); locals = await GetProperties(pause_location["callFrames"][0]["callFrameId"].Value<string>()); await CheckBool(locals, "c", true); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 31, 12, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 32, 12, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 33, 8, "StaticMethod3", locals_fn: async (locals) => { CheckNumber(locals, "d", 10); CheckNumber(locals, "e", 20); CheckNumber(locals, "f", 50); await Task.CompletedTask; } ); } [Fact] public async Task DebugHotReloadMethodEmptyUsingSDB() { string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"); string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"); string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"); int line = 38; await SetBreakpoint(".*/MethodBody1.cs$", line, 0, use_regex: true); var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges( asm_file, pdb_file, "MethodBody4", "StaticMethod4"); //apply first update pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody4", "StaticMethod4", 1); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 39, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 40, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 41, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 42, 12, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); await StepAndCheck(StepKind.Over, "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 43, 8, "StaticMethod4", locals_fn: async (locals) => { CheckNumber(locals, "a", 10); CheckNumber(locals, "b", 20); await Task.CompletedTask; } ); //pause_location = await SendCommandAndCheck(JObject.FromObject(new { }), "Debugger.resume", "dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 38, 8, "StaticMethod4"); } [Theory] [InlineData(false, "RunStepThrough", 847, 8)] [InlineData(true, "RunStepThrough", 847, 8)] [InlineData(false, "RunNonUserCode", 852, 4, "NonUserCodeBp")] [InlineData(true, "RunNonUserCode", 867, 8)] [InlineData(false, "RunStepThroughWithNonUserCode", 933, 8)] [InlineData(true, "RunStepThroughWithNonUserCode", 933, 8)] public async Task StepThroughOrNonUserCodeAttributeStepInNoBp(bool justMyCodeEnabled, string evalFunName, int line, int col, string funcName="") { var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 1); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); await SetJustMyCode(justMyCodeEnabled); if (funcName == "") funcName = evalFunName; await SendCommandAndCheck(null, "Debugger.stepInto", "dotnet://debugger-test.dll/debugger-test.cs", line, col, funcName); } [Theory] [InlineData(false, "RunStepThrough", "StepThrougBp", "", 846, 8)] [InlineData(true, "RunStepThrough", "StepThrougBp", "RunStepThrough", 847, 8)] [InlineData(false, "RunNonUserCode", "NonUserCodeBp", "NonUserCodeBp", 852, 4)] [InlineData(true, "RunNonUserCode", "NonUserCodeBp", "RunNonUserCode", 867, 8)] [InlineData(false, "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeBp", "", 932, 8)] [InlineData(true, "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeBp", "RunStepThroughWithNonUserCode", 933, 8)] public async Task StepThroughOrNonUserCodeAttributeStepInWithBp( bool justMyCodeEnabled, string evalFunName, string decoratedFunName, string funName, int line, int col) { var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 1); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); await SetJustMyCode(justMyCodeEnabled); if (!justMyCodeEnabled && funName == "") { var bp1_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", decoratedFunName, 1); var bp2_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", decoratedFunName, 3); var line1 = bp1_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); var line2 = bp2_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); await SendCommandAndCheck(null, "Debugger.stepInto", "dotnet://debugger-test.dll/debugger-test.cs", line1, 8, decoratedFunName); await SendCommandAndCheck(null, "Debugger.stepInto", "dotnet://debugger-test.dll/debugger-test.cs", line2, 8, decoratedFunName); funName = evalFunName; } await SendCommandAndCheck(null, "Debugger.stepInto", "dotnet://debugger-test.dll/debugger-test.cs", line, col, funName); } [Theory] [InlineData(false, "RunStepThrough", "StepThrougBp")] [InlineData(true, "RunStepThrough", "StepThrougBp")] [InlineData(true, "RunNonUserCode", "NonUserCodeBp")] [InlineData(false, "RunNonUserCode", "NonUserCodeBp")] [InlineData(false, "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeBp")] [InlineData(true, "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeBp")] public async Task StepThroughOrNonUserCodeAttributeResumeWithBp(bool justMyCodeEnabled, string evalFunName, string decoratedFunName) { var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 1); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); await SetJustMyCode(justMyCodeEnabled); if (!justMyCodeEnabled) { var bp1_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", decoratedFunName, 1); var line1 = bp1_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); await SendCommandAndCheck(null, "Debugger.resume", "dotnet://debugger-test.dll/debugger-test.cs", line1, 8, decoratedFunName); } var bp_outside_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 2); var line2 = bp_outside_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); await SendCommandAndCheck(null, "Debugger.resume", "dotnet://debugger-test.dll/debugger-test.cs", line2, 8, evalFunName); } [Theory] [InlineData(false, "Debugger.stepInto", "RunStepThrough", "StepThrougUserBp", 841, 8, "RunStepThrough", 848, 4)] [InlineData(true, "Debugger.stepInto", "RunStepThrough", "RunStepThrough", -1, 8, "RunStepThrough", -1, 4)] [InlineData(false, "Debugger.resume", "RunStepThrough", "StepThrougUserBp", 841, 8, "RunStepThrough", 848, 4)] [InlineData(true, "Debugger.resume", "RunStepThrough", "RunStepThrough", -1, 8, "RunStepThrough", -1, 4)] [InlineData(false, "Debugger.stepInto", "RunNonUserCode", "NonUserCodeUserBp", 860, 4, "NonUserCodeUserBp", 861, 8)] [InlineData(true, "Debugger.stepInto", "RunNonUserCode", "RunNonUserCode", -1, 8, "RunNonUserCode", -1, 4)] [InlineData(false, "Debugger.resume", "RunNonUserCode", "NonUserCodeUserBp", 861, 8, "RunNonUserCode", -1, 4)] [InlineData(true, "Debugger.resume", "RunNonUserCode", "RunNonUserCode", -1, 8, "RunNonUserCode", -1, 4)] [InlineData(false, "Debugger.stepInto", "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeUserBp", 927, 8, "RunStepThroughWithNonUserCode", 934, 4)] [InlineData(true, "Debugger.stepInto", "RunStepThroughWithNonUserCode", "RunStepThroughWithNonUserCode", -1, 8, "RunStepThroughWithNonUserCode", -1, 4)] [InlineData(false, "Debugger.resume", "RunStepThroughWithNonUserCode", "StepThroughWithNonUserCodeUserBp", 927, 8, "RunStepThroughWithNonUserCode", -1, 4)] [InlineData(true, "Debugger.resume", "RunStepThroughWithNonUserCode", "RunStepThroughWithNonUserCode", -1, 8, "RunStepThroughWithNonUserCode", -1, 4)] public async Task StepThroughOrNonUserCodeAttributeWithUserBp( bool justMyCodeEnabled, string debuggingFunction, string evalFunName, string functionNameCheck1, int line1, int col1, string functionNameCheck2, int line2, int col2) { var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 2); var bp_outside_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", evalFunName, 3); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:{evalFunName}'); }}, 1);", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), evalFunName ); await SetJustMyCode(justMyCodeEnabled); if (line1 == -1) line1 = bp_outside_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>() - 1; if (line2 == -1) line2 = bp_outside_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); await SendCommandAndCheck(null, debuggingFunction, "dotnet://debugger-test.dll/debugger-test.cs", line1, col1, functionNameCheck1); await SendCommandAndCheck(null, debuggingFunction, "dotnet://debugger-test.dll/debugger-test.cs", line2, col2, functionNameCheck2); } [Theory] [InlineData("Debugger.stepInto", 1, 2, false)] [InlineData("Debugger.stepInto", 1, 2, true)] [InlineData("Debugger.resume", 1, 2, true)] [InlineData("Debugger.stepInto", 2, 3, false)] [InlineData("Debugger.resume", 2, 3, false)] public async Task StepperBoundary(string debuggingAction, int lineBpInit, int lineBpFinal, bool hasBpInDecoratedFun) { // behavior of StepperBoundary is the same for JMC enabled and disabled // but the effect of NonUserCode escape is better visible for JMC: enabled await SetJustMyCode(true); var bp_init = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "RunNoBoundary", lineBpInit); var init_location = await EvaluateAndCheck( $"window.setTimeout(function() {{ invoke_static_method('[debugger-test] DebuggerAttribute:RunNoBoundary'); }}, {lineBpInit});", "dotnet://debugger-test.dll/debugger-test.cs", bp_init.Value["locations"][0]["lineNumber"].Value<int>(), bp_init.Value["locations"][0]["columnNumber"].Value<int>(), "RunNoBoundary" ); var bp_final = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "RunNoBoundary", lineBpFinal); if (hasBpInDecoratedFun) { var bp_decorated_fun = await SetBreakpointInMethod("debugger-test.dll", "DebuggerAttribute", "BoundaryBp", 2); var line_decorated_fun = bp_decorated_fun.Value["locations"][0]["lineNumber"].Value<int>(); var col_decorated_fun = bp_decorated_fun.Value["locations"][0]["columnNumber"].Value<int>(); await SendCommandAndCheck(null, debuggingAction, "dotnet://debugger-test.dll/debugger-test.cs", line_decorated_fun, col_decorated_fun, "BoundaryBp"); } if (lineBpInit == 2) await SendCommandAndCheck(null, debuggingAction, "dotnet://debugger-test.dll/debugger-test.cs", 879, 8, "BoundaryUserBp"); var line = bp_final.Value["locations"][0]["lineNumber"].Value<int>(); var col = bp_final.Value["locations"][0]["columnNumber"].Value<int>(); await SendCommandAndCheck(null, debuggingAction, "dotnet://debugger-test.dll/debugger-test.cs", line, col, "RunNoBoundary"); } [Fact] public async Task CreateGoodBreakpointAndHitGoToWasmPageWithoutAssetsComeBackAndHitAgain() { var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8); var pause_location = await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd"); Assert.Equal("other", pause_location["reason"]?.Value<string>()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>()); var top_frame = pause_location["callFrames"][0]; Assert.Equal("IntAdd", top_frame["functionName"].Value<string>()); Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>()); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]); //now check the scope var scope = top_frame["scopeChain"][0]; Assert.Equal("local", scope["type"]); Assert.Equal("IntAdd", scope["name"]); Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); await cli.SendCommand("Debugger.resume", null, token); var run_method = JObject.FromObject(new { expression = "window.setTimeout(function() { load_wasm_page_without_assets(); }, 1);" }); await cli.SendCommand("Runtime.evaluate", run_method, token); await insp.WaitFor(Inspector.READY); run_method = JObject.FromObject(new { expression = "window.setTimeout(function() { reload_wasm_page(); }, 1);" }); await cli.SendCommand("Runtime.evaluate", run_method, token); await insp.WaitFor(Inspector.READY); await EvaluateAndCheck( "window.setTimeout(function() { invoke_add(); }, 1);", "dotnet://debugger-test.dll/debugger-test.cs", 10, 8, "IntAdd", wait_for_event_fn: async (pause_location) => { Assert.Equal("other", pause_location["reason"]?.Value<string>()); Assert.Equal(bp.Value["breakpointId"]?.ToString(), pause_location["hitBreakpoints"]?[0]?.Value<string>()); var top_frame = pause_location["callFrames"][0]; Assert.Equal("IntAdd", top_frame["functionName"].Value<string>()); Assert.Contains("debugger-test.cs", top_frame["url"].Value<string>()); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, top_frame["functionLocation"]); //now check the scope var scope = top_frame["scopeChain"][0]; Assert.Equal("local", scope["type"]); Assert.Equal("IntAdd", scope["name"]); Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); await Task.CompletedTask; } ); } [Fact] public async Task DebugHotReloadMethod_CheckBreakpointLineUpdated_ByVS_Simulated() { string asm_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.dll"); string pdb_file = Path.Combine(DebuggerTestAppPath, "ApplyUpdateReferencedAssembly.pdb"); string asm_file_hot_reload = Path.Combine(DebuggerTestAppPath, "../wasm/ApplyUpdateReferencedAssembly.dll"); var bp = await SetBreakpoint(".*/MethodBody1.cs$", 48, 12, use_regex: true); var pause_location = await LoadAssemblyAndTestHotReloadUsingSDBWithoutChanges( asm_file, pdb_file, "MethodBody5", "StaticMethod1"); //apply first update pause_location = await LoadAssemblyAndTestHotReloadUsingSDB( asm_file_hot_reload, "MethodBody5", "StaticMethod1", 1, rebindBreakpoint : async () => { await RemoveBreakpoint(bp.Value["breakpointId"].Value<string>()); await SetBreakpoint(".*/MethodBody1.cs$", 49, 12, use_regex: true); }); JToken top_frame = pause_location["callFrames"]?[0]; AssertEqual("StaticMethod1", top_frame?["functionName"]?.Value<string>(), top_frame?.ToString()); CheckLocation("dotnet://ApplyUpdateReferencedAssembly.dll/MethodBody1.cs", 49, 12, scripts, top_frame["location"]); } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/Methodical/eh/regress/asurt/122239/outermostFinally.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="outermostFinally.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\..\..\..\common\eh_common.csproj" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="outermostFinally.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\..\..\..\common\eh_common.csproj" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/readytorun/coreroot_determinism/Program.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Runtime.InteropServices; internal class Program { public static int CompareDLLs(string folder1, string folder2) { int result = 100; string superIlcFolder1 = Directory.GetDirectories(folder1, "CPAOT*").First(); string superIlcFolder2 = Directory.GetDirectories(folder2, "CPAOT*").First(); // Check for files that failed compilation with one of the seeds but not the other HashSet<string> uniqueFilenames = new HashSet<string>(Directory.GetFiles(superIlcFolder1, "*.dll").Select(Path.GetFileName)); uniqueFilenames.SymmetricExceptWith(Directory.GetFiles(superIlcFolder2, "*.dll").Select(Path.GetFileName)); foreach (string uniqueFilename in uniqueFilenames) { Console.WriteLine($"{uniqueFilename} was found in only one of the output folders."); result = 1; } foreach (string filename in Directory.GetFiles(superIlcFolder1, "*.dll").Select(Path.GetFileName)) { if (uniqueFilenames.Contains(filename)) continue; byte[] file1 = File.ReadAllBytes(Path.Combine(superIlcFolder1, Path.GetFileName(filename))); byte[] file2 = File.ReadAllBytes(Path.Combine(superIlcFolder2, Path.GetFileName(filename))); if (file1.Length != file2.Length) { Console.WriteLine(filename); Console.WriteLine($"Expected ReadyToRun'd files to be identical but they have different sizes ({file1.Length} and {file2.Length})"); result = 1; continue; } int byteDifferentCount = 0; for (int i = 0; i < file1.Length; ++i) { if (file1[i] != file2[i]) { ++byteDifferentCount; } } if (byteDifferentCount > 0) { result = 1; Console.WriteLine($"Error: Found {byteDifferentCount} different bytes in {filename}"); continue; } Console.WriteLine($"Files of length {file1.Length} were identical."); } return result; } public static string OSExeSuffix(string path) => (OperatingSystem.IsWindows() ? path + ".exe" : path); private static void PrepareCompilationInputFolder(string coreRootFolder, string compilationInputFolder) { if (Directory.Exists(compilationInputFolder)) { Directory.Delete(compilationInputFolder, true); } Directory.CreateDirectory(compilationInputFolder); CopyDeterminismTestAssembly(coreRootFolder, compilationInputFolder, "System.Private.CoreLib.dll"); } private static void CopyDeterminismTestAssembly(string coreRootFolder, string compilationInputFolder, string fileName) { File.Copy(Path.Combine(coreRootFolder, fileName), Path.Combine(compilationInputFolder, fileName)); } public static bool CompileWithSeed(int seed, string coreRootPath, string compilationInputFolder, string outDir) { string superIlcPath = Path.Combine(coreRootPath, "R2RTest", "R2RTest.dll"); string coreRunPath = Path.Combine(coreRootPath, OSExeSuffix("corerun")); Console.WriteLine($"================================== Compiling with seed {seed} =================================="); Environment.SetEnvironmentVariable("CoreRT_DeterminismSeed", seed.ToString()); if (Directory.Exists(outDir)) { Directory.Delete(outDir, true); } Directory.CreateDirectory(outDir); ProcessStartInfo processStartInfo = new ProcessStartInfo(coreRunPath, $"{superIlcPath} compile-directory -cr {coreRootPath} -in {compilationInputFolder} --nojit --noexe --large-bubble --release --nocleanup -out {outDir}"); var process = Process.Start(processStartInfo); process.WaitForExit(); if (process.ExitCode != 0) { Console.WriteLine($"Compilation failed. {processStartInfo.FileName} {processStartInfo.Arguments} failed with exit code {process.ExitCode}"); } return 0 == process.ExitCode; } public static int Main() { string coreRootPath = Environment.GetEnvironmentVariable("CORE_ROOT"); string compilationInputFolder = "TestAssemblies"; PrepareCompilationInputFolder(coreRootPath, compilationInputFolder); if (!CompileWithSeed(1, coreRootPath, compilationInputFolder, "seed1")) return 1; if (!CompileWithSeed(2, coreRootPath, compilationInputFolder, "seed2")) return 1; return CompareDLLs("seed1", "seed2"); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Runtime.InteropServices; internal class Program { public static int CompareDLLs(string folder1, string folder2) { int result = 100; string superIlcFolder1 = Directory.GetDirectories(folder1, "CPAOT*").First(); string superIlcFolder2 = Directory.GetDirectories(folder2, "CPAOT*").First(); // Check for files that failed compilation with one of the seeds but not the other HashSet<string> uniqueFilenames = new HashSet<string>(Directory.GetFiles(superIlcFolder1, "*.dll").Select(Path.GetFileName)); uniqueFilenames.SymmetricExceptWith(Directory.GetFiles(superIlcFolder2, "*.dll").Select(Path.GetFileName)); foreach (string uniqueFilename in uniqueFilenames) { Console.WriteLine($"{uniqueFilename} was found in only one of the output folders."); result = 1; } foreach (string filename in Directory.GetFiles(superIlcFolder1, "*.dll").Select(Path.GetFileName)) { if (uniqueFilenames.Contains(filename)) continue; byte[] file1 = File.ReadAllBytes(Path.Combine(superIlcFolder1, Path.GetFileName(filename))); byte[] file2 = File.ReadAllBytes(Path.Combine(superIlcFolder2, Path.GetFileName(filename))); if (file1.Length != file2.Length) { Console.WriteLine(filename); Console.WriteLine($"Expected ReadyToRun'd files to be identical but they have different sizes ({file1.Length} and {file2.Length})"); result = 1; continue; } int byteDifferentCount = 0; for (int i = 0; i < file1.Length; ++i) { if (file1[i] != file2[i]) { ++byteDifferentCount; } } if (byteDifferentCount > 0) { result = 1; Console.WriteLine($"Error: Found {byteDifferentCount} different bytes in {filename}"); continue; } Console.WriteLine($"Files of length {file1.Length} were identical."); } return result; } public static string OSExeSuffix(string path) => (OperatingSystem.IsWindows() ? path + ".exe" : path); private static void PrepareCompilationInputFolder(string coreRootFolder, string compilationInputFolder) { if (Directory.Exists(compilationInputFolder)) { Directory.Delete(compilationInputFolder, true); } Directory.CreateDirectory(compilationInputFolder); CopyDeterminismTestAssembly(coreRootFolder, compilationInputFolder, "System.Private.CoreLib.dll"); } private static void CopyDeterminismTestAssembly(string coreRootFolder, string compilationInputFolder, string fileName) { File.Copy(Path.Combine(coreRootFolder, fileName), Path.Combine(compilationInputFolder, fileName)); } public static bool CompileWithSeed(int seed, string coreRootPath, string compilationInputFolder, string outDir) { string superIlcPath = Path.Combine(coreRootPath, "R2RTest", "R2RTest.dll"); string coreRunPath = Path.Combine(coreRootPath, OSExeSuffix("corerun")); Console.WriteLine($"================================== Compiling with seed {seed} =================================="); Environment.SetEnvironmentVariable("CoreRT_DeterminismSeed", seed.ToString()); if (Directory.Exists(outDir)) { Directory.Delete(outDir, true); } Directory.CreateDirectory(outDir); ProcessStartInfo processStartInfo = new ProcessStartInfo(coreRunPath, $"{superIlcPath} compile-directory -cr {coreRootPath} -in {compilationInputFolder} --nojit --noexe --large-bubble --release --nocleanup -out {outDir}"); var process = Process.Start(processStartInfo); process.WaitForExit(); if (process.ExitCode != 0) { Console.WriteLine($"Compilation failed. {processStartInfo.FileName} {processStartInfo.Arguments} failed with exit code {process.ExitCode}"); } return 0 == process.ExitCode; } public static int Main() { string coreRootPath = Environment.GetEnvironmentVariable("CORE_ROOT"); string compilationInputFolder = "TestAssemblies"; PrepareCompilationInputFolder(coreRootPath, compilationInputFolder); if (!CompileWithSeed(1, coreRootPath, compilationInputFolder, "seed1")) return 1; if (!CompileWithSeed(2, coreRootPath, compilationInputFolder, "seed2")) return 1; return CompareDLLs("seed1", "seed2"); } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/Microsoft.Extensions.Configuration.Xml/src/XmlStreamConfigurationSource.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace Microsoft.Extensions.Configuration.Xml { /// <summary> /// Represents a XML file as an <see cref="IConfigurationSource"/>. /// </summary> public class XmlStreamConfigurationSource : StreamConfigurationSource { /// <summary> /// Builds the <see cref="XmlStreamConfigurationProvider"/> for this source. /// </summary> /// <param name="builder">The <see cref="IConfigurationBuilder"/>.</param> /// <returns>An <see cref="XmlStreamConfigurationProvider"/></returns> public override IConfigurationProvider Build(IConfigurationBuilder builder) => new XmlStreamConfigurationProvider(this); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace Microsoft.Extensions.Configuration.Xml { /// <summary> /// Represents a XML file as an <see cref="IConfigurationSource"/>. /// </summary> public class XmlStreamConfigurationSource : StreamConfigurationSource { /// <summary> /// Builds the <see cref="XmlStreamConfigurationProvider"/> for this source. /// </summary> /// <param name="builder">The <see cref="IConfigurationBuilder"/>.</param> /// <returns>An <see cref="XmlStreamConfigurationProvider"/></returns> public override IConfigurationProvider Build(IConfigurationBuilder builder) => new XmlStreamConfigurationProvider(this); } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./eng/common/generate-locproject.ps1
Param( [Parameter(Mandatory=$true)][string] $SourcesDirectory, # Directory where source files live; if using a Localize directory it should live in here [string] $LanguageSet = 'VS_Main_Languages', # Language set to be used in the LocProject.json [switch] $UseCheckedInLocProjectJson, # When set, generates a LocProject.json and compares it to one that already exists in the repo; otherwise just generates one [switch] $CreateNeutralXlfs # Creates neutral xlf files. Only set to false when running locally ) # Generates LocProject.json files for the OneLocBuild task. OneLocBuildTask is described here: # https://ceapex.visualstudio.com/CEINTL/_wiki/wikis/CEINTL.wiki/107/Localization-with-OneLocBuild-Task Set-StrictMode -Version 2.0 $ErrorActionPreference = "Stop" . $PSScriptRoot\tools.ps1 Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') $exclusionsFilePath = "$SourcesDirectory\eng\Localize\LocExclusions.json" $exclusions = @{ Exclusions = @() } if (Test-Path -Path $exclusionsFilePath) { $exclusions = Get-Content "$exclusionsFilePath" | ConvertFrom-Json } Push-Location "$SourcesDirectory" # push location for Resolve-Path -Relative to work # Template files $jsonFiles = @() $jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern $jsonTemplateFiles | ForEach-Object { $null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json $destinationFile = "$($_.Directory.FullName)\$($Matches.1).json" $jsonFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru } $jsonWinformsTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern $xlfFiles = @() $allXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.xlf" $langXlfFiles = @() if ($allXlfFiles) { $null = $allXlfFiles[0].FullName -Match "\.([\w-]+)\.xlf" # matches '[langcode].xlf' $firstLangCode = $Matches.1 $langXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.$firstLangCode.xlf" } $langXlfFiles | ForEach-Object { $null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf $destinationFile = "$($_.Directory.FullName)\$($Matches.1).xlf" $xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru } $locFiles = $jsonFiles + $jsonWinformsTemplateFiles + $xlfFiles $locJson = @{ Projects = @( @{ LanguageSet = $LanguageSet LocItems = @( $locFiles | ForEach-Object { $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" $continue = $true foreach ($exclusion in $exclusions.Exclusions) { if ($outputPath.Contains($exclusion)) { $continue = $false } } $sourceFile = ($_.FullName | Resolve-Path -Relative) if (!$CreateNeutralXlfs -and $_.Extension -eq '.xlf') { Remove-Item -Path $sourceFile } if ($continue) { if ($_.Directory.Name -eq 'en' -and $_.Extension -eq '.json') { return @{ SourceFile = $sourceFile CopyOption = "LangIDOnPath" OutputPath = "$($_.Directory.Parent.FullName | Resolve-Path -Relative)\" } } else { return @{ SourceFile = $sourceFile CopyOption = "LangIDOnName" OutputPath = $outputPath } } } } ) } ) } $json = ConvertTo-Json $locJson -Depth 5 Write-Host "LocProject.json generated:`n`n$json`n`n" Pop-Location if (!$UseCheckedInLocProjectJson) { New-Item "$SourcesDirectory\eng\Localize\LocProject.json" -Force # Need this to make sure the Localize directory is created Set-Content "$SourcesDirectory\eng\Localize\LocProject.json" $json } else { New-Item "$SourcesDirectory\eng\Localize\LocProject-generated.json" -Force # Need this to make sure the Localize directory is created Set-Content "$SourcesDirectory\eng\Localize\LocProject-generated.json" $json if ((Get-FileHash "$SourcesDirectory\eng\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\eng\Localize\LocProject.json").Hash) { Write-PipelineTelemetryError -Category "OneLocBuild" -Message "Existing LocProject.json differs from generated LocProject.json. Download LocProject-generated.json and compare them." exit 1 } else { Write-Host "Generated LocProject.json and current LocProject.json are identical." } }
Param( [Parameter(Mandatory=$true)][string] $SourcesDirectory, # Directory where source files live; if using a Localize directory it should live in here [string] $LanguageSet = 'VS_Main_Languages', # Language set to be used in the LocProject.json [switch] $UseCheckedInLocProjectJson, # When set, generates a LocProject.json and compares it to one that already exists in the repo; otherwise just generates one [switch] $CreateNeutralXlfs # Creates neutral xlf files. Only set to false when running locally ) # Generates LocProject.json files for the OneLocBuild task. OneLocBuildTask is described here: # https://ceapex.visualstudio.com/CEINTL/_wiki/wikis/CEINTL.wiki/107/Localization-with-OneLocBuild-Task Set-StrictMode -Version 2.0 $ErrorActionPreference = "Stop" . $PSScriptRoot\tools.ps1 Import-Module -Name (Join-Path $PSScriptRoot 'native\CommonLibrary.psm1') $exclusionsFilePath = "$SourcesDirectory\eng\Localize\LocExclusions.json" $exclusions = @{ Exclusions = @() } if (Test-Path -Path $exclusionsFilePath) { $exclusions = Get-Content "$exclusionsFilePath" | ConvertFrom-Json } Push-Location "$SourcesDirectory" # push location for Resolve-Path -Relative to work # Template files $jsonFiles = @() $jsonTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "\.template\.config\\localize\\.+\.en\.json" } # .NET templating pattern $jsonTemplateFiles | ForEach-Object { $null = $_.Name -Match "(.+)\.[\w-]+\.json" # matches '[filename].[langcode].json $destinationFile = "$($_.Directory.FullName)\$($Matches.1).json" $jsonFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru } $jsonWinformsTemplateFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory" | Where-Object { $_.FullName -Match "en\\strings\.json" } # current winforms pattern $xlfFiles = @() $allXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.xlf" $langXlfFiles = @() if ($allXlfFiles) { $null = $allXlfFiles[0].FullName -Match "\.([\w-]+)\.xlf" # matches '[langcode].xlf' $firstLangCode = $Matches.1 $langXlfFiles = Get-ChildItem -Recurse -Path "$SourcesDirectory\*\*.$firstLangCode.xlf" } $langXlfFiles | ForEach-Object { $null = $_.Name -Match "(.+)\.[\w-]+\.xlf" # matches '[filename].[langcode].xlf $destinationFile = "$($_.Directory.FullName)\$($Matches.1).xlf" $xlfFiles += Copy-Item "$($_.FullName)" -Destination $destinationFile -PassThru } $locFiles = $jsonFiles + $jsonWinformsTemplateFiles + $xlfFiles $locJson = @{ Projects = @( @{ LanguageSet = $LanguageSet LocItems = @( $locFiles | ForEach-Object { $outputPath = "$(($_.DirectoryName | Resolve-Path -Relative) + "\")" $continue = $true foreach ($exclusion in $exclusions.Exclusions) { if ($outputPath.Contains($exclusion)) { $continue = $false } } $sourceFile = ($_.FullName | Resolve-Path -Relative) if (!$CreateNeutralXlfs -and $_.Extension -eq '.xlf') { Remove-Item -Path $sourceFile } if ($continue) { if ($_.Directory.Name -eq 'en' -and $_.Extension -eq '.json') { return @{ SourceFile = $sourceFile CopyOption = "LangIDOnPath" OutputPath = "$($_.Directory.Parent.FullName | Resolve-Path -Relative)\" } } else { return @{ SourceFile = $sourceFile CopyOption = "LangIDOnName" OutputPath = $outputPath } } } } ) } ) } $json = ConvertTo-Json $locJson -Depth 5 Write-Host "LocProject.json generated:`n`n$json`n`n" Pop-Location if (!$UseCheckedInLocProjectJson) { New-Item "$SourcesDirectory\eng\Localize\LocProject.json" -Force # Need this to make sure the Localize directory is created Set-Content "$SourcesDirectory\eng\Localize\LocProject.json" $json } else { New-Item "$SourcesDirectory\eng\Localize\LocProject-generated.json" -Force # Need this to make sure the Localize directory is created Set-Content "$SourcesDirectory\eng\Localize\LocProject-generated.json" $json if ((Get-FileHash "$SourcesDirectory\eng\Localize\LocProject-generated.json").Hash -ne (Get-FileHash "$SourcesDirectory\eng\Localize\LocProject.json").Hash) { Write-PipelineTelemetryError -Category "OneLocBuild" -Message "Existing LocProject.json differs from generated LocProject.json. Download LocProject-generated.json and compare them." exit 1 } else { Write-Host "Generated LocProject.json and current LocProject.json are identical." } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/coreclr/vm/ilinstrumentation.cpp
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // =========================================================================== // File: ILInstrumentation.cpp // // =========================================================================== #include "common.h" #include "ilinstrumentation.h" //--------------------------------------------------------------------------------------- InstrumentedILOffsetMapping::InstrumentedILOffsetMapping() { LIMITED_METHOD_DAC_CONTRACT; m_cMap = 0; m_rgMap = NULL; _ASSERTE(IsNull()); } //--------------------------------------------------------------------------------------- // // Check whether there is any mapping information stored in this object. // // Notes: // The memory should be alive throughout the process lifetime until // the Module containing the instrumented method is destructed. // BOOL InstrumentedILOffsetMapping::IsNull() const { LIMITED_METHOD_DAC_CONTRACT; _ASSERTE((m_cMap == 0) == (m_rgMap == NULL)); return (m_cMap == 0); } #if !defined(DACCESS_COMPILE) //--------------------------------------------------------------------------------------- // // Release the memory used by the array of COR_IL_MAPs. // // Notes: // * The memory should be alive throughout the process lifetime until the Module containing // the instrumented method is destructed. // * This struct should be read-only in DAC builds. // void InstrumentedILOffsetMapping::Clear() { LIMITED_METHOD_CONTRACT; if (m_rgMap != NULL) { delete[] m_rgMap; } m_cMap = 0; m_rgMap = NULL; } #endif // !DACCESS_COMPILE #if !defined(DACCESS_COMPILE) void InstrumentedILOffsetMapping::SetMappingInfo(SIZE_T cMap, COR_IL_MAP * rgMap) { WRAPPER_NO_CONTRACT; _ASSERTE((cMap == 0) == (rgMap == NULL)); m_cMap = cMap; m_rgMap = ARRAY_PTR_COR_IL_MAP(rgMap); } #endif // !DACCESS_COMPILE SIZE_T InstrumentedILOffsetMapping::GetCount() const { LIMITED_METHOD_DAC_CONTRACT; _ASSERTE((m_cMap == 0) == (m_rgMap == NULL)); return m_cMap; } ARRAY_PTR_COR_IL_MAP InstrumentedILOffsetMapping::GetOffsets() const { LIMITED_METHOD_DAC_CONTRACT; _ASSERTE((m_cMap == 0) == (m_rgMap == NULL)); return m_rgMap; }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // =========================================================================== // File: ILInstrumentation.cpp // // =========================================================================== #include "common.h" #include "ilinstrumentation.h" //--------------------------------------------------------------------------------------- InstrumentedILOffsetMapping::InstrumentedILOffsetMapping() { LIMITED_METHOD_DAC_CONTRACT; m_cMap = 0; m_rgMap = NULL; _ASSERTE(IsNull()); } //--------------------------------------------------------------------------------------- // // Check whether there is any mapping information stored in this object. // // Notes: // The memory should be alive throughout the process lifetime until // the Module containing the instrumented method is destructed. // BOOL InstrumentedILOffsetMapping::IsNull() const { LIMITED_METHOD_DAC_CONTRACT; _ASSERTE((m_cMap == 0) == (m_rgMap == NULL)); return (m_cMap == 0); } #if !defined(DACCESS_COMPILE) //--------------------------------------------------------------------------------------- // // Release the memory used by the array of COR_IL_MAPs. // // Notes: // * The memory should be alive throughout the process lifetime until the Module containing // the instrumented method is destructed. // * This struct should be read-only in DAC builds. // void InstrumentedILOffsetMapping::Clear() { LIMITED_METHOD_CONTRACT; if (m_rgMap != NULL) { delete[] m_rgMap; } m_cMap = 0; m_rgMap = NULL; } #endif // !DACCESS_COMPILE #if !defined(DACCESS_COMPILE) void InstrumentedILOffsetMapping::SetMappingInfo(SIZE_T cMap, COR_IL_MAP * rgMap) { WRAPPER_NO_CONTRACT; _ASSERTE((cMap == 0) == (rgMap == NULL)); m_cMap = cMap; m_rgMap = ARRAY_PTR_COR_IL_MAP(rgMap); } #endif // !DACCESS_COMPILE SIZE_T InstrumentedILOffsetMapping::GetCount() const { LIMITED_METHOD_DAC_CONTRACT; _ASSERTE((m_cMap == 0) == (m_rgMap == NULL)); return m_cMap; } ARRAY_PTR_COR_IL_MAP InstrumentedILOffsetMapping::GetOffsets() const { LIMITED_METHOD_DAC_CONTRACT; _ASSERTE((m_cMap == 0) == (m_rgMap == NULL)); return m_rgMap; }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./.git/info/exclude
# git ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. # For a project mostly in C, the following would be a good set of # exclude patterns (uncomment them if you want to use them): # *.[oa] # *~
# git ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. # For a project mostly in C, the following would be a good set of # exclude patterns (uncomment them if you want to use them): # *.[oa] # *~
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/native/external/zlib-intel/gzguts.h
/* gzguts.h -- zlib internal header definitions for gz* operations * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #ifdef _LARGEFILE64_SOURCE # ifndef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # endif # ifdef _FILE_OFFSET_BITS # undef _FILE_OFFSET_BITS # endif #endif #ifdef HAVE_HIDDEN # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) #else # define ZLIB_INTERNAL #endif #include <stdio.h> #include "zlib.h" #ifdef STDC # include <string.h> # include <stdlib.h> # include <limits.h> #endif #ifndef _POSIX_SOURCE # define _POSIX_SOURCE #endif #include <fcntl.h> #ifdef _WIN32 # include <stddef.h> #endif #if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) # include <io.h> #endif #if defined(_WIN32) # define WIDECHAR #endif #ifdef WINAPI_FAMILY # define open _open # define read _read # define write _write # define close _close #endif #ifdef NO_DEFLATE /* for compatibility with old definition */ # define NO_GZCOMPRESS #endif #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) # ifndef HAVE_VSNPRINTF # define HAVE_VSNPRINTF # endif #endif #if defined(__CYGWIN__) # ifndef HAVE_VSNPRINTF # define HAVE_VSNPRINTF # endif #endif #if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410) # ifndef HAVE_VSNPRINTF # define HAVE_VSNPRINTF # endif #endif #ifndef HAVE_VSNPRINTF # ifdef MSDOS /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), but for now we just assume it doesn't. */ # define NO_vsnprintf # endif # ifdef __TURBOC__ # define NO_vsnprintf # endif # ifdef WIN32 /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ # if !defined(vsnprintf) && !defined(NO_vsnprintf) # if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) # define vsnprintf _vsnprintf # endif # endif # endif # ifdef __SASC # define NO_vsnprintf # endif # ifdef VMS # define NO_vsnprintf # endif # ifdef __OS400__ # define NO_vsnprintf # endif # ifdef __MVS__ # define NO_vsnprintf # endif #endif /* unlike snprintf (which is required in C99), _snprintf does not guarantee null termination of the result -- however this is only used in gzlib.c where the result is assured to fit in the space provided */ #if defined(_MSC_VER) && _MSC_VER < 1900 # define snprintf _snprintf #endif #ifndef local # define local static #endif /* since "static" is used to mean two completely different things in C, we define "local" for the non-static meaning of "static", for readability (compile with -Dlocal if your debugger can't find static symbols) */ /* gz* functions always use library allocation functions */ #ifndef STDC extern voidp malloc OF((uInt size)); extern void free OF((voidpf ptr)); #endif /* get errno and strerror definition */ #if defined UNDER_CE # include <windows.h> # define zstrerror() gz_strwinerror((DWORD)GetLastError()) #else # ifndef NO_STRERROR # include <errno.h> # define zstrerror() strerror(errno) # else # define zstrerror() "stdio error (consult errno)" # endif #endif /* provide prototypes for these when building zlib without LFS */ #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); #endif /* default memLevel */ #if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 #else # define DEF_MEM_LEVEL MAX_MEM_LEVEL #endif /* default i/o buffer size -- double this for output when reading (this and twice this must be able to fit in an unsigned type) */ #define GZBUFSIZE 8192 /* gzip modes, also provide a little integrity check on the passed structure */ #define GZ_NONE 0 #define GZ_READ 7247 #define GZ_WRITE 31153 #define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */ /* values for gz_state how */ #define LOOK 0 /* look for a gzip header */ #define COPY 1 /* copy input directly */ #define GZIP 2 /* decompress a gzip stream */ /* internal gzip file state data structure */ typedef struct { /* exposed contents for gzgetc() macro */ struct gzFile_s x; /* "x" for exposed */ /* x.have: number of bytes available at x.next */ /* x.next: next output data to deliver or write */ /* x.pos: current position in uncompressed data */ /* used for both reading and writing */ int mode; /* see gzip modes above */ int fd; /* file descriptor */ char *path; /* path or fd for error messages */ unsigned size; /* buffer size, zero if not allocated yet */ unsigned want; /* requested buffer size, default is GZBUFSIZE */ unsigned char *in; /* input buffer (double-sized when writing) */ unsigned char *out; /* output buffer (double-sized when reading) */ int direct; /* 0 if processing gzip, 1 if transparent */ /* just for reading */ int how; /* 0: get header, 1: copy, 2: decompress */ z_off64_t start; /* where the gzip data started, for rewinding */ int eof; /* true if end of input file reached */ int past; /* true if read requested past end */ /* just for writing */ int level; /* compression level */ int strategy; /* compression strategy */ /* seek request */ z_off64_t skip; /* amount to skip (already rewound if backwards) */ int seek; /* true if seek request pending */ /* error information */ int err; /* error code */ char *msg; /* error message */ /* zlib inflate or deflate stream */ z_stream strm; /* stream structure in-place (not a pointer) */ } gz_state; typedef gz_state FAR *gz_statep; /* shared functions */ void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); #if defined UNDER_CE char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); #endif /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t value -- needed when comparing unsigned to z_off64_t, which is signed (possible z_off64_t types off_t, off64_t, and long are all signed) */ #ifdef INT_MAX # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) #else unsigned ZLIB_INTERNAL gz_intmax OF((void)); # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) #endif
/* gzguts.h -- zlib internal header definitions for gz* operations * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ #ifdef _LARGEFILE64_SOURCE # ifndef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # endif # ifdef _FILE_OFFSET_BITS # undef _FILE_OFFSET_BITS # endif #endif #ifdef HAVE_HIDDEN # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) #else # define ZLIB_INTERNAL #endif #include <stdio.h> #include "zlib.h" #ifdef STDC # include <string.h> # include <stdlib.h> # include <limits.h> #endif #ifndef _POSIX_SOURCE # define _POSIX_SOURCE #endif #include <fcntl.h> #ifdef _WIN32 # include <stddef.h> #endif #if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) # include <io.h> #endif #if defined(_WIN32) # define WIDECHAR #endif #ifdef WINAPI_FAMILY # define open _open # define read _read # define write _write # define close _close #endif #ifdef NO_DEFLATE /* for compatibility with old definition */ # define NO_GZCOMPRESS #endif #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) # ifndef HAVE_VSNPRINTF # define HAVE_VSNPRINTF # endif #endif #if defined(__CYGWIN__) # ifndef HAVE_VSNPRINTF # define HAVE_VSNPRINTF # endif #endif #if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410) # ifndef HAVE_VSNPRINTF # define HAVE_VSNPRINTF # endif #endif #ifndef HAVE_VSNPRINTF # ifdef MSDOS /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), but for now we just assume it doesn't. */ # define NO_vsnprintf # endif # ifdef __TURBOC__ # define NO_vsnprintf # endif # ifdef WIN32 /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ # if !defined(vsnprintf) && !defined(NO_vsnprintf) # if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) # define vsnprintf _vsnprintf # endif # endif # endif # ifdef __SASC # define NO_vsnprintf # endif # ifdef VMS # define NO_vsnprintf # endif # ifdef __OS400__ # define NO_vsnprintf # endif # ifdef __MVS__ # define NO_vsnprintf # endif #endif /* unlike snprintf (which is required in C99), _snprintf does not guarantee null termination of the result -- however this is only used in gzlib.c where the result is assured to fit in the space provided */ #if defined(_MSC_VER) && _MSC_VER < 1900 # define snprintf _snprintf #endif #ifndef local # define local static #endif /* since "static" is used to mean two completely different things in C, we define "local" for the non-static meaning of "static", for readability (compile with -Dlocal if your debugger can't find static symbols) */ /* gz* functions always use library allocation functions */ #ifndef STDC extern voidp malloc OF((uInt size)); extern void free OF((voidpf ptr)); #endif /* get errno and strerror definition */ #if defined UNDER_CE # include <windows.h> # define zstrerror() gz_strwinerror((DWORD)GetLastError()) #else # ifndef NO_STRERROR # include <errno.h> # define zstrerror() strerror(errno) # else # define zstrerror() "stdio error (consult errno)" # endif #endif /* provide prototypes for these when building zlib without LFS */ #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); #endif /* default memLevel */ #if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 #else # define DEF_MEM_LEVEL MAX_MEM_LEVEL #endif /* default i/o buffer size -- double this for output when reading (this and twice this must be able to fit in an unsigned type) */ #define GZBUFSIZE 8192 /* gzip modes, also provide a little integrity check on the passed structure */ #define GZ_NONE 0 #define GZ_READ 7247 #define GZ_WRITE 31153 #define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */ /* values for gz_state how */ #define LOOK 0 /* look for a gzip header */ #define COPY 1 /* copy input directly */ #define GZIP 2 /* decompress a gzip stream */ /* internal gzip file state data structure */ typedef struct { /* exposed contents for gzgetc() macro */ struct gzFile_s x; /* "x" for exposed */ /* x.have: number of bytes available at x.next */ /* x.next: next output data to deliver or write */ /* x.pos: current position in uncompressed data */ /* used for both reading and writing */ int mode; /* see gzip modes above */ int fd; /* file descriptor */ char *path; /* path or fd for error messages */ unsigned size; /* buffer size, zero if not allocated yet */ unsigned want; /* requested buffer size, default is GZBUFSIZE */ unsigned char *in; /* input buffer (double-sized when writing) */ unsigned char *out; /* output buffer (double-sized when reading) */ int direct; /* 0 if processing gzip, 1 if transparent */ /* just for reading */ int how; /* 0: get header, 1: copy, 2: decompress */ z_off64_t start; /* where the gzip data started, for rewinding */ int eof; /* true if end of input file reached */ int past; /* true if read requested past end */ /* just for writing */ int level; /* compression level */ int strategy; /* compression strategy */ /* seek request */ z_off64_t skip; /* amount to skip (already rewound if backwards) */ int seek; /* true if seek request pending */ /* error information */ int err; /* error code */ char *msg; /* error message */ /* zlib inflate or deflate stream */ z_stream strm; /* stream structure in-place (not a pointer) */ } gz_state; typedef gz_state FAR *gz_statep; /* shared functions */ void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); #if defined UNDER_CE char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); #endif /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t value -- needed when comparing unsigned to z_off64_t, which is signed (possible z_off64_t types off_t, off64_t, and long are all signed) */ #ifdef INT_MAX # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) #else unsigned ZLIB_INTERNAL gz_intmax OF((void)); # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) #endif
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/Methodical/ELEMENT_TYPE_IU/i_array_merge_Target_32BIT_il_d.ilproj
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> <RestorePackages>true</RestorePackages> <!-- There is a 32 and 64 version of this test to allow it to be compiled for all targets --> <CLRTestTargetUnsupported Condition="'$(TargetBits)' != '32'">true</CLRTestTargetUnsupported> <DebugType>Full</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="i_array_merge_Target_32BIT.il" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> <RestorePackages>true</RestorePackages> <!-- There is a 32 and 64 version of this test to allow it to be compiled for all targets --> <CLRTestTargetUnsupported Condition="'$(TargetBits)' != '32'">true</CLRTestTargetUnsupported> <DebugType>Full</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="i_array_merge_Target_32BIT.il" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/coreclr/inc/posterror.h
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. //***************************************************************************** // UtilCode.h // // Utility functions implemented in UtilCode.lib. // //***************************************************************************** #ifndef __PostError_h__ #define __PostError_h__ #include "switches.h" //***************************************************************************** // This function will post an error for the client. If the LOWORD(hrRpt) can // be found as a valid error message, then it is loaded and formatted with // the arguments passed in. If it cannot be found, then the error is checked // against FormatMessage to see if it is a system error. System errors are // not formatted so no add'l parameters are required. If any errors in this // process occur, hrRpt is returned for the client with no error posted. //***************************************************************************** extern "C" HRESULT __cdecl PostError( // Returned error. HRESULT hrRpt, // Reported error. ...); // Error arguments. extern "C" HRESULT __cdecl PostErrorVA( // Returned error. HRESULT hrRpt, // Reported error. va_list marker); // Error arguments. //***************************************************************************** // This function formats an error message, but doesn't fill the IErrorInfo. //***************************************************************************** HRESULT __cdecl FormatRuntimeErrorVa( _Out_writes_(cchMsg) WCHAR *rcMsg, // Buffer into which to format. ULONG cchMsg, // Size of buffer, characters. HRESULT hrRpt, // The HR to report. va_list marker); // Optional args. HRESULT __cdecl FormatRuntimeError( _Out_writes_(cchMsg) WCHAR *rcMsg, // Buffer into which to format. ULONG cchMsg, // Size of buffer, characters. HRESULT hrRpt, // The HR to report. ...); // Optional args. #endif // __PostError_h__
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. //***************************************************************************** // UtilCode.h // // Utility functions implemented in UtilCode.lib. // //***************************************************************************** #ifndef __PostError_h__ #define __PostError_h__ #include "switches.h" //***************************************************************************** // This function will post an error for the client. If the LOWORD(hrRpt) can // be found as a valid error message, then it is loaded and formatted with // the arguments passed in. If it cannot be found, then the error is checked // against FormatMessage to see if it is a system error. System errors are // not formatted so no add'l parameters are required. If any errors in this // process occur, hrRpt is returned for the client with no error posted. //***************************************************************************** extern "C" HRESULT __cdecl PostError( // Returned error. HRESULT hrRpt, // Reported error. ...); // Error arguments. extern "C" HRESULT __cdecl PostErrorVA( // Returned error. HRESULT hrRpt, // Reported error. va_list marker); // Error arguments. //***************************************************************************** // This function formats an error message, but doesn't fill the IErrorInfo. //***************************************************************************** HRESULT __cdecl FormatRuntimeErrorVa( _Out_writes_(cchMsg) WCHAR *rcMsg, // Buffer into which to format. ULONG cchMsg, // Size of buffer, characters. HRESULT hrRpt, // The HR to report. va_list marker); // Optional args. HRESULT __cdecl FormatRuntimeError( _Out_writes_(cchMsg) WCHAR *rcMsg, // Buffer into which to format. ULONG cchMsg, // Size of buffer, characters. HRESULT hrRpt, // The HR to report. ...); // Optional args. #endif // __PostError_h__
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.IO.Pipelines/ref/System.IO.Pipelines.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <Compile Include="System.IO.Pipelines.cs" /> </ItemGroup> <ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'"> <ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" /> <ProjectReference Include="$(LibrariesProjectRoot)System.Memory\ref\System.Memory.csproj" /> </ItemGroup> <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFramework)' != '$(NetCoreAppCurrent)'"> <Reference Include="System.Memory" /> <Reference Include="System.Runtime" /> </ItemGroup> <ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'"> <PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" /> <PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" /> <PackageReference Include="System.Threading.Tasks.Extensions" Version="$(SystemThreadingTasksExtensionsVersion)" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <Compile Include="System.IO.Pipelines.cs" /> </ItemGroup> <ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'"> <ProjectReference Include="$(LibrariesProjectRoot)System.Runtime\ref\System.Runtime.csproj" /> <ProjectReference Include="$(LibrariesProjectRoot)System.Memory\ref\System.Memory.csproj" /> </ItemGroup> <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFramework)' != '$(NetCoreAppCurrent)'"> <Reference Include="System.Memory" /> <Reference Include="System.Runtime" /> </ItemGroup> <ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'"> <PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" /> <PackageReference Include="System.Buffers" Version="$(SystemBuffersVersion)" /> <PackageReference Include="System.Threading.Tasks.Extensions" Version="$(SystemThreadingTasksExtensionsVersion)" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/IL_Conformance/Old/Conformance_Base/ldc_sub_ovf_u8.il
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } // //====================================== //---- CLASS ---------------- .class public ldc_sub_ovf_u8 { //---- GLOBAL DATA ---------- //---- METHODS -------------- .method public static int32 u8_0(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_1(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_2(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_3(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_4(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_5(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_6(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000001 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000001 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_7(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_8(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_9(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_10(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_11(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_12(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xFFFFFFFFFFFFFFFE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_13(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xFFFFFFFFFFFFFFFD ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFD ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_14(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_15(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_16(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xAAAAAAAAAAAAAAA9 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xAAAAAAAAAAAAAAA9 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_17(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x5555555555555554 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x5555555555555554 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_18(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xFFFFFFFFFFFFFFFF ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_19(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xFFFFFFFFFFFFFFFE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_20(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000001 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000001 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_21(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_22(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xAAAAAAAAAAAAAAAA ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_23(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x5555555555555555 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x5555555555555555 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_24(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x5555555555555555 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x5555555555555555 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_25(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x5555555555555554 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x5555555555555554 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_26(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_27(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_28(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_29(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_30(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xAAAAAAAAAAAAAAAA ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_31(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xAAAAAAAAAAAAAAA9 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xAAAAAAAAAAAAAAA9 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_32(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_33(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_34(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x5555555555555555 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x5555555555555555 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_35(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } //---- CONSTRUCTOR ---------- .method public void ldc_sub_ovf_u8() { .maxstack 0 ret } //---- MAIN ----------------- .method public static int32 main(class [mscorlib]System.String[]) { .entrypoint .maxstack 5 //====== begin testing ====== // -- 0 - 0 ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_0(int64,int64,int64) brfalse FAIL // -- 0 - 1 ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000001 ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_1(int64,int64,int64) brfalse FAIL // -- 0 - (Max - 1) ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_2(int64,int64,int64) brfalse FAIL // -- 0 - Max ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_3(int64,int64,int64) brfalse FAIL // -- 0 - Odd ldc.i8 0x0000000000000000 ldc.i8 0x5555555555555555 ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_4(int64,int64,int64) brfalse FAIL // -- 0 - Even ldc.i8 0x0000000000000000 ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_5(int64,int64,int64) brfalse FAIL //------------------------------------------------ // -- 1 - 0 ldc.i8 0x0000000000000001 ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000001 call int32 ldc_sub_ovf_u8::u8_6(int64,int64,int64) brfalse FAIL // -- 1 - 1 ldc.i8 0x0000000000000001 ldc.i8 0x0000000000000001 ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_7(int64,int64,int64) brfalse FAIL // -- 1 - (Max - 1) ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_8(int64,int64,int64) brfalse FAIL // -- 1 - Max ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_9(int64,int64,int64) brfalse FAIL // -- 1 - Odd ldc.i8 0x0000000000000001 ldc.i8 0x5555555555555555 ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_10(int64,int64,int64) brfalse FAIL // -- 1 - Even ldc.i8 0x0000000000000001 ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_11(int64,int64,int64) brfalse FAIL //------------------------------------------------ // -- (Max - 1) - 0 ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFE call int32 ldc_sub_ovf_u8::u8_12(int64,int64,int64) brfalse FAIL // -- (Max - 1) - 1 ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFD call int32 ldc_sub_ovf_u8::u8_13(int64,int64,int64) brfalse FAIL // -- (Max - 1) - (Max - 1) ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_14(int64,int64,int64) brfalse FAIL // -- (Max - 1) - Max ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_15(int64,int64,int64) brfalse FAIL // -- (Max - 1) - Odd ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x5555555555555555 ldc.i8 0xAAAAAAAAAAAAAAA9 call int32 ldc_sub_ovf_u8::u8_16(int64,int64,int64) brfalse FAIL // -- (Max - 1) - Even ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x5555555555555554 call int32 ldc_sub_ovf_u8::u8_17(int64,int64,int64) brfalse FAIL //------------------------------------------------ // -- Max - 0 ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFF call int32 ldc_sub_ovf_u8::u8_18(int64,int64,int64) brfalse FAIL // -- Max - 1 ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFE call int32 ldc_sub_ovf_u8::u8_19(int64,int64,int64) brfalse FAIL // -- Max - (Max - 1) ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000001 call int32 ldc_sub_ovf_u8::u8_20(int64,int64,int64) brfalse FAIL // -- Max - Max ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_21(int64,int64,int64) brfalse FAIL // -- Max - Odd ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x5555555555555555 ldc.i8 0xAAAAAAAAAAAAAAAA call int32 ldc_sub_ovf_u8::u8_22(int64,int64,int64) brfalse FAIL // -- Max - Even ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x5555555555555555 call int32 ldc_sub_ovf_u8::u8_23(int64,int64,int64) brfalse FAIL //------------------------------------------------ // -- Odd - 0 ldc.i8 0x5555555555555555 ldc.i8 0x0000000000000000 ldc.i8 0x5555555555555555 call int32 ldc_sub_ovf_u8::u8_24(int64,int64,int64) brfalse FAIL // -- Odd - 1 ldc.i8 0x5555555555555555 ldc.i8 0x0000000000000001 ldc.i8 0x5555555555555554 call int32 ldc_sub_ovf_u8::u8_25(int64,int64,int64) brfalse FAIL // -- Odd - (Max - 1) ldc.i8 0x5555555555555555 ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_26(int64,int64,int64) brfalse FAIL // -- Odd - Max ldc.i8 0x5555555555555555 ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_27(int64,int64,int64) brfalse FAIL // -- Odd - Odd ldc.i8 0x5555555555555555 ldc.i8 0x5555555555555555 ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_28(int64,int64,int64) brfalse FAIL // -- Odd - Even ldc.i8 0x5555555555555555 ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_29(int64,int64,int64) brfalse FAIL //------------------------------------------------ // -- Even - 0 ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x0000000000000000 ldc.i8 0xAAAAAAAAAAAAAAAA call int32 ldc_sub_ovf_u8::u8_30(int64,int64,int64) brfalse FAIL // -- Even - 1 ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x0000000000000001 ldc.i8 0xAAAAAAAAAAAAAAA9 call int32 ldc_sub_ovf_u8::u8_31(int64,int64,int64) brfalse FAIL // -- Even - (Max - 1) ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_32(int64,int64,int64) brfalse FAIL // -- Even - Max ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_33(int64,int64,int64) brfalse FAIL // -- Even - Odd ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x5555555555555555 ldc.i8 0x5555555555555555 call int32 ldc_sub_ovf_u8::u8_34(int64,int64,int64) brfalse FAIL // -- Even - Even ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_35(int64,int64,int64) brfalse FAIL //====== end testing ======== //---- branch here on pass -- PASS: ldc.i4 100 br END //---- branch here on fail -- FAIL: ldc.i4 101 //---- return the result ---- END: ret //---- END OF METHOD -------- } //---- EOF ------------------ } .assembly ldc_sub_ovf_u8{}
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern legacy library mscorlib {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } // //====================================== //---- CLASS ---------------- .class public ldc_sub_ovf_u8 { //---- GLOBAL DATA ---------- //---- METHODS -------------- .method public static int32 u8_0(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_1(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_2(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_3(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_4(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_5(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000000 ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_6(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000001 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000001 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_7(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_8(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_9(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_10(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_11(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x0000000000000001 ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_12(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xFFFFFFFFFFFFFFFE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_13(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xFFFFFFFFFFFFFFFD ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFD ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_14(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_15(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_16(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xAAAAAAAAAAAAAAA9 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xAAAAAAAAAAAAAAA9 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_17(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x5555555555555554 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x5555555555555554 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_18(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xFFFFFFFFFFFFFFFF ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_19(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xFFFFFFFFFFFFFFFE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_20(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000001 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000001 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_21(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_22(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xAAAAAAAAAAAAAAAA ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_23(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x5555555555555555 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x5555555555555555 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_24(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x5555555555555555 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x5555555555555555 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_25(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x5555555555555554 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x5555555555555554 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_26(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_27(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_28(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_29(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0x5555555555555555 ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_30(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x0000000000000000 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xAAAAAAAAAAAAAAAA ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_31(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x0000000000000001 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xAAAAAAAAAAAAAAA9 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xAAAAAAAAAAAAAAA9 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_32(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xFFFFFFFFFFFFFFFE sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_33(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xFFFFFFFFFFFFFFFF sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0xEEEEEEEEEEEEEEEE ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_34(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x5555555555555555 sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x5555555555555555 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x5555555555555555 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } .method public static int32 u8_35(int64,int64,int64) { .locals (class [mscorlib]System.OverflowException,unsigned int64) .maxstack 2 try_start: ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xAAAAAAAAAAAAAAAA sub.ovf.un //conv.ovf.u8 stloc.1 leave.s try_end try_end: ldloc.1 ldc.i8 0x0000000000000000 ceq br END aHandler: isinst [mscorlib]System.OverflowException stloc 0 leave HEnd HEnd: ldloc 0 brfalse FAIL ldc.i8 0x0000000000000000 ldc.i8 0xEEEEEEEEEEEEEEEE ceq br END FAIL: ldc.i4 0x0000000000000000 END: ret .try try_start to try_end catch [mscorlib]System.OverflowException handler aHandler to HEnd } //---- CONSTRUCTOR ---------- .method public void ldc_sub_ovf_u8() { .maxstack 0 ret } //---- MAIN ----------------- .method public static int32 main(class [mscorlib]System.String[]) { .entrypoint .maxstack 5 //====== begin testing ====== // -- 0 - 0 ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_0(int64,int64,int64) brfalse FAIL // -- 0 - 1 ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000001 ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_1(int64,int64,int64) brfalse FAIL // -- 0 - (Max - 1) ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_2(int64,int64,int64) brfalse FAIL // -- 0 - Max ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_3(int64,int64,int64) brfalse FAIL // -- 0 - Odd ldc.i8 0x0000000000000000 ldc.i8 0x5555555555555555 ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_4(int64,int64,int64) brfalse FAIL // -- 0 - Even ldc.i8 0x0000000000000000 ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_5(int64,int64,int64) brfalse FAIL //------------------------------------------------ // -- 1 - 0 ldc.i8 0x0000000000000001 ldc.i8 0x0000000000000000 ldc.i8 0x0000000000000001 call int32 ldc_sub_ovf_u8::u8_6(int64,int64,int64) brfalse FAIL // -- 1 - 1 ldc.i8 0x0000000000000001 ldc.i8 0x0000000000000001 ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_7(int64,int64,int64) brfalse FAIL // -- 1 - (Max - 1) ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_8(int64,int64,int64) brfalse FAIL // -- 1 - Max ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_9(int64,int64,int64) brfalse FAIL // -- 1 - Odd ldc.i8 0x0000000000000001 ldc.i8 0x5555555555555555 ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_10(int64,int64,int64) brfalse FAIL // -- 1 - Even ldc.i8 0x0000000000000001 ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_11(int64,int64,int64) brfalse FAIL //------------------------------------------------ // -- (Max - 1) - 0 ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFE call int32 ldc_sub_ovf_u8::u8_12(int64,int64,int64) brfalse FAIL // -- (Max - 1) - 1 ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFD call int32 ldc_sub_ovf_u8::u8_13(int64,int64,int64) brfalse FAIL // -- (Max - 1) - (Max - 1) ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_14(int64,int64,int64) brfalse FAIL // -- (Max - 1) - Max ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_15(int64,int64,int64) brfalse FAIL // -- (Max - 1) - Odd ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x5555555555555555 ldc.i8 0xAAAAAAAAAAAAAAA9 call int32 ldc_sub_ovf_u8::u8_16(int64,int64,int64) brfalse FAIL // -- (Max - 1) - Even ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x5555555555555554 call int32 ldc_sub_ovf_u8::u8_17(int64,int64,int64) brfalse FAIL //------------------------------------------------ // -- Max - 0 ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x0000000000000000 ldc.i8 0xFFFFFFFFFFFFFFFF call int32 ldc_sub_ovf_u8::u8_18(int64,int64,int64) brfalse FAIL // -- Max - 1 ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x0000000000000001 ldc.i8 0xFFFFFFFFFFFFFFFE call int32 ldc_sub_ovf_u8::u8_19(int64,int64,int64) brfalse FAIL // -- Max - (Max - 1) ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0x0000000000000001 call int32 ldc_sub_ovf_u8::u8_20(int64,int64,int64) brfalse FAIL // -- Max - Max ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_21(int64,int64,int64) brfalse FAIL // -- Max - Odd ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0x5555555555555555 ldc.i8 0xAAAAAAAAAAAAAAAA call int32 ldc_sub_ovf_u8::u8_22(int64,int64,int64) brfalse FAIL // -- Max - Even ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x5555555555555555 call int32 ldc_sub_ovf_u8::u8_23(int64,int64,int64) brfalse FAIL //------------------------------------------------ // -- Odd - 0 ldc.i8 0x5555555555555555 ldc.i8 0x0000000000000000 ldc.i8 0x5555555555555555 call int32 ldc_sub_ovf_u8::u8_24(int64,int64,int64) brfalse FAIL // -- Odd - 1 ldc.i8 0x5555555555555555 ldc.i8 0x0000000000000001 ldc.i8 0x5555555555555554 call int32 ldc_sub_ovf_u8::u8_25(int64,int64,int64) brfalse FAIL // -- Odd - (Max - 1) ldc.i8 0x5555555555555555 ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_26(int64,int64,int64) brfalse FAIL // -- Odd - Max ldc.i8 0x5555555555555555 ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_27(int64,int64,int64) brfalse FAIL // -- Odd - Odd ldc.i8 0x5555555555555555 ldc.i8 0x5555555555555555 ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_28(int64,int64,int64) brfalse FAIL // -- Odd - Even ldc.i8 0x5555555555555555 ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_29(int64,int64,int64) brfalse FAIL //------------------------------------------------ // -- Even - 0 ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x0000000000000000 ldc.i8 0xAAAAAAAAAAAAAAAA call int32 ldc_sub_ovf_u8::u8_30(int64,int64,int64) brfalse FAIL // -- Even - 1 ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x0000000000000001 ldc.i8 0xAAAAAAAAAAAAAAA9 call int32 ldc_sub_ovf_u8::u8_31(int64,int64,int64) brfalse FAIL // -- Even - (Max - 1) ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xFFFFFFFFFFFFFFFE ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_32(int64,int64,int64) brfalse FAIL // -- Even - Max ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xFFFFFFFFFFFFFFFF ldc.i8 0xEEEEEEEEEEEEEEEE call int32 ldc_sub_ovf_u8::u8_33(int64,int64,int64) brfalse FAIL // -- Even - Odd ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x5555555555555555 ldc.i8 0x5555555555555555 call int32 ldc_sub_ovf_u8::u8_34(int64,int64,int64) brfalse FAIL // -- Even - Even ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0xAAAAAAAAAAAAAAAA ldc.i8 0x0000000000000000 call int32 ldc_sub_ovf_u8::u8_35(int64,int64,int64) brfalse FAIL //====== end testing ======== //---- branch here on pass -- PASS: ldc.i4 100 br END //---- branch here on fail -- FAIL: ldc.i4 101 //---- return the result ---- END: ret //---- END OF METHOD -------- } //---- EOF ------------------ } .assembly ldc_sub_ovf_u8{}
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/GC/Scenarios/GCSimulator/GCSimulator_420.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <GCStressIncompatible>true</GCStressIncompatible> <CLRTestExecutionArguments>-t 1 -tp 0 -dz 17 -sdz 17 -dc 20000 -sdc 8000 -lt 4 -f -dp 0.0 -dw 0.4</CLRTestExecutionArguments> <IsGCSimulatorTest>true</IsGCSimulatorTest> <CLRTestProjectToRun>GCSimulator.csproj</CLRTestProjectToRun> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="GCSimulator.cs" /> <Compile Include="lifetimefx.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <GCStressIncompatible>true</GCStressIncompatible> <CLRTestExecutionArguments>-t 1 -tp 0 -dz 17 -sdz 17 -dc 20000 -sdc 8000 -lt 4 -f -dp 0.0 -dw 0.4</CLRTestExecutionArguments> <IsGCSimulatorTest>true</IsGCSimulatorTest> <CLRTestProjectToRun>GCSimulator.csproj</CLRTestProjectToRun> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="GCSimulator.cs" /> <Compile Include="lifetimefx.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/coreclr/pal/src/misc/fmtmessage.cpp
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /*++ Module Name: fmtmessage.c Abstract: Implementation of FormatMessage function. Revision History: --*/ #include "pal/palinternal.h" #include "pal/dbgmsg.h" #include "pal/critsect.h" #include "pal/module.h" #include "pal/misc.h" #include "pal/printfcpp.hpp" #include "errorstrings.h" #include <stdarg.h> #include <dlfcn.h> #include <errno.h> #include <wctype.h> SET_DEFAULT_DEBUG_CHANNEL(MISC); /* Defines */ #define MAX_ERROR_STRING_LENGTH 32 /*++ Function: FMTMSG_GetMessageString Returns the message as a wide string. --*/ static LPWSTR FMTMSG_GetMessageString( DWORD dwErrCode ) { TRACE("Entered FMTMSG_GetMessageString\n"); LPCWSTR lpErrorString = GetPalErrorString(dwErrCode); int allocChars; if (lpErrorString != NULL) { allocChars = PAL_wcslen(lpErrorString) + 1; } else { allocChars = MAX_ERROR_STRING_LENGTH + 1; } LPWSTR lpRetVal = (LPWSTR)PAL_malloc(allocChars * sizeof(WCHAR)); if (lpRetVal) { if (lpErrorString != NULL) { PAL_wcscpy(lpRetVal, lpErrorString); } else { swprintf_s(lpRetVal, MAX_ERROR_STRING_LENGTH, W("Error %u"), dwErrCode); } } else { ERROR("Unable to allocate memory.\n"); } return lpRetVal; } /*++ Function : FMTMSG__watoi Converts a wide string repersentation of an integer number into a interger number. Returns a integer number, or 0 on failure. 0 is not a valid number for FormatMessage inserts. --*/ static INT FMTMSG__watoi( LPWSTR str ) { CONST UINT MAX_NUMBER_LENGTH = 3; CHAR buf[ MAX_NUMBER_LENGTH ]; INT nRetVal = 0; nRetVal = WideCharToMultiByte( CP_ACP, 0, str, -1, buf, MAX_NUMBER_LENGTH, NULL, 0 ); if ( nRetVal != 0 ) { return atoi( buf ); } else { ERROR( "Unable to convert the string to a number.\n" ); return 0; } } /* Adds the character to the working string. */ #define _ADD_TO_STRING( c ) \ {\ TRACE( "Adding %c to the string.\n", (CHAR)c );\ *lpWorkingString = c;\ lpWorkingString++;\ nCount++;\ } /* Grows the buffer. */ #define _GROW_BUFFER() \ {\ if ( bIsLocalAlloced ) \ { \ LPWSTR lpTemp = NULL; \ UINT NumOfBytes = 0; \ nSize *= 2; \ NumOfBytes = nSize * sizeof( WCHAR ); \ lpTemp = static_cast<WCHAR *>( PAL_malloc( NumOfBytes ) ); \ TRACE( "Growing the buffer.\n" );\ \ if ( !lpTemp ) \ { \ ERROR( "Out of buffer\n" ); \ SetLastError( ERROR_NOT_ENOUGH_MEMORY ); \ nCount = 0; \ lpWorkingString = NULL; \ goto exit; \ } \ \ *lpWorkingString = '\0';\ PAL_wcscpy( lpTemp, lpReturnString );\ free( lpReturnString ); \ lpWorkingString = lpReturnString = lpTemp; \ lpWorkingString += nCount; \ } \ else \ { \ WARN( "Out of buffer.\n" ); \ SetLastError( ERROR_INSUFFICIENT_BUFFER ); \ nCount = 0; \ lpWorkingString = NULL; \ goto exit; \ } \ } /* Adds a character to the working string. This is a safer version of _ADD_TO_STRING, as we will resize the buffer if necessary. */ #define _CHECKED_ADD_TO_STRING( c ) \ {\ if ( nCount+1 == nSize ) \ {\ _GROW_BUFFER();\ } \ _ADD_TO_STRING( c );\ } /*++ Function : FMTMSG_ProcessPrintf Processes the printf formatters based on the format. Returns the LPWSTR string, or NULL on failure. */ static LPWSTR FMTMSG_ProcessPrintf( WCHAR c , LPWSTR lpPrintfString, LPWSTR lpInsertString) { LPWSTR lpBuffer = NULL; LPWSTR lpBuffer2 = NULL; LPWSTR lpFormat = NULL; #if _DEBUG // small size for _DEBUG to exercise buffer reallocation logic int tmpSize = 4; #else int tmpSize = 64; #endif UINT nFormatLength = 0; int nBufferLength = 0; TRACE( "FMTMSG_ProcessPrintf( %C, %S, %p )\n", c, lpPrintfString, lpInsertString ); switch ( c ) { case 'e' : /* Fall through */ case 'E' : /* Fall through */ case 'f' : /* Fall through */ case 'g' : /* Fall through */ case 'G' : ERROR( "%%%c is not supported by FormatMessage.\n", c ); SetLastError( ERROR_INVALID_PARAMETER ); return NULL; } nFormatLength = PAL_wcslen( lpPrintfString ) + 2; /* Need to count % AND NULL */ lpFormat = (LPWSTR)PAL_malloc( nFormatLength * sizeof( WCHAR ) ); if ( !lpFormat ) { ERROR( "Unable to allocate memory.\n" ); SetLastError( ERROR_NOT_ENOUGH_MEMORY ); return NULL; } /* Create the format string. */ memset( lpFormat, 0, nFormatLength * sizeof(WCHAR) ); *lpFormat = '%'; PAL_wcscat( lpFormat, lpPrintfString ); lpBuffer = (LPWSTR) PAL_malloc(tmpSize*sizeof(WCHAR)); /* try until the buffer is big enough */ while (TRUE) { if (!lpBuffer) { ERROR("Unable to allocate memory\n"); SetLastError( ERROR_NOT_ENOUGH_MEMORY ); PAL_free(lpFormat); return NULL; } nBufferLength = _snwprintf_s( lpBuffer, tmpSize, tmpSize, lpFormat, lpInsertString); if ((nBufferLength >= 0) && (nBufferLength != tmpSize)) { break; /* succeeded */ } else { tmpSize *= 2; lpBuffer2 = static_cast<WCHAR *>( PAL_realloc(lpBuffer, tmpSize*sizeof(WCHAR))); if (lpBuffer2 == NULL) PAL_free(lpBuffer); lpBuffer = lpBuffer2; } } PAL_free( lpFormat ); lpFormat = NULL; return lpBuffer; } /*++ Function: FormatMessageW See MSDN doc. --*/ DWORD PALAPI FormatMessageW( IN DWORD dwFlags, IN LPCVOID lpSource, IN DWORD dwMessageId, IN DWORD dwLanguageId, OUT LPWSTR lpBuffer, IN DWORD nSize, IN va_list *Arguments) { BOOL bIgnoreInserts = FALSE; BOOL bIsVaList = TRUE; BOOL bIsLocalAlloced = FALSE; LPWSTR lpSourceString = NULL; UINT nCount = 0; LPWSTR lpReturnString = NULL; LPWSTR lpWorkingString = NULL; PERF_ENTRY(FormatMessageW); ENTRY( "FormatMessageW(dwFlags=%#x, lpSource=%p, dwMessageId=%#x, " "dwLanguageId=%#x, lpBuffer=%p, nSize=%u, va_list=%p)\n", dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, Arguments); /* Sanity checks. */ if ( dwFlags & FORMAT_MESSAGE_FROM_STRING && !lpSource ) { /* This behavior is different then in Windows. Windows would just crash.*/ ERROR( "lpSource cannot be NULL.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); goto exit; } if ( !(dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER ) && !lpBuffer ) { /* This behavior is different then in Windows. Windows would just crash.*/ ERROR( "lpBuffer cannot be NULL, if " " FORMAT_MESSAGE_ALLOCATE_BUFFER is not specified.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); goto exit; } if ( ( dwFlags & FORMAT_MESSAGE_FROM_STRING ) && ( dwFlags & FORMAT_MESSAGE_FROM_SYSTEM ) ) { ERROR( "These flags cannot co-exist. You can either " "specify FORMAT_MESSAGE_FROM_STRING, or " "FORMAT_MESSAGE_FROM_SYSTEM.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); goto exit; } if ( !( dwFlags & FORMAT_MESSAGE_FROM_STRING ) && ( dwLanguageId != 0) ) { ERROR( "Invalid language indentifier.\n" ); SetLastError( ERROR_RESOURCE_LANG_NOT_FOUND ); goto exit; } /* Parameter processing. */ if ( dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER ) { TRACE( "Allocated %d TCHARs. Don't forget to call free to " "free the memory when done.\n", nSize ); bIsLocalAlloced = TRUE; } if ( dwFlags & FORMAT_MESSAGE_IGNORE_INSERTS ) { bIgnoreInserts = TRUE; } if ( dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY ) { if ( !Arguments && !bIgnoreInserts ) { ERROR( "The va_list cannot be NULL.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); goto exit; } else { bIsVaList = FALSE; } } if ( dwFlags & FORMAT_MESSAGE_FROM_STRING ) { lpSourceString = (LPWSTR)lpSource; } else if ( dwFlags & FORMAT_MESSAGE_FROM_SYSTEM ) { if ((dwMessageId & 0xFFFF0000) == 0x80070000) { // This message has been produced by HRESULT_FROM_WIN32. Undo its work. dwMessageId &= 0xFFFF; } lpWorkingString = lpReturnString = FMTMSG_GetMessageString( dwMessageId ); if ( !lpWorkingString ) { ERROR( "Unable to find the message %d.\n", dwMessageId ); SetLastError( ERROR_INTERNAL_ERROR ); nCount = 0; goto exit; } nCount = PAL_wcslen( lpWorkingString ); if ( !bIsLocalAlloced && nCount > nSize ) { ERROR( "Insufficient buffer.\n" ); SetLastError( ERROR_INSUFFICIENT_BUFFER ); lpWorkingString = NULL; nCount = 0; goto exit; } if ( !lpWorkingString ) { ERROR( "Invalid error indentifier.\n" ); SetLastError( ERROR_INVALID_ADDRESS ); } goto exit; } else { ERROR( "Unknown flag.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); goto exit; } if ( nSize == 0 && bIsLocalAlloced ) { nSize = 1; } lpWorkingString = static_cast<WCHAR *>( PAL_malloc( nSize * sizeof( WCHAR ) ) ); if ( !lpWorkingString ) { ERROR( "Unable to allocate memory for the working string.\n" ); SetLastError( ERROR_INSUFFICIENT_BUFFER ); goto exit; } /* Process the string. */ lpReturnString = lpWorkingString; while ( *lpSourceString ) { if ( *lpSourceString == '%' && !bIgnoreInserts ) { lpSourceString++; /* Escape sequences. */ if ( *lpSourceString == '0' ) { /* Terminates a message without a newline character. */ *lpWorkingString = '\0'; goto exit; } else if ( iswdigit( *lpSourceString ) ) { /* Get the insert number. */ WCHAR Number[] = { '\0', '\0', '\0' }; SIZE_T Index = 0; Number[ 0 ] = *lpSourceString; lpSourceString++; if ( iswdigit( *lpSourceString ) ) { Number[ 1 ] = *lpSourceString; lpSourceString++; if ( iswdigit( *lpSourceString ) ) { ERROR( "Invalid insert indentifier.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); lpWorkingString = NULL; nCount = 0; goto exit; } } Index = FMTMSG__watoi( Number ); if ( Index == 0 ) { ERROR( "Invalid insert indentifier.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); lpWorkingString = NULL; nCount = 0; goto exit; } if ( *lpSourceString == '!' ) { LPWSTR lpInsertString = NULL; LPWSTR lpPrintfString = NULL; LPWSTR lpStartOfFormattedString = NULL; UINT nPrintfLength = 0; LPWSTR lpFormattedString = NULL; UINT nFormattedLength = 0; if ( !bIsVaList ) { lpInsertString = ((LPWSTR*)Arguments)[ Index - 1 ]; } else { va_list TheArgs; va_copy(TheArgs, *Arguments); UINT i = 0; for ( ; i < Index; i++ ) { lpInsertString = va_arg( TheArgs, LPWSTR ); } } /* Calculate the length, and extract the printf string.*/ lpSourceString++; { LPWSTR p = PAL_wcschr( lpSourceString, '!' ); if ( NULL == p ) { nPrintfLength = 0; } else { nPrintfLength = p - lpSourceString; } } lpPrintfString = (LPWSTR)PAL_malloc( ( nPrintfLength + 1 ) * sizeof( WCHAR ) ); if ( !lpPrintfString ) { ERROR( "Unable to allocate memory.\n" ); SetLastError( ERROR_NOT_ENOUGH_MEMORY ); lpWorkingString = NULL; nCount = 0; goto exit; } PAL_wcsncpy( lpPrintfString, lpSourceString, nPrintfLength ); *( lpPrintfString + nPrintfLength ) = '\0'; lpStartOfFormattedString = lpFormattedString = FMTMSG_ProcessPrintf( *lpPrintfString, lpPrintfString, lpInsertString); if ( !lpFormattedString ) { ERROR( "Unable to process the format string.\n" ); /* Function will set the error code. */ PAL_free( lpPrintfString ); lpWorkingString = NULL; goto exit; } nFormattedLength = PAL_wcslen( lpFormattedString ); /* Append the processed printf string into the working string */ while ( *lpFormattedString ) { _CHECKED_ADD_TO_STRING( *lpFormattedString ); lpFormattedString++; } lpSourceString += nPrintfLength + 1; PAL_free( lpPrintfString ); PAL_free( lpStartOfFormattedString ); lpPrintfString = lpFormattedString = NULL; } else { /* The printf format string defaults to 's'.*/ LPWSTR lpInsert = NULL; if ( !bIsVaList ) { lpInsert = ((LPWSTR*)Arguments)[Index - 1]; } else { va_list TheArgs; va_copy(TheArgs, *Arguments); UINT i = 0; for ( ; i < Index; i++ ) { lpInsert = va_arg( TheArgs, LPWSTR ); } } while ( *lpInsert ) { _CHECKED_ADD_TO_STRING( *lpInsert ); lpInsert++; } } } /* Format specifiers. */ else if ( *lpSourceString == '%' ) { _CHECKED_ADD_TO_STRING( '%' ); lpSourceString++; } else if ( *lpSourceString == 'n' ) { /* Hard line break. */ _CHECKED_ADD_TO_STRING( '\n' ); lpSourceString++; } else if ( *lpSourceString == '.' ) { _CHECKED_ADD_TO_STRING( '.' ); lpSourceString++; } else if ( *lpSourceString == '!' ) { _CHECKED_ADD_TO_STRING( '!' ); lpSourceString++; } else if ( !*lpSourceString ) { ERROR( "Invalid parameter.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); lpWorkingString = NULL; nCount = 0; goto exit; } else /* Append the character. */ { _CHECKED_ADD_TO_STRING( *lpSourceString ); lpSourceString++; } }/* END if ( *lpSourceString == '%' ) */ else { /* In Windows if FormatMessage is called with ignore inserts, then FormatMessage strips %1!s! down to %1, since string is the default. */ if ( bIgnoreInserts && *lpSourceString == '!' && *( lpSourceString + 1 ) == 's' ) { LPWSTR lpLastBang = PAL_wcschr( lpSourceString + 1, '!' ); if ( lpLastBang && ( 2 == lpLastBang - lpSourceString ) ) { lpSourceString = lpLastBang + 1; } else { ERROR( "Mal-formed string\n" ); SetLastError( ERROR_INVALID_PARAMETER ); lpWorkingString = NULL; nCount = 0; goto exit; } } else { /* Append to the string. */ _CHECKED_ADD_TO_STRING( *lpSourceString ); lpSourceString++; } } } /* Terminate the message. */ _CHECKED_ADD_TO_STRING( '\0' ); /* NULL does not count. */ nCount--; exit: /* Function clean-up and exit. */ if ( lpWorkingString ) { if ( bIsLocalAlloced ) { TRACE( "Assigning the buffer to the pointer.\n" ); // when FORMAT_MESSAGE_ALLOCATE_BUFFER is specified, nSize // does not specify the size of lpBuffer, rather it specifies // the minimum size of the string // as such we have to blindly assume that lpBuffer has enough space to // store PVOID // might cause a prefast warning, but there is no good way to suppress it yet _ASSERTE(dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER); *((LPVOID*)lpBuffer) = (LPVOID)lpReturnString; } else /* Only delete lpReturnString if the caller has their own buffer.*/ { TRACE( "Copying the string into the buffer.\n" ); PAL_wcsncpy( lpBuffer, lpReturnString, nCount + 1 ); free( lpReturnString ); } } else /* Error, something occurred. */ { if ( lpReturnString ) { free( lpReturnString ); } } LOGEXIT( "FormatMessageW returns %d.\n", nCount ); PERF_EXIT(FormatMessageW); return nCount; }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /*++ Module Name: fmtmessage.c Abstract: Implementation of FormatMessage function. Revision History: --*/ #include "pal/palinternal.h" #include "pal/dbgmsg.h" #include "pal/critsect.h" #include "pal/module.h" #include "pal/misc.h" #include "pal/printfcpp.hpp" #include "errorstrings.h" #include <stdarg.h> #include <dlfcn.h> #include <errno.h> #include <wctype.h> SET_DEFAULT_DEBUG_CHANNEL(MISC); /* Defines */ #define MAX_ERROR_STRING_LENGTH 32 /*++ Function: FMTMSG_GetMessageString Returns the message as a wide string. --*/ static LPWSTR FMTMSG_GetMessageString( DWORD dwErrCode ) { TRACE("Entered FMTMSG_GetMessageString\n"); LPCWSTR lpErrorString = GetPalErrorString(dwErrCode); int allocChars; if (lpErrorString != NULL) { allocChars = PAL_wcslen(lpErrorString) + 1; } else { allocChars = MAX_ERROR_STRING_LENGTH + 1; } LPWSTR lpRetVal = (LPWSTR)PAL_malloc(allocChars * sizeof(WCHAR)); if (lpRetVal) { if (lpErrorString != NULL) { PAL_wcscpy(lpRetVal, lpErrorString); } else { swprintf_s(lpRetVal, MAX_ERROR_STRING_LENGTH, W("Error %u"), dwErrCode); } } else { ERROR("Unable to allocate memory.\n"); } return lpRetVal; } /*++ Function : FMTMSG__watoi Converts a wide string repersentation of an integer number into a interger number. Returns a integer number, or 0 on failure. 0 is not a valid number for FormatMessage inserts. --*/ static INT FMTMSG__watoi( LPWSTR str ) { CONST UINT MAX_NUMBER_LENGTH = 3; CHAR buf[ MAX_NUMBER_LENGTH ]; INT nRetVal = 0; nRetVal = WideCharToMultiByte( CP_ACP, 0, str, -1, buf, MAX_NUMBER_LENGTH, NULL, 0 ); if ( nRetVal != 0 ) { return atoi( buf ); } else { ERROR( "Unable to convert the string to a number.\n" ); return 0; } } /* Adds the character to the working string. */ #define _ADD_TO_STRING( c ) \ {\ TRACE( "Adding %c to the string.\n", (CHAR)c );\ *lpWorkingString = c;\ lpWorkingString++;\ nCount++;\ } /* Grows the buffer. */ #define _GROW_BUFFER() \ {\ if ( bIsLocalAlloced ) \ { \ LPWSTR lpTemp = NULL; \ UINT NumOfBytes = 0; \ nSize *= 2; \ NumOfBytes = nSize * sizeof( WCHAR ); \ lpTemp = static_cast<WCHAR *>( PAL_malloc( NumOfBytes ) ); \ TRACE( "Growing the buffer.\n" );\ \ if ( !lpTemp ) \ { \ ERROR( "Out of buffer\n" ); \ SetLastError( ERROR_NOT_ENOUGH_MEMORY ); \ nCount = 0; \ lpWorkingString = NULL; \ goto exit; \ } \ \ *lpWorkingString = '\0';\ PAL_wcscpy( lpTemp, lpReturnString );\ free( lpReturnString ); \ lpWorkingString = lpReturnString = lpTemp; \ lpWorkingString += nCount; \ } \ else \ { \ WARN( "Out of buffer.\n" ); \ SetLastError( ERROR_INSUFFICIENT_BUFFER ); \ nCount = 0; \ lpWorkingString = NULL; \ goto exit; \ } \ } /* Adds a character to the working string. This is a safer version of _ADD_TO_STRING, as we will resize the buffer if necessary. */ #define _CHECKED_ADD_TO_STRING( c ) \ {\ if ( nCount+1 == nSize ) \ {\ _GROW_BUFFER();\ } \ _ADD_TO_STRING( c );\ } /*++ Function : FMTMSG_ProcessPrintf Processes the printf formatters based on the format. Returns the LPWSTR string, or NULL on failure. */ static LPWSTR FMTMSG_ProcessPrintf( WCHAR c , LPWSTR lpPrintfString, LPWSTR lpInsertString) { LPWSTR lpBuffer = NULL; LPWSTR lpBuffer2 = NULL; LPWSTR lpFormat = NULL; #if _DEBUG // small size for _DEBUG to exercise buffer reallocation logic int tmpSize = 4; #else int tmpSize = 64; #endif UINT nFormatLength = 0; int nBufferLength = 0; TRACE( "FMTMSG_ProcessPrintf( %C, %S, %p )\n", c, lpPrintfString, lpInsertString ); switch ( c ) { case 'e' : /* Fall through */ case 'E' : /* Fall through */ case 'f' : /* Fall through */ case 'g' : /* Fall through */ case 'G' : ERROR( "%%%c is not supported by FormatMessage.\n", c ); SetLastError( ERROR_INVALID_PARAMETER ); return NULL; } nFormatLength = PAL_wcslen( lpPrintfString ) + 2; /* Need to count % AND NULL */ lpFormat = (LPWSTR)PAL_malloc( nFormatLength * sizeof( WCHAR ) ); if ( !lpFormat ) { ERROR( "Unable to allocate memory.\n" ); SetLastError( ERROR_NOT_ENOUGH_MEMORY ); return NULL; } /* Create the format string. */ memset( lpFormat, 0, nFormatLength * sizeof(WCHAR) ); *lpFormat = '%'; PAL_wcscat( lpFormat, lpPrintfString ); lpBuffer = (LPWSTR) PAL_malloc(tmpSize*sizeof(WCHAR)); /* try until the buffer is big enough */ while (TRUE) { if (!lpBuffer) { ERROR("Unable to allocate memory\n"); SetLastError( ERROR_NOT_ENOUGH_MEMORY ); PAL_free(lpFormat); return NULL; } nBufferLength = _snwprintf_s( lpBuffer, tmpSize, tmpSize, lpFormat, lpInsertString); if ((nBufferLength >= 0) && (nBufferLength != tmpSize)) { break; /* succeeded */ } else { tmpSize *= 2; lpBuffer2 = static_cast<WCHAR *>( PAL_realloc(lpBuffer, tmpSize*sizeof(WCHAR))); if (lpBuffer2 == NULL) PAL_free(lpBuffer); lpBuffer = lpBuffer2; } } PAL_free( lpFormat ); lpFormat = NULL; return lpBuffer; } /*++ Function: FormatMessageW See MSDN doc. --*/ DWORD PALAPI FormatMessageW( IN DWORD dwFlags, IN LPCVOID lpSource, IN DWORD dwMessageId, IN DWORD dwLanguageId, OUT LPWSTR lpBuffer, IN DWORD nSize, IN va_list *Arguments) { BOOL bIgnoreInserts = FALSE; BOOL bIsVaList = TRUE; BOOL bIsLocalAlloced = FALSE; LPWSTR lpSourceString = NULL; UINT nCount = 0; LPWSTR lpReturnString = NULL; LPWSTR lpWorkingString = NULL; PERF_ENTRY(FormatMessageW); ENTRY( "FormatMessageW(dwFlags=%#x, lpSource=%p, dwMessageId=%#x, " "dwLanguageId=%#x, lpBuffer=%p, nSize=%u, va_list=%p)\n", dwFlags, lpSource, dwMessageId, dwLanguageId, lpBuffer, nSize, Arguments); /* Sanity checks. */ if ( dwFlags & FORMAT_MESSAGE_FROM_STRING && !lpSource ) { /* This behavior is different then in Windows. Windows would just crash.*/ ERROR( "lpSource cannot be NULL.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); goto exit; } if ( !(dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER ) && !lpBuffer ) { /* This behavior is different then in Windows. Windows would just crash.*/ ERROR( "lpBuffer cannot be NULL, if " " FORMAT_MESSAGE_ALLOCATE_BUFFER is not specified.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); goto exit; } if ( ( dwFlags & FORMAT_MESSAGE_FROM_STRING ) && ( dwFlags & FORMAT_MESSAGE_FROM_SYSTEM ) ) { ERROR( "These flags cannot co-exist. You can either " "specify FORMAT_MESSAGE_FROM_STRING, or " "FORMAT_MESSAGE_FROM_SYSTEM.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); goto exit; } if ( !( dwFlags & FORMAT_MESSAGE_FROM_STRING ) && ( dwLanguageId != 0) ) { ERROR( "Invalid language indentifier.\n" ); SetLastError( ERROR_RESOURCE_LANG_NOT_FOUND ); goto exit; } /* Parameter processing. */ if ( dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER ) { TRACE( "Allocated %d TCHARs. Don't forget to call free to " "free the memory when done.\n", nSize ); bIsLocalAlloced = TRUE; } if ( dwFlags & FORMAT_MESSAGE_IGNORE_INSERTS ) { bIgnoreInserts = TRUE; } if ( dwFlags & FORMAT_MESSAGE_ARGUMENT_ARRAY ) { if ( !Arguments && !bIgnoreInserts ) { ERROR( "The va_list cannot be NULL.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); goto exit; } else { bIsVaList = FALSE; } } if ( dwFlags & FORMAT_MESSAGE_FROM_STRING ) { lpSourceString = (LPWSTR)lpSource; } else if ( dwFlags & FORMAT_MESSAGE_FROM_SYSTEM ) { if ((dwMessageId & 0xFFFF0000) == 0x80070000) { // This message has been produced by HRESULT_FROM_WIN32. Undo its work. dwMessageId &= 0xFFFF; } lpWorkingString = lpReturnString = FMTMSG_GetMessageString( dwMessageId ); if ( !lpWorkingString ) { ERROR( "Unable to find the message %d.\n", dwMessageId ); SetLastError( ERROR_INTERNAL_ERROR ); nCount = 0; goto exit; } nCount = PAL_wcslen( lpWorkingString ); if ( !bIsLocalAlloced && nCount > nSize ) { ERROR( "Insufficient buffer.\n" ); SetLastError( ERROR_INSUFFICIENT_BUFFER ); lpWorkingString = NULL; nCount = 0; goto exit; } if ( !lpWorkingString ) { ERROR( "Invalid error indentifier.\n" ); SetLastError( ERROR_INVALID_ADDRESS ); } goto exit; } else { ERROR( "Unknown flag.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); goto exit; } if ( nSize == 0 && bIsLocalAlloced ) { nSize = 1; } lpWorkingString = static_cast<WCHAR *>( PAL_malloc( nSize * sizeof( WCHAR ) ) ); if ( !lpWorkingString ) { ERROR( "Unable to allocate memory for the working string.\n" ); SetLastError( ERROR_INSUFFICIENT_BUFFER ); goto exit; } /* Process the string. */ lpReturnString = lpWorkingString; while ( *lpSourceString ) { if ( *lpSourceString == '%' && !bIgnoreInserts ) { lpSourceString++; /* Escape sequences. */ if ( *lpSourceString == '0' ) { /* Terminates a message without a newline character. */ *lpWorkingString = '\0'; goto exit; } else if ( iswdigit( *lpSourceString ) ) { /* Get the insert number. */ WCHAR Number[] = { '\0', '\0', '\0' }; SIZE_T Index = 0; Number[ 0 ] = *lpSourceString; lpSourceString++; if ( iswdigit( *lpSourceString ) ) { Number[ 1 ] = *lpSourceString; lpSourceString++; if ( iswdigit( *lpSourceString ) ) { ERROR( "Invalid insert indentifier.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); lpWorkingString = NULL; nCount = 0; goto exit; } } Index = FMTMSG__watoi( Number ); if ( Index == 0 ) { ERROR( "Invalid insert indentifier.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); lpWorkingString = NULL; nCount = 0; goto exit; } if ( *lpSourceString == '!' ) { LPWSTR lpInsertString = NULL; LPWSTR lpPrintfString = NULL; LPWSTR lpStartOfFormattedString = NULL; UINT nPrintfLength = 0; LPWSTR lpFormattedString = NULL; UINT nFormattedLength = 0; if ( !bIsVaList ) { lpInsertString = ((LPWSTR*)Arguments)[ Index - 1 ]; } else { va_list TheArgs; va_copy(TheArgs, *Arguments); UINT i = 0; for ( ; i < Index; i++ ) { lpInsertString = va_arg( TheArgs, LPWSTR ); } } /* Calculate the length, and extract the printf string.*/ lpSourceString++; { LPWSTR p = PAL_wcschr( lpSourceString, '!' ); if ( NULL == p ) { nPrintfLength = 0; } else { nPrintfLength = p - lpSourceString; } } lpPrintfString = (LPWSTR)PAL_malloc( ( nPrintfLength + 1 ) * sizeof( WCHAR ) ); if ( !lpPrintfString ) { ERROR( "Unable to allocate memory.\n" ); SetLastError( ERROR_NOT_ENOUGH_MEMORY ); lpWorkingString = NULL; nCount = 0; goto exit; } PAL_wcsncpy( lpPrintfString, lpSourceString, nPrintfLength ); *( lpPrintfString + nPrintfLength ) = '\0'; lpStartOfFormattedString = lpFormattedString = FMTMSG_ProcessPrintf( *lpPrintfString, lpPrintfString, lpInsertString); if ( !lpFormattedString ) { ERROR( "Unable to process the format string.\n" ); /* Function will set the error code. */ PAL_free( lpPrintfString ); lpWorkingString = NULL; goto exit; } nFormattedLength = PAL_wcslen( lpFormattedString ); /* Append the processed printf string into the working string */ while ( *lpFormattedString ) { _CHECKED_ADD_TO_STRING( *lpFormattedString ); lpFormattedString++; } lpSourceString += nPrintfLength + 1; PAL_free( lpPrintfString ); PAL_free( lpStartOfFormattedString ); lpPrintfString = lpFormattedString = NULL; } else { /* The printf format string defaults to 's'.*/ LPWSTR lpInsert = NULL; if ( !bIsVaList ) { lpInsert = ((LPWSTR*)Arguments)[Index - 1]; } else { va_list TheArgs; va_copy(TheArgs, *Arguments); UINT i = 0; for ( ; i < Index; i++ ) { lpInsert = va_arg( TheArgs, LPWSTR ); } } while ( *lpInsert ) { _CHECKED_ADD_TO_STRING( *lpInsert ); lpInsert++; } } } /* Format specifiers. */ else if ( *lpSourceString == '%' ) { _CHECKED_ADD_TO_STRING( '%' ); lpSourceString++; } else if ( *lpSourceString == 'n' ) { /* Hard line break. */ _CHECKED_ADD_TO_STRING( '\n' ); lpSourceString++; } else if ( *lpSourceString == '.' ) { _CHECKED_ADD_TO_STRING( '.' ); lpSourceString++; } else if ( *lpSourceString == '!' ) { _CHECKED_ADD_TO_STRING( '!' ); lpSourceString++; } else if ( !*lpSourceString ) { ERROR( "Invalid parameter.\n" ); SetLastError( ERROR_INVALID_PARAMETER ); lpWorkingString = NULL; nCount = 0; goto exit; } else /* Append the character. */ { _CHECKED_ADD_TO_STRING( *lpSourceString ); lpSourceString++; } }/* END if ( *lpSourceString == '%' ) */ else { /* In Windows if FormatMessage is called with ignore inserts, then FormatMessage strips %1!s! down to %1, since string is the default. */ if ( bIgnoreInserts && *lpSourceString == '!' && *( lpSourceString + 1 ) == 's' ) { LPWSTR lpLastBang = PAL_wcschr( lpSourceString + 1, '!' ); if ( lpLastBang && ( 2 == lpLastBang - lpSourceString ) ) { lpSourceString = lpLastBang + 1; } else { ERROR( "Mal-formed string\n" ); SetLastError( ERROR_INVALID_PARAMETER ); lpWorkingString = NULL; nCount = 0; goto exit; } } else { /* Append to the string. */ _CHECKED_ADD_TO_STRING( *lpSourceString ); lpSourceString++; } } } /* Terminate the message. */ _CHECKED_ADD_TO_STRING( '\0' ); /* NULL does not count. */ nCount--; exit: /* Function clean-up and exit. */ if ( lpWorkingString ) { if ( bIsLocalAlloced ) { TRACE( "Assigning the buffer to the pointer.\n" ); // when FORMAT_MESSAGE_ALLOCATE_BUFFER is specified, nSize // does not specify the size of lpBuffer, rather it specifies // the minimum size of the string // as such we have to blindly assume that lpBuffer has enough space to // store PVOID // might cause a prefast warning, but there is no good way to suppress it yet _ASSERTE(dwFlags & FORMAT_MESSAGE_ALLOCATE_BUFFER); *((LPVOID*)lpBuffer) = (LPVOID)lpReturnString; } else /* Only delete lpReturnString if the caller has their own buffer.*/ { TRACE( "Copying the string into the buffer.\n" ); PAL_wcsncpy( lpBuffer, lpReturnString, nCount + 1 ); free( lpReturnString ); } } else /* Error, something occurred. */ { if ( lpReturnString ) { free( lpReturnString ); } } LOGEXIT( "FormatMessageW returns %d.\n", nCount ); PERF_EXIT(FormatMessageW); return nCount; }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/System.Runtime.InteropServices/gen/DllImportGenerator/GeneratorDiagnostics.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using System; using System.Collections.Generic; using System.Diagnostics; namespace Microsoft.Interop { /// <summary> /// Class for reporting diagnostics in the library import generator /// </summary> public class GeneratorDiagnostics : IGeneratorDiagnostics { public class Ids { // SYSLIB1050-SYSLIB1059 are reserved for LibraryImportGenerator public const string Prefix = "SYSLIB"; public const string InvalidLibraryImportAttributeUsage = Prefix + "1050"; public const string TypeNotSupported = Prefix + "1051"; public const string ConfigurationNotSupported = Prefix + "1052"; public const string TargetFrameworkNotSupported = Prefix + "1053"; public const string CannotForwardToDllImport = Prefix + "1054"; } private const string Category = "LibraryImportGenerator"; public static readonly DiagnosticDescriptor InvalidAttributedMethodSignature = new DiagnosticDescriptor( Ids.InvalidLibraryImportAttributeUsage, GetResourceString(nameof(Resources.InvalidLibraryImportAttributeUsageTitle)), GetResourceString(nameof(Resources.InvalidAttributedMethodSignatureMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.InvalidAttributedMethodDescription))); public static readonly DiagnosticDescriptor InvalidAttributedMethodContainingTypeMissingModifiers = new DiagnosticDescriptor( Ids.InvalidLibraryImportAttributeUsage, GetResourceString(nameof(Resources.InvalidLibraryImportAttributeUsageTitle)), GetResourceString(nameof(Resources.InvalidAttributedMethodContainingTypeMissingModifiersMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.InvalidAttributedMethodDescription))); public static readonly DiagnosticDescriptor InvalidStringMarshallingConfiguration = new DiagnosticDescriptor( Ids.InvalidLibraryImportAttributeUsage, GetResourceString(nameof(Resources.InvalidLibraryImportAttributeUsageTitle)), GetResourceString(nameof(Resources.InvalidStringMarshallingConfigurationMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.InvalidStringMarshallingConfigurationDescription))); public static readonly DiagnosticDescriptor ParameterTypeNotSupported = new DiagnosticDescriptor( Ids.TypeNotSupported, GetResourceString(nameof(Resources.TypeNotSupportedTitle)), GetResourceString(nameof(Resources.TypeNotSupportedMessageParameter)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.TypeNotSupportedDescription))); public static readonly DiagnosticDescriptor ReturnTypeNotSupported = new DiagnosticDescriptor( Ids.TypeNotSupported, GetResourceString(nameof(Resources.TypeNotSupportedTitle)), GetResourceString(nameof(Resources.TypeNotSupportedMessageReturn)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.TypeNotSupportedDescription))); public static readonly DiagnosticDescriptor ParameterTypeNotSupportedWithDetails = new DiagnosticDescriptor( Ids.TypeNotSupported, GetResourceString(nameof(Resources.TypeNotSupportedTitle)), GetResourceString(nameof(Resources.TypeNotSupportedMessageParameterWithDetails)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.TypeNotSupportedDescription))); public static readonly DiagnosticDescriptor ReturnTypeNotSupportedWithDetails = new DiagnosticDescriptor( Ids.TypeNotSupported, GetResourceString(nameof(Resources.TypeNotSupportedTitle)), GetResourceString(nameof(Resources.TypeNotSupportedMessageReturnWithDetails)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.TypeNotSupportedDescription))); public static readonly DiagnosticDescriptor ParameterConfigurationNotSupported = new DiagnosticDescriptor( Ids.ConfigurationNotSupported, GetResourceString(nameof(Resources.ConfigurationNotSupportedTitle)), GetResourceString(nameof(Resources.ConfigurationNotSupportedMessageParameter)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.ConfigurationNotSupportedDescription))); public static readonly DiagnosticDescriptor ReturnConfigurationNotSupported = new DiagnosticDescriptor( Ids.ConfigurationNotSupported, GetResourceString(nameof(Resources.ConfigurationNotSupportedTitle)), GetResourceString(nameof(Resources.ConfigurationNotSupportedMessageReturn)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.ConfigurationNotSupportedDescription))); public static readonly DiagnosticDescriptor ConfigurationNotSupported = new DiagnosticDescriptor( Ids.ConfigurationNotSupported, GetResourceString(nameof(Resources.ConfigurationNotSupportedTitle)), GetResourceString(nameof(Resources.ConfigurationNotSupportedMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.ConfigurationNotSupportedDescription))); public static readonly DiagnosticDescriptor ConfigurationValueNotSupported = new DiagnosticDescriptor( Ids.ConfigurationNotSupported, GetResourceString(nameof(Resources.ConfigurationNotSupportedTitle)), GetResourceString(nameof(Resources.ConfigurationNotSupportedMessageValue)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.ConfigurationNotSupportedDescription))); public static readonly DiagnosticDescriptor MarshallingAttributeConfigurationNotSupported = new DiagnosticDescriptor( Ids.ConfigurationNotSupported, GetResourceString(nameof(Resources.ConfigurationNotSupportedTitle)), GetResourceString(nameof(Resources.ConfigurationNotSupportedMessageMarshallingInfo)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.ConfigurationNotSupportedDescription))); public static readonly DiagnosticDescriptor TargetFrameworkNotSupported = new DiagnosticDescriptor( Ids.TargetFrameworkNotSupported, GetResourceString(nameof(Resources.TargetFrameworkNotSupportedTitle)), GetResourceString(nameof(Resources.TargetFrameworkNotSupportedMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.TargetFrameworkNotSupportedDescription))); public static readonly DiagnosticDescriptor CannotForwardToDllImport = new DiagnosticDescriptor( Ids.CannotForwardToDllImport, GetResourceString(nameof(Resources.CannotForwardToDllImportTitle)), GetResourceString(nameof(Resources.CannotForwardToDllImportMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.CannotForwardToDllImportDescription))); private readonly List<Diagnostic> _diagnostics = new List<Diagnostic>(); public IEnumerable<Diagnostic> Diagnostics => _diagnostics; /// <summary> /// Report diagnostic for invalid configuration for string marshalling. /// </summary> /// <param name="attributeData">Attribute specifying the invalid configuration</param> /// <param name="methodName">Name of the method</param> /// <param name="detailsMessage">Specific reason the configuration is invalid</param> public void ReportInvalidStringMarshallingConfiguration( AttributeData attributeData, string methodName, string detailsMessage) { _diagnostics.Add( attributeData.CreateDiagnostic( GeneratorDiagnostics.InvalidStringMarshallingConfiguration, methodName, detailsMessage)); } /// <summary> /// Report diagnostic for configuration that is not supported by the DLL import source generator /// </summary> /// <param name="attributeData">Attribute specifying the unsupported configuration</param> /// <param name="configurationName">Name of the configuration</param> /// <param name="unsupportedValue">[Optiona] Unsupported configuration value</param> public void ReportConfigurationNotSupported( AttributeData attributeData, string configurationName, string? unsupportedValue = null) { if (unsupportedValue == null) { _diagnostics.Add( attributeData.CreateDiagnostic( GeneratorDiagnostics.ConfigurationNotSupported, configurationName)); } else { _diagnostics.Add( attributeData.CreateDiagnostic( GeneratorDiagnostics.ConfigurationValueNotSupported, unsupportedValue, configurationName)); } } /// <summary> /// Report diagnostic for marshalling of a parameter/return that is not supported /// </summary> /// <param name="method">Method with the parameter/return</param> /// <param name="info">Type info for the parameter/return</param> /// <param name="notSupportedDetails">[Optional] Specific reason for lack of support</param> public void ReportMarshallingNotSupported( MethodDeclarationSyntax method, TypePositionInfo info, string? notSupportedDetails) { Location diagnosticLocation = Location.None; string elementName = string.Empty; if (info.IsManagedReturnPosition) { diagnosticLocation = Location.Create(method.SyntaxTree, method.Identifier.Span); elementName = method.Identifier.ValueText; } else { Debug.Assert(info.ManagedIndex <= method.ParameterList.Parameters.Count); ParameterSyntax param = method.ParameterList.Parameters[info.ManagedIndex]; diagnosticLocation = Location.Create(param.SyntaxTree, param.Identifier.Span); elementName = param.Identifier.ValueText; } if (!string.IsNullOrEmpty(notSupportedDetails)) { // Report the specific not-supported reason. if (info.IsManagedReturnPosition) { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ReturnTypeNotSupportedWithDetails, notSupportedDetails!, elementName)); } else { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ParameterTypeNotSupportedWithDetails, notSupportedDetails!, elementName)); } } else if (info.MarshallingAttributeInfo is MarshalAsInfo) { // Report that the specified marshalling configuration is not supported. // We don't forward marshalling attributes, so this is reported differently // than when there is no attribute and the type itself is not supported. if (info.IsManagedReturnPosition) { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ReturnConfigurationNotSupported, nameof(System.Runtime.InteropServices.MarshalAsAttribute), elementName)); } else { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ParameterConfigurationNotSupported, nameof(System.Runtime.InteropServices.MarshalAsAttribute), elementName)); } } else { // Report that the type is not supported if (info.IsManagedReturnPosition) { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ReturnTypeNotSupported, info.ManagedType.DiagnosticFormattedName, elementName)); } else { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ParameterTypeNotSupported, info.ManagedType.DiagnosticFormattedName, elementName)); } } } public void ReportInvalidMarshallingAttributeInfo( AttributeData attributeData, string reasonResourceName, params string[] reasonArgs) { _diagnostics.Add( attributeData.CreateDiagnostic( GeneratorDiagnostics.MarshallingAttributeConfigurationNotSupported, new LocalizableResourceString(reasonResourceName, Resources.ResourceManager, typeof(Resources), reasonArgs))); } /// <summary> /// Report diagnostic for targeting a framework that is not supported /// </summary> /// <param name="minimumSupportedVersion">Minimum supported version of .NET</param> public void ReportTargetFrameworkNotSupported(Version minimumSupportedVersion) { _diagnostics.Add( Diagnostic.Create( TargetFrameworkNotSupported, Location.None, minimumSupportedVersion.ToString(2))); } /// <summary> /// Report diagnostic for configuration that cannot be forwarded to <see cref="DllImportAttribute" /> /// </summary> /// <param name="method">Method with the configuration that cannot be forwarded</param> /// <param name="name">Configuration name</param> /// <param name="value">Configuration value</param> public void ReportCannotForwardToDllImport(MethodDeclarationSyntax method, string name, string? value = null) { _diagnostics.Add( Diagnostic.Create( CannotForwardToDllImport, Location.Create(method.SyntaxTree, method.Identifier.Span), value is null ? name : $"{name}={value}")); } private static LocalizableResourceString GetResourceString(string resourceName) { return new LocalizableResourceString(resourceName, Resources.ResourceManager, typeof(Resources)); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using System; using System.Collections.Generic; using System.Diagnostics; namespace Microsoft.Interop { /// <summary> /// Class for reporting diagnostics in the library import generator /// </summary> public class GeneratorDiagnostics : IGeneratorDiagnostics { public class Ids { // SYSLIB1050-SYSLIB1059 are reserved for LibraryImportGenerator public const string Prefix = "SYSLIB"; public const string InvalidLibraryImportAttributeUsage = Prefix + "1050"; public const string TypeNotSupported = Prefix + "1051"; public const string ConfigurationNotSupported = Prefix + "1052"; public const string TargetFrameworkNotSupported = Prefix + "1053"; public const string CannotForwardToDllImport = Prefix + "1054"; } private const string Category = "LibraryImportGenerator"; public static readonly DiagnosticDescriptor InvalidAttributedMethodSignature = new DiagnosticDescriptor( Ids.InvalidLibraryImportAttributeUsage, GetResourceString(nameof(Resources.InvalidLibraryImportAttributeUsageTitle)), GetResourceString(nameof(Resources.InvalidAttributedMethodSignatureMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.InvalidAttributedMethodDescription))); public static readonly DiagnosticDescriptor InvalidAttributedMethodContainingTypeMissingModifiers = new DiagnosticDescriptor( Ids.InvalidLibraryImportAttributeUsage, GetResourceString(nameof(Resources.InvalidLibraryImportAttributeUsageTitle)), GetResourceString(nameof(Resources.InvalidAttributedMethodContainingTypeMissingModifiersMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.InvalidAttributedMethodDescription))); public static readonly DiagnosticDescriptor InvalidStringMarshallingConfiguration = new DiagnosticDescriptor( Ids.InvalidLibraryImportAttributeUsage, GetResourceString(nameof(Resources.InvalidLibraryImportAttributeUsageTitle)), GetResourceString(nameof(Resources.InvalidStringMarshallingConfigurationMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.InvalidStringMarshallingConfigurationDescription))); public static readonly DiagnosticDescriptor ParameterTypeNotSupported = new DiagnosticDescriptor( Ids.TypeNotSupported, GetResourceString(nameof(Resources.TypeNotSupportedTitle)), GetResourceString(nameof(Resources.TypeNotSupportedMessageParameter)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.TypeNotSupportedDescription))); public static readonly DiagnosticDescriptor ReturnTypeNotSupported = new DiagnosticDescriptor( Ids.TypeNotSupported, GetResourceString(nameof(Resources.TypeNotSupportedTitle)), GetResourceString(nameof(Resources.TypeNotSupportedMessageReturn)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.TypeNotSupportedDescription))); public static readonly DiagnosticDescriptor ParameterTypeNotSupportedWithDetails = new DiagnosticDescriptor( Ids.TypeNotSupported, GetResourceString(nameof(Resources.TypeNotSupportedTitle)), GetResourceString(nameof(Resources.TypeNotSupportedMessageParameterWithDetails)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.TypeNotSupportedDescription))); public static readonly DiagnosticDescriptor ReturnTypeNotSupportedWithDetails = new DiagnosticDescriptor( Ids.TypeNotSupported, GetResourceString(nameof(Resources.TypeNotSupportedTitle)), GetResourceString(nameof(Resources.TypeNotSupportedMessageReturnWithDetails)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.TypeNotSupportedDescription))); public static readonly DiagnosticDescriptor ParameterConfigurationNotSupported = new DiagnosticDescriptor( Ids.ConfigurationNotSupported, GetResourceString(nameof(Resources.ConfigurationNotSupportedTitle)), GetResourceString(nameof(Resources.ConfigurationNotSupportedMessageParameter)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.ConfigurationNotSupportedDescription))); public static readonly DiagnosticDescriptor ReturnConfigurationNotSupported = new DiagnosticDescriptor( Ids.ConfigurationNotSupported, GetResourceString(nameof(Resources.ConfigurationNotSupportedTitle)), GetResourceString(nameof(Resources.ConfigurationNotSupportedMessageReturn)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.ConfigurationNotSupportedDescription))); public static readonly DiagnosticDescriptor ConfigurationNotSupported = new DiagnosticDescriptor( Ids.ConfigurationNotSupported, GetResourceString(nameof(Resources.ConfigurationNotSupportedTitle)), GetResourceString(nameof(Resources.ConfigurationNotSupportedMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.ConfigurationNotSupportedDescription))); public static readonly DiagnosticDescriptor ConfigurationValueNotSupported = new DiagnosticDescriptor( Ids.ConfigurationNotSupported, GetResourceString(nameof(Resources.ConfigurationNotSupportedTitle)), GetResourceString(nameof(Resources.ConfigurationNotSupportedMessageValue)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.ConfigurationNotSupportedDescription))); public static readonly DiagnosticDescriptor MarshallingAttributeConfigurationNotSupported = new DiagnosticDescriptor( Ids.ConfigurationNotSupported, GetResourceString(nameof(Resources.ConfigurationNotSupportedTitle)), GetResourceString(nameof(Resources.ConfigurationNotSupportedMessageMarshallingInfo)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.ConfigurationNotSupportedDescription))); public static readonly DiagnosticDescriptor TargetFrameworkNotSupported = new DiagnosticDescriptor( Ids.TargetFrameworkNotSupported, GetResourceString(nameof(Resources.TargetFrameworkNotSupportedTitle)), GetResourceString(nameof(Resources.TargetFrameworkNotSupportedMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.TargetFrameworkNotSupportedDescription))); public static readonly DiagnosticDescriptor CannotForwardToDllImport = new DiagnosticDescriptor( Ids.CannotForwardToDllImport, GetResourceString(nameof(Resources.CannotForwardToDllImportTitle)), GetResourceString(nameof(Resources.CannotForwardToDllImportMessage)), Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: GetResourceString(nameof(Resources.CannotForwardToDllImportDescription))); private readonly List<Diagnostic> _diagnostics = new List<Diagnostic>(); public IEnumerable<Diagnostic> Diagnostics => _diagnostics; /// <summary> /// Report diagnostic for invalid configuration for string marshalling. /// </summary> /// <param name="attributeData">Attribute specifying the invalid configuration</param> /// <param name="methodName">Name of the method</param> /// <param name="detailsMessage">Specific reason the configuration is invalid</param> public void ReportInvalidStringMarshallingConfiguration( AttributeData attributeData, string methodName, string detailsMessage) { _diagnostics.Add( attributeData.CreateDiagnostic( GeneratorDiagnostics.InvalidStringMarshallingConfiguration, methodName, detailsMessage)); } /// <summary> /// Report diagnostic for configuration that is not supported by the DLL import source generator /// </summary> /// <param name="attributeData">Attribute specifying the unsupported configuration</param> /// <param name="configurationName">Name of the configuration</param> /// <param name="unsupportedValue">[Optiona] Unsupported configuration value</param> public void ReportConfigurationNotSupported( AttributeData attributeData, string configurationName, string? unsupportedValue = null) { if (unsupportedValue == null) { _diagnostics.Add( attributeData.CreateDiagnostic( GeneratorDiagnostics.ConfigurationNotSupported, configurationName)); } else { _diagnostics.Add( attributeData.CreateDiagnostic( GeneratorDiagnostics.ConfigurationValueNotSupported, unsupportedValue, configurationName)); } } /// <summary> /// Report diagnostic for marshalling of a parameter/return that is not supported /// </summary> /// <param name="method">Method with the parameter/return</param> /// <param name="info">Type info for the parameter/return</param> /// <param name="notSupportedDetails">[Optional] Specific reason for lack of support</param> public void ReportMarshallingNotSupported( MethodDeclarationSyntax method, TypePositionInfo info, string? notSupportedDetails) { Location diagnosticLocation = Location.None; string elementName = string.Empty; if (info.IsManagedReturnPosition) { diagnosticLocation = Location.Create(method.SyntaxTree, method.Identifier.Span); elementName = method.Identifier.ValueText; } else { Debug.Assert(info.ManagedIndex <= method.ParameterList.Parameters.Count); ParameterSyntax param = method.ParameterList.Parameters[info.ManagedIndex]; diagnosticLocation = Location.Create(param.SyntaxTree, param.Identifier.Span); elementName = param.Identifier.ValueText; } if (!string.IsNullOrEmpty(notSupportedDetails)) { // Report the specific not-supported reason. if (info.IsManagedReturnPosition) { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ReturnTypeNotSupportedWithDetails, notSupportedDetails!, elementName)); } else { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ParameterTypeNotSupportedWithDetails, notSupportedDetails!, elementName)); } } else if (info.MarshallingAttributeInfo is MarshalAsInfo) { // Report that the specified marshalling configuration is not supported. // We don't forward marshalling attributes, so this is reported differently // than when there is no attribute and the type itself is not supported. if (info.IsManagedReturnPosition) { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ReturnConfigurationNotSupported, nameof(System.Runtime.InteropServices.MarshalAsAttribute), elementName)); } else { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ParameterConfigurationNotSupported, nameof(System.Runtime.InteropServices.MarshalAsAttribute), elementName)); } } else { // Report that the type is not supported if (info.IsManagedReturnPosition) { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ReturnTypeNotSupported, info.ManagedType.DiagnosticFormattedName, elementName)); } else { _diagnostics.Add( diagnosticLocation.CreateDiagnostic( GeneratorDiagnostics.ParameterTypeNotSupported, info.ManagedType.DiagnosticFormattedName, elementName)); } } } public void ReportInvalidMarshallingAttributeInfo( AttributeData attributeData, string reasonResourceName, params string[] reasonArgs) { _diagnostics.Add( attributeData.CreateDiagnostic( GeneratorDiagnostics.MarshallingAttributeConfigurationNotSupported, new LocalizableResourceString(reasonResourceName, Resources.ResourceManager, typeof(Resources), reasonArgs))); } /// <summary> /// Report diagnostic for targeting a framework that is not supported /// </summary> /// <param name="minimumSupportedVersion">Minimum supported version of .NET</param> public void ReportTargetFrameworkNotSupported(Version minimumSupportedVersion) { _diagnostics.Add( Diagnostic.Create( TargetFrameworkNotSupported, Location.None, minimumSupportedVersion.ToString(2))); } /// <summary> /// Report diagnostic for configuration that cannot be forwarded to <see cref="DllImportAttribute" /> /// </summary> /// <param name="method">Method with the configuration that cannot be forwarded</param> /// <param name="name">Configuration name</param> /// <param name="value">Configuration value</param> public void ReportCannotForwardToDllImport(MethodDeclarationSyntax method, string name, string? value = null) { _diagnostics.Add( Diagnostic.Create( CannotForwardToDllImport, Location.Create(method.SyntaxTree, method.Identifier.Span), value is null ? name : $"{name}={value}")); } private static LocalizableResourceString GetResourceString(string resourceName) { return new LocalizableResourceString(resourceName, Resources.ResourceManager, typeof(Resources)); } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/Regression/Dev11/Dev11_468598/Test_HndIndex_10_Reordered.ilproj
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> <Optimize>True</Optimize> </PropertyGroup> <ItemGroup> <Compile Include="Test_HndIndex_10_Reordered.il" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> <Optimize>True</Optimize> </PropertyGroup> <ItemGroup> <Compile Include="Test_HndIndex_10_Reordered.il" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/Directed/Convert/value_numbering_checked_casts_of_constants_double.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.CompilerServices; public partial class ValueNumberingCheckedCastsOfConstants { private static void TestCastingDoubleToSByte() { ConfirmIntegerZeroCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToSByteIsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((sbyte)integerZero) != 0) { Console.WriteLine($"'(sbyte)0.0' was evaluted to '{(sbyte)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToSByteIsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((sbyte)doubleMinusZero) != 0) { Console.WriteLine($"'(sbyte)-0d' was evaluted to '{(sbyte)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToSByteIsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((sbyte)doubleZero) != 0) { Console.WriteLine($"'(sbyte)0d' was evaluted to '{(sbyte)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToSByteOverflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToSByteOverflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToSByteIsFoldedCorrectly() { double sByteMinValue = -128.0; if (BreakUpFlow()) return; if (checked((sbyte)sByteMinValue) != -128) { Console.WriteLine($"'(sbyte)-128.0' was evaluted to '{(sbyte)sByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmSByteMaxValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToSByteIsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((sbyte)sByteMaxValue) != 127) { Console.WriteLine($"'(sbyte)127.0' was evaluted to '{(sbyte)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneDecrementUnderSByteMinValue = -128.00000000000003d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneDecrementUnderSByteMinValue) != -128) { Console.WriteLine($"'(sbyte)-128.00000000000003d' was evaluted to '{(sbyte)doubleOneDecrementUnderSByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToSByteOverflows() { double from = -129d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-129d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneIncrementAboveSByteMinValue = -127.99999999999999d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(sbyte)-127.99999999999999d' was evaluted to '{(sbyte)doubleOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMinValue = -127d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneFullIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(sbyte)-127d' was evaluted to '{(sbyte)doubleOneFullIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(sbyte)126.99999999999999d' was evaluted to '{(sbyte)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(sbyte)126d' was evaluted to '{(sbyte)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToSByteIsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(sbyte)127.00000000000001d' was evaluted to '{(sbyte)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToSByteOverflows() { double from = 128d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)128d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderSByteMinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToSByteOverflows() { double from = -129.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-129.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly() { double integerOneIncrementAboveSByteMinValue = -127.0; if (BreakUpFlow()) return; if (checked((sbyte)integerOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(sbyte)-127.0' was evaluted to '{(sbyte)integerOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((sbyte)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(sbyte)126.0' was evaluted to '{(sbyte)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToSByteOverflows() { double from = 128.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)128.0)' did not throw OverflowException."); } ConfirmByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToSByteOverflows() { double from = 255.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)255.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(sbyte)-5E-324d' was evaluted to '{(sbyte)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMinValue = -1d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneFullDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(sbyte)-1d' was evaluted to '{(sbyte)doubleOneFullDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(sbyte)5E-324d' was evaluted to '{(sbyte)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(sbyte)1d' was evaluted to '{(sbyte)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToSByteOverflows() { double from = 254.99999999999997d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)254.99999999999997d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToSByteOverflows() { double from = 254d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)254d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToSByteOverflows() { double from = 255.00000000000003d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)255.00000000000003d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToSByteOverflows() { double from = 256d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)256d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly() { double integerOneDecrementUnderByteMinValue = -1.0; if (BreakUpFlow()) return; if (checked((sbyte)integerOneDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(sbyte)-1.0' was evaluted to '{(sbyte)integerOneDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((sbyte)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(sbyte)1.0' was evaluted to '{(sbyte)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToSByteOverflows() { double from = 254.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)254.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToSByteOverflows() { double from = 256.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)256.0)' did not throw OverflowException."); } ConfirmInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToSByteOverflows() { double from = -32768.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32768.0)' did not throw OverflowException."); } ConfirmInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToSByteOverflows() { double from = 32767.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32767.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToSByteOverflows() { double from = -32768.00000000001d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32768.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToSByteOverflows() { double from = -32769d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToSByteOverflows() { double from = -32767.999999999996d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32767.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToSByteOverflows() { double from = -32767d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32767d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToSByteOverflows() { double from = 32766.999999999996d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32766.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToSByteOverflows() { double from = 32766d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32766d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToSByteOverflows() { double from = 32767.000000000004d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32767.000000000004d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToSByteOverflows() { double from = 32768d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32768d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToSByteOverflows() { double from = -32769.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToSByteOverflows() { double from = -32767.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32767.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToSByteOverflows() { double from = 32766.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32766.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToSByteOverflows() { double from = 32768.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32768.0)' did not throw OverflowException."); } ConfirmUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToSByteOverflows() { double from = 65535.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65535.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToSByteOverflows() { double from = 65534.99999999999d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65534.99999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToSByteOverflows() { double from = 65534d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65534d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToSByteOverflows() { double from = 65535.00000000001d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65535.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToSByteOverflows() { double from = 65536d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65536d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToSByteOverflows() { double from = 65534.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65534.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToSByteOverflows() { double from = 65536.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65536.0)' did not throw OverflowException."); } ConfirmInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToSByteOverflows() { double from = -2147483648.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToSByteOverflows() { double from = 2147483647.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483647.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToSByteOverflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToSByteOverflows() { double from = -2147483649d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToSByteOverflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToSByteOverflows() { double from = -2147483647d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToSByteOverflows() { double from = 2147483646.9999998d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483646.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToSByteOverflows() { double from = 2147483646d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483646d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToSByteOverflows() { double from = 2147483647.0000002d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483647.0000002d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToSByteOverflows() { double from = 2147483648d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483648d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToSByteOverflows() { double from = -2147483649.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToSByteOverflows() { double from = -2147483647.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToSByteOverflows() { double from = 2147483646.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483646.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToSByteOverflows() { double from = 2147483648.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483648.0)' did not throw OverflowException."); } ConfirmUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToSByteOverflows() { double from = 4294967295.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967295.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToSByteOverflows() { double from = 4294967294.9999995d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967294.9999995d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToSByteOverflows() { double from = 4294967294d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967294d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToSByteOverflows() { double from = 4294967295.0000005d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967295.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToSByteOverflows() { double from = 4294967296d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToSByteOverflows() { double from = 4294967294.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967294.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToSByteOverflows() { double from = 4294967296.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToSByteOverflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToSByteOverflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToSByteOverflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToSByteOverflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToSByteOverflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToSByteOverflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToSByteOverflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToSByteOverflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToSByteOverflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToSByteOverflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToSByteOverflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToSByteOverflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToByte() { ConfirmIntegerZeroCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToByteIsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((byte)integerZero) != 0) { Console.WriteLine($"'(byte)0.0' was evaluted to '{(byte)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToByteIsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((byte)doubleMinusZero) != 0) { Console.WriteLine($"'(byte)-0d' was evaluted to '{(byte)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToByteIsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((byte)doubleZero) != 0) { Console.WriteLine($"'(byte)0d' was evaluted to '{(byte)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToByteOverflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToByteOverflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToByteOverflows() { double from = -128.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-128.0)' did not throw OverflowException."); } ConfirmSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToByteIsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((byte)sByteMaxValue) != 127) { Console.WriteLine($"'(byte)127.0' was evaluted to '{(byte)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToByteOverflows() { double from = -128.00000000000003d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-128.00000000000003d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToByteOverflows() { double from = -129d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-129d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToByteOverflows() { double from = -127.99999999999999d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-127.99999999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToByteOverflows() { double from = -127d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-127d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((byte)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(byte)126.99999999999999d' was evaluted to '{(byte)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((byte)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(byte)126d' was evaluted to '{(byte)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((byte)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(byte)127.00000000000001d' was evaluted to '{(byte)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((byte)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(byte)128d' was evaluted to '{(byte)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToByteOverflows() { double from = -129.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-129.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToByteOverflows() { double from = -127.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-127.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((byte)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(byte)126.0' was evaluted to '{(byte)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((byte)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(byte)128.0' was evaluted to '{(byte)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToByteIsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((byte)byteMaxValue) != 255) { Console.WriteLine($"'(byte)255.0' was evaluted to '{(byte)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToByteIsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((byte)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(byte)-5E-324d' was evaluted to '{(byte)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToByteOverflows() { double from = -1d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-1d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveByteMinValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToByteIsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((byte)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(byte)5E-324d' was evaluted to '{(byte)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToByteIsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((byte)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(byte)1d' was evaluted to '{(byte)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((byte)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(byte)254.99999999999997d' was evaluted to '{(byte)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((byte)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(byte)254d' was evaluted to '{(byte)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((byte)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(byte)255.00000000000003d' was evaluted to '{(byte)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToByteOverflows() { double from = 256d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)256d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToByteOverflows() { double from = -1.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-1.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveByteMinValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToByteIsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((byte)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(byte)1.0' was evaluted to '{(byte)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((byte)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(byte)254.0' was evaluted to '{(byte)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToByteOverflows() { double from = 256.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)256.0)' did not throw OverflowException."); } ConfirmInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToByteOverflows() { double from = -32768.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32768.0)' did not throw OverflowException."); } ConfirmInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToByteOverflows() { double from = 32767.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32767.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToByteOverflows() { double from = -32768.00000000001d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32768.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToByteOverflows() { double from = -32769d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToByteOverflows() { double from = -32767.999999999996d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32767.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToByteOverflows() { double from = -32767d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32767d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToByteOverflows() { double from = 32766.999999999996d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32766.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToByteOverflows() { double from = 32766d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32766d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToByteOverflows() { double from = 32767.000000000004d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32767.000000000004d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToByteOverflows() { double from = 32768d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32768d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToByteOverflows() { double from = -32769.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToByteOverflows() { double from = -32767.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32767.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToByteOverflows() { double from = 32766.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32766.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToByteOverflows() { double from = 32768.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32768.0)' did not throw OverflowException."); } ConfirmUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToByteOverflows() { double from = 65535.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65535.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToByteOverflows() { double from = 65534.99999999999d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65534.99999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToByteOverflows() { double from = 65534d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65534d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToByteOverflows() { double from = 65535.00000000001d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65535.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToByteOverflows() { double from = 65536d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65536d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToByteOverflows() { double from = 65534.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65534.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToByteOverflows() { double from = 65536.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65536.0)' did not throw OverflowException."); } ConfirmInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToByteOverflows() { double from = -2147483648.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToByteOverflows() { double from = 2147483647.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483647.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToByteOverflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToByteOverflows() { double from = -2147483649d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToByteOverflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToByteOverflows() { double from = -2147483647d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToByteOverflows() { double from = 2147483646.9999998d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483646.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToByteOverflows() { double from = 2147483646d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483646d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToByteOverflows() { double from = 2147483647.0000002d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483647.0000002d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToByteOverflows() { double from = 2147483648d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483648d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToByteOverflows() { double from = -2147483649.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToByteOverflows() { double from = -2147483647.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToByteOverflows() { double from = 2147483646.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483646.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToByteOverflows() { double from = 2147483648.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483648.0)' did not throw OverflowException."); } ConfirmUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToByteOverflows() { double from = 4294967295.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967295.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToByteOverflows() { double from = 4294967294.9999995d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967294.9999995d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToByteOverflows() { double from = 4294967294d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967294d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToByteOverflows() { double from = 4294967295.0000005d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967295.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToByteOverflows() { double from = 4294967296d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToByteOverflows() { double from = 4294967294.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967294.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToByteOverflows() { double from = 4294967296.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToByteOverflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToByteOverflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToByteOverflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToByteOverflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToByteOverflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToByteOverflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToByteOverflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToByteOverflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToByteOverflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToByteOverflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToByteOverflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToByteOverflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToInt16() { ConfirmIntegerZeroCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToInt16IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((short)integerZero) != 0) { Console.WriteLine($"'(short)0.0' was evaluted to '{(short)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToInt16IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((short)doubleMinusZero) != 0) { Console.WriteLine($"'(short)-0d' was evaluted to '{(short)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToInt16IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((short)doubleZero) != 0) { Console.WriteLine($"'(short)0d' was evaluted to '{(short)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToInt16Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToInt16Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToInt16IsFoldedCorrectly() { double sByteMinValue = -128.0; if (BreakUpFlow()) return; if (checked((short)sByteMinValue) != -128) { Console.WriteLine($"'(short)-128.0' was evaluted to '{(short)sByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToInt16IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((short)sByteMaxValue) != 127) { Console.WriteLine($"'(short)127.0' was evaluted to '{(short)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMinValue = -128.00000000000003d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderSByteMinValue) != -128) { Console.WriteLine($"'(short)-128.00000000000003d' was evaluted to '{(short)doubleOneDecrementUnderSByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMinValue = -129d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(short)-129d' was evaluted to '{(short)doubleOneFullDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMinValue = -127.99999999999999d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(short)-127.99999999999999d' was evaluted to '{(short)doubleOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMinValue = -127d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(short)-127d' was evaluted to '{(short)doubleOneFullIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(short)126.99999999999999d' was evaluted to '{(short)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(short)126d' was evaluted to '{(short)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(short)127.00000000000001d' was evaluted to '{(short)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(short)128d' was evaluted to '{(short)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly() { double integerOneDecrementUnderSByteMinValue = -129.0; if (BreakUpFlow()) return; if (checked((short)integerOneDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(short)-129.0' was evaluted to '{(short)integerOneDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly() { double integerOneIncrementAboveSByteMinValue = -127.0; if (BreakUpFlow()) return; if (checked((short)integerOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(short)-127.0' was evaluted to '{(short)integerOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((short)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(short)126.0' was evaluted to '{(short)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((short)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(short)128.0' was evaluted to '{(short)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToInt16IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((short)byteMaxValue) != 255) { Console.WriteLine($"'(short)255.0' was evaluted to '{(short)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(short)-5E-324d' was evaluted to '{(short)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMinValue = -1d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(short)-1d' was evaluted to '{(short)doubleOneFullDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(short)5E-324d' was evaluted to '{(short)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(short)1d' was evaluted to '{(short)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(short)254.99999999999997d' was evaluted to '{(short)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(short)254d' was evaluted to '{(short)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(short)255.00000000000003d' was evaluted to '{(short)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(short)256d' was evaluted to '{(short)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly() { double integerOneDecrementUnderByteMinValue = -1.0; if (BreakUpFlow()) return; if (checked((short)integerOneDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(short)-1.0' was evaluted to '{(short)integerOneDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((short)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(short)1.0' was evaluted to '{(short)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((short)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(short)254.0' was evaluted to '{(short)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((short)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(short)256.0' was evaluted to '{(short)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToInt16IsFoldedCorrectly() { double int16MinValue = -32768.0; if (BreakUpFlow()) return; if (checked((short)int16MinValue) != -32768) { Console.WriteLine($"'(short)-32768.0' was evaluted to '{(short)int16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmInt16MaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToInt16IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((short)int16MaxValue) != 32767) { Console.WriteLine($"'(short)32767.0' was evaluted to '{(short)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MinValue = -32768.00000000001d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderInt16MinValue) != -32768) { Console.WriteLine($"'(short)-32768.00000000001d' was evaluted to '{(short)doubleOneDecrementUnderInt16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt16Overflows() { double from = -32769d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MinValue = -32767.999999999996d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(short)-32767.999999999996d' was evaluted to '{(short)doubleOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MinValue = -32767d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(short)-32767d' was evaluted to '{(short)doubleOneFullIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(short)32766.999999999996d' was evaluted to '{(short)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(short)32766d' was evaluted to '{(short)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(short)32767.000000000004d' was evaluted to '{(short)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt16Overflows() { double from = 32768d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)32768d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt16Overflows() { double from = -32769.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly() { double integerOneIncrementAboveInt16MinValue = -32767.0; if (BreakUpFlow()) return; if (checked((short)integerOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(short)-32767.0' was evaluted to '{(short)integerOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((short)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(short)32766.0' was evaluted to '{(short)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt16Overflows() { double from = 32768.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)32768.0)' did not throw OverflowException."); } ConfirmUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToInt16Overflows() { double from = 65535.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65535.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt16Overflows() { double from = 65534.99999999999d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65534.99999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt16Overflows() { double from = 65534d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65534d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt16Overflows() { double from = 65535.00000000001d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65535.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt16Overflows() { double from = 65536d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65536d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt16Overflows() { double from = 65534.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65534.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt16Overflows() { double from = 65536.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65536.0)' did not throw OverflowException."); } ConfirmInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToInt16Overflows() { double from = -2147483648.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToInt16Overflows() { double from = 2147483647.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483647.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt16Overflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt16Overflows() { double from = -2147483649d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt16Overflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt16Overflows() { double from = -2147483647d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt16Overflows() { double from = 2147483646.9999998d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483646.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt16Overflows() { double from = 2147483646d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483646d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt16Overflows() { double from = 2147483647.0000002d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483647.0000002d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt16Overflows() { double from = 2147483648d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483648d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt16Overflows() { double from = -2147483649.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt16Overflows() { double from = -2147483647.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt16Overflows() { double from = 2147483646.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483646.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt16Overflows() { double from = 2147483648.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483648.0)' did not throw OverflowException."); } ConfirmUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToInt16Overflows() { double from = 4294967295.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967295.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt16Overflows() { double from = 4294967294.9999995d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967294.9999995d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt16Overflows() { double from = 4294967294d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967294d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt16Overflows() { double from = 4294967295.0000005d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967295.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt16Overflows() { double from = 4294967296d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt16Overflows() { double from = 4294967294.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967294.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt16Overflows() { double from = 4294967296.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToInt16Overflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToInt16Overflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt16Overflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt16Overflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt16Overflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt16Overflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt16Overflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt16Overflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt16Overflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToInt16Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt16Overflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt16Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToUInt16() { ConfirmIntegerZeroCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToUInt16IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((ushort)integerZero) != 0) { Console.WriteLine($"'(ushort)0.0' was evaluted to '{(ushort)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToUInt16IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((ushort)doubleMinusZero) != 0) { Console.WriteLine($"'(ushort)-0d' was evaluted to '{(ushort)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToUInt16IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((ushort)doubleZero) != 0) { Console.WriteLine($"'(ushort)0d' was evaluted to '{(ushort)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToUInt16Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToUInt16Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToUInt16Overflows() { double from = -128.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-128.0)' did not throw OverflowException."); } ConfirmSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToUInt16IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((ushort)sByteMaxValue) != 127) { Console.WriteLine($"'(ushort)127.0' was evaluted to '{(ushort)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt16Overflows() { double from = -128.00000000000003d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-128.00000000000003d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt16Overflows() { double from = -129d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-129d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt16Overflows() { double from = -127.99999999999999d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-127.99999999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt16Overflows() { double from = -127d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-127d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ushort)126.99999999999999d' was evaluted to '{(ushort)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ushort)126d' was evaluted to '{(ushort)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(ushort)127.00000000000001d' was evaluted to '{(ushort)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(ushort)128d' was evaluted to '{(ushort)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt16Overflows() { double from = -129.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-129.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt16Overflows() { double from = -127.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-127.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ushort)126.0' was evaluted to '{(ushort)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(ushort)128.0' was evaluted to '{(ushort)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToUInt16IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((ushort)byteMaxValue) != 255) { Console.WriteLine($"'(ushort)255.0' was evaluted to '{(ushort)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt16IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(ushort)-5E-324d' was evaluted to '{(ushort)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt16Overflows() { double from = -1d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-1d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(ushort)5E-324d' was evaluted to '{(ushort)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(ushort)1d' was evaluted to '{(ushort)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ushort)254.99999999999997d' was evaluted to '{(ushort)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ushort)254d' was evaluted to '{(ushort)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(ushort)255.00000000000003d' was evaluted to '{(ushort)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(ushort)256d' was evaluted to '{(ushort)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt16Overflows() { double from = -1.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-1.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(ushort)1.0' was evaluted to '{(ushort)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ushort)254.0' was evaluted to '{(ushort)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(ushort)256.0' was evaluted to '{(ushort)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToUInt16Overflows() { double from = -32768.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32768.0)' did not throw OverflowException."); } ConfirmInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToUInt16IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((ushort)int16MaxValue) != 32767) { Console.WriteLine($"'(ushort)32767.0' was evaluted to '{(ushort)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt16Overflows() { double from = -32768.00000000001d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32768.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt16Overflows() { double from = -32769d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt16Overflows() { double from = -32767.999999999996d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32767.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt16Overflows() { double from = -32767d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32767d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ushort)32766.999999999996d' was evaluted to '{(ushort)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ushort)32766d' was evaluted to '{(ushort)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(ushort)32767.000000000004d' was evaluted to '{(ushort)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MaxValue = 32768d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(ushort)32768d' was evaluted to '{(ushort)doubleOneFullIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt16Overflows() { double from = -32769.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt16Overflows() { double from = -32767.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32767.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ushort)32766.0' was evaluted to '{(ushort)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly() { double integerOneIncrementAboveInt16MaxValue = 32768.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(ushort)32768.0' was evaluted to '{(ushort)integerOneIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmUInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToUInt16IsFoldedCorrectly() { double uInt16MaxValue = 65535.0; if (BreakUpFlow()) return; if (checked((ushort)uInt16MaxValue) != 65535) { Console.WriteLine($"'(ushort)65535.0' was evaluted to '{(ushort)uInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneDecrementUnderUInt16MaxValue = 65534.99999999999d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ushort)65534.99999999999d' was evaluted to '{(ushort)doubleOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt16MaxValue = 65534d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ushort)65534d' was evaluted to '{(ushort)doubleOneFullDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneIncrementAboveUInt16MaxValue = 65535.00000000001d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneIncrementAboveUInt16MaxValue) != 65535) { Console.WriteLine($"'(ushort)65535.00000000001d' was evaluted to '{(ushort)doubleOneIncrementAboveUInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt16Overflows() { double from = 65536d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)65536d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly() { double integerOneDecrementUnderUInt16MaxValue = 65534.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ushort)65534.0' was evaluted to '{(ushort)integerOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt16Overflows() { double from = 65536.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)65536.0)' did not throw OverflowException."); } ConfirmInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToUInt16Overflows() { double from = -2147483648.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToUInt16Overflows() { double from = 2147483647.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483647.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt16Overflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt16Overflows() { double from = -2147483649d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt16Overflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt16Overflows() { double from = -2147483647d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt16Overflows() { double from = 2147483646.9999998d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483646.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt16Overflows() { double from = 2147483646d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483646d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt16Overflows() { double from = 2147483647.0000002d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483647.0000002d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt16Overflows() { double from = 2147483648d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483648d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt16Overflows() { double from = -2147483649.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt16Overflows() { double from = -2147483647.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt16Overflows() { double from = 2147483646.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483646.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt16Overflows() { double from = 2147483648.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483648.0)' did not throw OverflowException."); } ConfirmUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToUInt16Overflows() { double from = 4294967295.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967295.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt16Overflows() { double from = 4294967294.9999995d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967294.9999995d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt16Overflows() { double from = 4294967294d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967294d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt16Overflows() { double from = 4294967295.0000005d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967295.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt16Overflows() { double from = 4294967296d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt16Overflows() { double from = 4294967294.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967294.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt16Overflows() { double from = 4294967296.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToUInt16Overflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToUInt16Overflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt16Overflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt16Overflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt16Overflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt16Overflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt16Overflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt16Overflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt16Overflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToUInt16Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt16Overflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt16Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToInt32() { ConfirmIntegerZeroCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToInt32IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((int)integerZero) != 0) { Console.WriteLine($"'(int)0.0' was evaluted to '{(int)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToInt32IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((int)doubleMinusZero) != 0) { Console.WriteLine($"'(int)-0d' was evaluted to '{(int)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToInt32IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((int)doubleZero) != 0) { Console.WriteLine($"'(int)0d' was evaluted to '{(int)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToInt32Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToInt32Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToInt32IsFoldedCorrectly() { double sByteMinValue = -128.0; if (BreakUpFlow()) return; if (checked((int)sByteMinValue) != -128) { Console.WriteLine($"'(int)-128.0' was evaluted to '{(int)sByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToInt32IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((int)sByteMaxValue) != 127) { Console.WriteLine($"'(int)127.0' was evaluted to '{(int)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMinValue = -128.00000000000003d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderSByteMinValue) != -128) { Console.WriteLine($"'(int)-128.00000000000003d' was evaluted to '{(int)doubleOneDecrementUnderSByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMinValue = -129d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(int)-129d' was evaluted to '{(int)doubleOneFullDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMinValue = -127.99999999999999d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(int)-127.99999999999999d' was evaluted to '{(int)doubleOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMinValue = -127d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(int)-127d' was evaluted to '{(int)doubleOneFullIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(int)126.99999999999999d' was evaluted to '{(int)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(int)126d' was evaluted to '{(int)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(int)127.00000000000001d' was evaluted to '{(int)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(int)128d' was evaluted to '{(int)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderSByteMinValue = -129.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(int)-129.0' was evaluted to '{(int)integerOneDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveSByteMinValue = -127.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(int)-127.0' was evaluted to '{(int)integerOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(int)126.0' was evaluted to '{(int)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(int)128.0' was evaluted to '{(int)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToInt32IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((int)byteMaxValue) != 255) { Console.WriteLine($"'(int)255.0' was evaluted to '{(int)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(int)-5E-324d' was evaluted to '{(int)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMinValue = -1d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(int)-1d' was evaluted to '{(int)doubleOneFullDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(int)5E-324d' was evaluted to '{(int)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(int)1d' was evaluted to '{(int)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(int)254.99999999999997d' was evaluted to '{(int)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(int)254d' was evaluted to '{(int)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(int)255.00000000000003d' was evaluted to '{(int)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(int)256d' was evaluted to '{(int)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderByteMinValue = -1.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(int)-1.0' was evaluted to '{(int)integerOneDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(int)1.0' was evaluted to '{(int)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(int)254.0' was evaluted to '{(int)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(int)256.0' was evaluted to '{(int)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToInt32IsFoldedCorrectly() { double int16MinValue = -32768.0; if (BreakUpFlow()) return; if (checked((int)int16MinValue) != -32768) { Console.WriteLine($"'(int)-32768.0' was evaluted to '{(int)int16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToInt32IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((int)int16MaxValue) != 32767) { Console.WriteLine($"'(int)32767.0' was evaluted to '{(int)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MinValue = -32768.00000000001d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderInt16MinValue) != -32768) { Console.WriteLine($"'(int)-32768.00000000001d' was evaluted to '{(int)doubleOneDecrementUnderInt16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MinValue = -32769d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderInt16MinValue) != -32769) { Console.WriteLine($"'(int)-32769d' was evaluted to '{(int)doubleOneFullDecrementUnderInt16MinValue}'. Expected: '-32769'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MinValue = -32767.999999999996d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(int)-32767.999999999996d' was evaluted to '{(int)doubleOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MinValue = -32767d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(int)-32767d' was evaluted to '{(int)doubleOneFullIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(int)32766.999999999996d' was evaluted to '{(int)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(int)32766d' was evaluted to '{(int)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(int)32767.000000000004d' was evaluted to '{(int)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MaxValue = 32768d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(int)32768d' was evaluted to '{(int)doubleOneFullIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderInt16MinValue = -32769.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderInt16MinValue) != -32769) { Console.WriteLine($"'(int)-32769.0' was evaluted to '{(int)integerOneDecrementUnderInt16MinValue}'. Expected: '-32769'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveInt16MinValue = -32767.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(int)-32767.0' was evaluted to '{(int)integerOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(int)32766.0' was evaluted to '{(int)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveInt16MaxValue = 32768.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(int)32768.0' was evaluted to '{(int)integerOneIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToInt32IsFoldedCorrectly() { double uInt16MaxValue = 65535.0; if (BreakUpFlow()) return; if (checked((int)uInt16MaxValue) != 65535) { Console.WriteLine($"'(int)65535.0' was evaluted to '{(int)uInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderUInt16MaxValue = 65534.99999999999d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(int)65534.99999999999d' was evaluted to '{(int)doubleOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt16MaxValue = 65534d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(int)65534d' was evaluted to '{(int)doubleOneFullDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveUInt16MaxValue = 65535.00000000001d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveUInt16MaxValue) != 65535) { Console.WriteLine($"'(int)65535.00000000001d' was evaluted to '{(int)doubleOneIncrementAboveUInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt16MaxValue = 65536d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(int)65536d' was evaluted to '{(int)doubleOneFullIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderUInt16MaxValue = 65534.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(int)65534.0' was evaluted to '{(int)integerOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveUInt16MaxValue = 65536.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(int)65536.0' was evaluted to '{(int)integerOneIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmInt32MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToInt32IsFoldedCorrectly() { double int32MinValue = -2147483648.0; if (BreakUpFlow()) return; if (checked((int)int32MinValue) != -2147483648) { Console.WriteLine($"'(int)-2147483648.0' was evaluted to '{(int)int32MinValue}'. Expected: '-2147483648'."); _counter++; } } ConfirmInt32MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToInt32IsFoldedCorrectly() { double int32MaxValue = 2147483647.0; if (BreakUpFlow()) return; if (checked((int)int32MaxValue) != 2147483647) { Console.WriteLine($"'(int)2147483647.0' was evaluted to '{(int)int32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MinValue = -2147483648.0000005d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderInt32MinValue) != -2147483648) { Console.WriteLine($"'(int)-2147483648.0000005d' was evaluted to '{(int)doubleOneDecrementUnderInt32MinValue}'. Expected: '-2147483648'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt32Overflows() { double from = -2147483649d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MinValue = -2147483647.9999998d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(int)-2147483647.9999998d' was evaluted to '{(int)doubleOneIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt32MinValue = -2147483647d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(int)-2147483647d' was evaluted to '{(int)doubleOneFullIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MaxValue = 2147483646.9999998d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(int)2147483646.9999998d' was evaluted to '{(int)doubleOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt32MaxValue = 2147483646d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(int)2147483646d' was evaluted to '{(int)doubleOneFullDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MaxValue = 2147483647.0000002d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveInt32MaxValue) != 2147483647) { Console.WriteLine($"'(int)2147483647.0000002d' was evaluted to '{(int)doubleOneIncrementAboveInt32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt32Overflows() { double from = 2147483648d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)2147483648d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt32Overflows() { double from = -2147483649.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveInt32MinValue = -2147483647.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(int)-2147483647.0' was evaluted to '{(int)integerOneIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderInt32MaxValue = 2147483646.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(int)2147483646.0' was evaluted to '{(int)integerOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt32Overflows() { double from = 2147483648.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)2147483648.0)' did not throw OverflowException."); } ConfirmUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToInt32Overflows() { double from = 4294967295.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967295.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt32Overflows() { double from = 4294967294.9999995d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967294.9999995d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt32Overflows() { double from = 4294967294d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967294d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt32Overflows() { double from = 4294967295.0000005d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967295.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt32Overflows() { double from = 4294967296d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt32Overflows() { double from = 4294967294.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967294.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt32Overflows() { double from = 4294967296.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToInt32Overflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToInt32Overflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt32Overflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt32Overflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt32Overflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt32Overflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt32Overflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt32Overflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt32Overflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToInt32Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt32Overflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt32Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToUInt32() { ConfirmIntegerZeroCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToUInt32IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((uint)integerZero) != 0) { Console.WriteLine($"'(uint)0.0' was evaluted to '{(uint)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToUInt32IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((uint)doubleMinusZero) != 0) { Console.WriteLine($"'(uint)-0d' was evaluted to '{(uint)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToUInt32IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((uint)doubleZero) != 0) { Console.WriteLine($"'(uint)0d' was evaluted to '{(uint)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToUInt32Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToUInt32Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToUInt32Overflows() { double from = -128.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-128.0)' did not throw OverflowException."); } ConfirmSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToUInt32IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((uint)sByteMaxValue) != 127) { Console.WriteLine($"'(uint)127.0' was evaluted to '{(uint)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt32Overflows() { double from = -128.00000000000003d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-128.00000000000003d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt32Overflows() { double from = -129d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-129d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt32Overflows() { double from = -127.99999999999999d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-127.99999999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt32Overflows() { double from = -127d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-127d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(uint)126.99999999999999d' was evaluted to '{(uint)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(uint)126d' was evaluted to '{(uint)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(uint)127.00000000000001d' was evaluted to '{(uint)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(uint)128d' was evaluted to '{(uint)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt32Overflows() { double from = -129.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-129.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt32Overflows() { double from = -127.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-127.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(uint)126.0' was evaluted to '{(uint)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(uint)128.0' was evaluted to '{(uint)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToUInt32IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((uint)byteMaxValue) != 255) { Console.WriteLine($"'(uint)255.0' was evaluted to '{(uint)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(uint)-5E-324d' was evaluted to '{(uint)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt32Overflows() { double from = -1d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-1d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(uint)5E-324d' was evaluted to '{(uint)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(uint)1d' was evaluted to '{(uint)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(uint)254.99999999999997d' was evaluted to '{(uint)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(uint)254d' was evaluted to '{(uint)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(uint)255.00000000000003d' was evaluted to '{(uint)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(uint)256d' was evaluted to '{(uint)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt32Overflows() { double from = -1.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-1.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(uint)1.0' was evaluted to '{(uint)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(uint)254.0' was evaluted to '{(uint)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(uint)256.0' was evaluted to '{(uint)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToUInt32Overflows() { double from = -32768.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32768.0)' did not throw OverflowException."); } ConfirmInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToUInt32IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((uint)int16MaxValue) != 32767) { Console.WriteLine($"'(uint)32767.0' was evaluted to '{(uint)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt32Overflows() { double from = -32768.00000000001d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32768.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt32Overflows() { double from = -32769d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt32Overflows() { double from = -32767.999999999996d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32767.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt32Overflows() { double from = -32767d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32767d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(uint)32766.999999999996d' was evaluted to '{(uint)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(uint)32766d' was evaluted to '{(uint)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(uint)32767.000000000004d' was evaluted to '{(uint)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MaxValue = 32768d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(uint)32768d' was evaluted to '{(uint)doubleOneFullIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt32Overflows() { double from = -32769.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt32Overflows() { double from = -32767.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32767.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(uint)32766.0' was evaluted to '{(uint)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveInt16MaxValue = 32768.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(uint)32768.0' was evaluted to '{(uint)integerOneIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double uInt16MaxValue = 65535.0; if (BreakUpFlow()) return; if (checked((uint)uInt16MaxValue) != 65535) { Console.WriteLine($"'(uint)65535.0' was evaluted to '{(uint)uInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderUInt16MaxValue = 65534.99999999999d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(uint)65534.99999999999d' was evaluted to '{(uint)doubleOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt16MaxValue = 65534d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(uint)65534d' was evaluted to '{(uint)doubleOneFullDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveUInt16MaxValue = 65535.00000000001d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveUInt16MaxValue) != 65535) { Console.WriteLine($"'(uint)65535.00000000001d' was evaluted to '{(uint)doubleOneIncrementAboveUInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt16MaxValue = 65536d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(uint)65536d' was evaluted to '{(uint)doubleOneFullIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderUInt16MaxValue = 65534.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(uint)65534.0' was evaluted to '{(uint)integerOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveUInt16MaxValue = 65536.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(uint)65536.0' was evaluted to '{(uint)integerOneIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToUInt32Overflows() { double from = -2147483648.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToUInt32IsFoldedCorrectly() { double int32MaxValue = 2147483647.0; if (BreakUpFlow()) return; if (checked((uint)int32MaxValue) != 2147483647) { Console.WriteLine($"'(uint)2147483647.0' was evaluted to '{(uint)int32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt32Overflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt32Overflows() { double from = -2147483649d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt32Overflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt32Overflows() { double from = -2147483647d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MaxValue = 2147483646.9999998d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(uint)2147483646.9999998d' was evaluted to '{(uint)doubleOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt32MaxValue = 2147483646d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(uint)2147483646d' was evaluted to '{(uint)doubleOneFullDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MaxValue = 2147483647.0000002d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveInt32MaxValue) != 2147483647) { Console.WriteLine($"'(uint)2147483647.0000002d' was evaluted to '{(uint)doubleOneIncrementAboveInt32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt32MaxValue = 2147483648d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(uint)2147483648d' was evaluted to '{(uint)doubleOneFullIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt32Overflows() { double from = -2147483649.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt32Overflows() { double from = -2147483647.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderInt32MaxValue = 2147483646.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(uint)2147483646.0' was evaluted to '{(uint)integerOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveInt32MaxValue = 2147483648.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(uint)2147483648.0' was evaluted to '{(uint)integerOneIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmUInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToUInt32IsFoldedCorrectly() { double uInt32MaxValue = 4294967295.0; if (BreakUpFlow()) return; if (checked((uint)uInt32MaxValue) != 4294967295) { Console.WriteLine($"'(uint)4294967295.0' was evaluted to '{(uint)uInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderUInt32MaxValue = 4294967294.9999995d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(uint)4294967294.9999995d' was evaluted to '{(uint)doubleOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt32MaxValue = 4294967294d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(uint)4294967294d' was evaluted to '{(uint)doubleOneFullDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveUInt32MaxValue = 4294967295.0000005d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveUInt32MaxValue) != 4294967295) { Console.WriteLine($"'(uint)4294967295.0000005d' was evaluted to '{(uint)doubleOneIncrementAboveUInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt32Overflows() { double from = 4294967296d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderUInt32MaxValue = 4294967294.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(uint)4294967294.0' was evaluted to '{(uint)integerOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt32Overflows() { double from = 4294967296.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToUInt32Overflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToUInt32Overflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt32Overflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt32Overflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt32Overflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt32Overflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt32Overflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt32Overflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt32Overflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToUInt32Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt32Overflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt32Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToInt64() { ConfirmIntegerZeroCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToInt64IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((long)integerZero) != 0) { Console.WriteLine($"'(long)0.0' was evaluted to '{(long)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToInt64IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((long)doubleMinusZero) != 0) { Console.WriteLine($"'(long)-0d' was evaluted to '{(long)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToInt64IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((long)doubleZero) != 0) { Console.WriteLine($"'(long)0d' was evaluted to '{(long)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToInt64Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToInt64Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToInt64IsFoldedCorrectly() { double sByteMinValue = -128.0; if (BreakUpFlow()) return; if (checked((long)sByteMinValue) != -128) { Console.WriteLine($"'(long)-128.0' was evaluted to '{(long)sByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToInt64IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((long)sByteMaxValue) != 127) { Console.WriteLine($"'(long)127.0' was evaluted to '{(long)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMinValue = -128.00000000000003d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderSByteMinValue) != -128) { Console.WriteLine($"'(long)-128.00000000000003d' was evaluted to '{(long)doubleOneDecrementUnderSByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMinValue = -129d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(long)-129d' was evaluted to '{(long)doubleOneFullDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMinValue = -127.99999999999999d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(long)-127.99999999999999d' was evaluted to '{(long)doubleOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMinValue = -127d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(long)-127d' was evaluted to '{(long)doubleOneFullIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(long)126.99999999999999d' was evaluted to '{(long)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(long)126d' was evaluted to '{(long)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(long)127.00000000000001d' was evaluted to '{(long)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(long)128d' was evaluted to '{(long)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderSByteMinValue = -129.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(long)-129.0' was evaluted to '{(long)integerOneDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveSByteMinValue = -127.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(long)-127.0' was evaluted to '{(long)integerOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(long)126.0' was evaluted to '{(long)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(long)128.0' was evaluted to '{(long)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToInt64IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((long)byteMaxValue) != 255) { Console.WriteLine($"'(long)255.0' was evaluted to '{(long)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(long)-5E-324d' was evaluted to '{(long)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMinValue = -1d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(long)-1d' was evaluted to '{(long)doubleOneFullDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(long)5E-324d' was evaluted to '{(long)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(long)1d' was evaluted to '{(long)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(long)254.99999999999997d' was evaluted to '{(long)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(long)254d' was evaluted to '{(long)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(long)255.00000000000003d' was evaluted to '{(long)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(long)256d' was evaluted to '{(long)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderByteMinValue = -1.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(long)-1.0' was evaluted to '{(long)integerOneDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(long)1.0' was evaluted to '{(long)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(long)254.0' was evaluted to '{(long)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(long)256.0' was evaluted to '{(long)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToInt64IsFoldedCorrectly() { double int16MinValue = -32768.0; if (BreakUpFlow()) return; if (checked((long)int16MinValue) != -32768) { Console.WriteLine($"'(long)-32768.0' was evaluted to '{(long)int16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToInt64IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((long)int16MaxValue) != 32767) { Console.WriteLine($"'(long)32767.0' was evaluted to '{(long)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MinValue = -32768.00000000001d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderInt16MinValue) != -32768) { Console.WriteLine($"'(long)-32768.00000000001d' was evaluted to '{(long)doubleOneDecrementUnderInt16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MinValue = -32769d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderInt16MinValue) != -32769) { Console.WriteLine($"'(long)-32769d' was evaluted to '{(long)doubleOneFullDecrementUnderInt16MinValue}'. Expected: '-32769'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MinValue = -32767.999999999996d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(long)-32767.999999999996d' was evaluted to '{(long)doubleOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MinValue = -32767d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(long)-32767d' was evaluted to '{(long)doubleOneFullIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(long)32766.999999999996d' was evaluted to '{(long)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(long)32766d' was evaluted to '{(long)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(long)32767.000000000004d' was evaluted to '{(long)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MaxValue = 32768d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(long)32768d' was evaluted to '{(long)doubleOneFullIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt16MinValue = -32769.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderInt16MinValue) != -32769) { Console.WriteLine($"'(long)-32769.0' was evaluted to '{(long)integerOneDecrementUnderInt16MinValue}'. Expected: '-32769'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt16MinValue = -32767.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(long)-32767.0' was evaluted to '{(long)integerOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(long)32766.0' was evaluted to '{(long)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt16MaxValue = 32768.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(long)32768.0' was evaluted to '{(long)integerOneIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToInt64IsFoldedCorrectly() { double uInt16MaxValue = 65535.0; if (BreakUpFlow()) return; if (checked((long)uInt16MaxValue) != 65535) { Console.WriteLine($"'(long)65535.0' was evaluted to '{(long)uInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderUInt16MaxValue = 65534.99999999999d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(long)65534.99999999999d' was evaluted to '{(long)doubleOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt16MaxValue = 65534d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(long)65534d' was evaluted to '{(long)doubleOneFullDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveUInt16MaxValue = 65535.00000000001d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveUInt16MaxValue) != 65535) { Console.WriteLine($"'(long)65535.00000000001d' was evaluted to '{(long)doubleOneIncrementAboveUInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt16MaxValue = 65536d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(long)65536d' was evaluted to '{(long)doubleOneFullIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderUInt16MaxValue = 65534.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(long)65534.0' was evaluted to '{(long)integerOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveUInt16MaxValue = 65536.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(long)65536.0' was evaluted to '{(long)integerOneIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToInt64IsFoldedCorrectly() { double int32MinValue = -2147483648.0; if (BreakUpFlow()) return; if (checked((long)int32MinValue) != -2147483648) { Console.WriteLine($"'(long)-2147483648.0' was evaluted to '{(long)int32MinValue}'. Expected: '-2147483648'."); _counter++; } } ConfirmInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToInt64IsFoldedCorrectly() { double int32MaxValue = 2147483647.0; if (BreakUpFlow()) return; if (checked((long)int32MaxValue) != 2147483647) { Console.WriteLine($"'(long)2147483647.0' was evaluted to '{(long)int32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MinValue = -2147483648.0000005d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderInt32MinValue) != -2147483648) { Console.WriteLine($"'(long)-2147483648.0000005d' was evaluted to '{(long)doubleOneDecrementUnderInt32MinValue}'. Expected: '-2147483648'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt32MinValue = -2147483649d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderInt32MinValue) != -2147483649) { Console.WriteLine($"'(long)-2147483649d' was evaluted to '{(long)doubleOneFullDecrementUnderInt32MinValue}'. Expected: '-2147483649'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MinValue = -2147483647.9999998d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(long)-2147483647.9999998d' was evaluted to '{(long)doubleOneIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt32MinValue = -2147483647d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(long)-2147483647d' was evaluted to '{(long)doubleOneFullIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MaxValue = 2147483646.9999998d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(long)2147483646.9999998d' was evaluted to '{(long)doubleOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt32MaxValue = 2147483646d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(long)2147483646d' was evaluted to '{(long)doubleOneFullDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MaxValue = 2147483647.0000002d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveInt32MaxValue) != 2147483647) { Console.WriteLine($"'(long)2147483647.0000002d' was evaluted to '{(long)doubleOneIncrementAboveInt32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt32MaxValue = 2147483648d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(long)2147483648d' was evaluted to '{(long)doubleOneFullIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt32MinValue = -2147483649.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderInt32MinValue) != -2147483649) { Console.WriteLine($"'(long)-2147483649.0' was evaluted to '{(long)integerOneDecrementUnderInt32MinValue}'. Expected: '-2147483649'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt32MinValue = -2147483647.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(long)-2147483647.0' was evaluted to '{(long)integerOneIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt32MaxValue = 2147483646.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(long)2147483646.0' was evaluted to '{(long)integerOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt32MaxValue = 2147483648.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(long)2147483648.0' was evaluted to '{(long)integerOneIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToInt64IsFoldedCorrectly() { double uInt32MaxValue = 4294967295.0; if (BreakUpFlow()) return; if (checked((long)uInt32MaxValue) != 4294967295) { Console.WriteLine($"'(long)4294967295.0' was evaluted to '{(long)uInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderUInt32MaxValue = 4294967294.9999995d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(long)4294967294.9999995d' was evaluted to '{(long)doubleOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt32MaxValue = 4294967294d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(long)4294967294d' was evaluted to '{(long)doubleOneFullDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveUInt32MaxValue = 4294967295.0000005d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveUInt32MaxValue) != 4294967295) { Console.WriteLine($"'(long)4294967295.0000005d' was evaluted to '{(long)doubleOneIncrementAboveUInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt32MaxValue = 4294967296d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveUInt32MaxValue) != 4294967296) { Console.WriteLine($"'(long)4294967296d' was evaluted to '{(long)doubleOneFullIncrementAboveUInt32MaxValue}'. Expected: '4294967296'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderUInt32MaxValue = 4294967294.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(long)4294967294.0' was evaluted to '{(long)integerOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveUInt32MaxValue = 4294967296.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveUInt32MaxValue) != 4294967296) { Console.WriteLine($"'(long)4294967296.0' was evaluted to '{(long)integerOneIncrementAboveUInt32MaxValue}'. Expected: '4294967296'."); _counter++; } } ConfirmInt64MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToInt64IsFoldedCorrectly() { double int64MinValue = -9223372036854775808.0; if (BreakUpFlow()) return; if (checked((long)int64MinValue) != -9223372036854775808) { Console.WriteLine($"'(long)-9223372036854775808.0' was evaluted to '{(long)int64MinValue}'. Expected: '-9223372036854775808'."); _counter++; } } ConfirmInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToInt64Overflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt64MinValue = -9.223372036854775E+18d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveInt64MinValue) != -9223372036854774784) { Console.WriteLine($"'(long)-9.223372036854775E+18d' was evaluted to '{(long)doubleOneIncrementAboveInt64MinValue}'. Expected: '-9223372036854774784'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt64MaxValue = 9.223372036854775E+18d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderInt64MaxValue) != 9223372036854774784) { Console.WriteLine($"'(long)9.223372036854775E+18d' was evaluted to '{(long)doubleOneDecrementUnderInt64MaxValue}'. Expected: '9223372036854774784'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt64Overflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt64Overflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt64MinValue = -9223372036854775807.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveInt64MinValue) != -9223372036854775808) { Console.WriteLine($"'(long)-9223372036854775807.0' was evaluted to '{(long)integerOneIncrementAboveInt64MinValue}'. Expected: '-9223372036854775808'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt64Overflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt64Overflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToInt64Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt64Overflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt64Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToUInt64() { ConfirmIntegerZeroCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToUInt64IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((ulong)integerZero) != 0) { Console.WriteLine($"'(ulong)0.0' was evaluted to '{(ulong)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToUInt64IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((ulong)doubleMinusZero) != 0) { Console.WriteLine($"'(ulong)-0d' was evaluted to '{(ulong)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToUInt64IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((ulong)doubleZero) != 0) { Console.WriteLine($"'(ulong)0d' was evaluted to '{(ulong)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToUInt64Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToUInt64Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToUInt64Overflows() { double from = -128.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-128.0)' did not throw OverflowException."); } ConfirmSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToUInt64IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((ulong)sByteMaxValue) != 127) { Console.WriteLine($"'(ulong)127.0' was evaluted to '{(ulong)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt64Overflows() { double from = -128.00000000000003d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-128.00000000000003d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt64Overflows() { double from = -129d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-129d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt64Overflows() { double from = -127.99999999999999d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-127.99999999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt64Overflows() { double from = -127d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-127d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ulong)126.99999999999999d' was evaluted to '{(ulong)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ulong)126d' was evaluted to '{(ulong)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(ulong)127.00000000000001d' was evaluted to '{(ulong)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(ulong)128d' was evaluted to '{(ulong)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt64Overflows() { double from = -129.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-129.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt64Overflows() { double from = -127.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-127.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ulong)126.0' was evaluted to '{(ulong)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(ulong)128.0' was evaluted to '{(ulong)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToUInt64IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((ulong)byteMaxValue) != 255) { Console.WriteLine($"'(ulong)255.0' was evaluted to '{(ulong)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(ulong)-5E-324d' was evaluted to '{(ulong)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt64Overflows() { double from = -1d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-1d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(ulong)5E-324d' was evaluted to '{(ulong)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(ulong)1d' was evaluted to '{(ulong)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ulong)254.99999999999997d' was evaluted to '{(ulong)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ulong)254d' was evaluted to '{(ulong)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(ulong)255.00000000000003d' was evaluted to '{(ulong)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(ulong)256d' was evaluted to '{(ulong)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt64Overflows() { double from = -1.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-1.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(ulong)1.0' was evaluted to '{(ulong)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ulong)254.0' was evaluted to '{(ulong)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(ulong)256.0' was evaluted to '{(ulong)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToUInt64Overflows() { double from = -32768.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32768.0)' did not throw OverflowException."); } ConfirmInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToUInt64IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((ulong)int16MaxValue) != 32767) { Console.WriteLine($"'(ulong)32767.0' was evaluted to '{(ulong)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt64Overflows() { double from = -32768.00000000001d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32768.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt64Overflows() { double from = -32769d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt64Overflows() { double from = -32767.999999999996d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32767.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt64Overflows() { double from = -32767d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32767d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ulong)32766.999999999996d' was evaluted to '{(ulong)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ulong)32766d' was evaluted to '{(ulong)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(ulong)32767.000000000004d' was evaluted to '{(ulong)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MaxValue = 32768d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(ulong)32768d' was evaluted to '{(ulong)doubleOneFullIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt64Overflows() { double from = -32769.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt64Overflows() { double from = -32767.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32767.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ulong)32766.0' was evaluted to '{(ulong)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt16MaxValue = 32768.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(ulong)32768.0' was evaluted to '{(ulong)integerOneIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double uInt16MaxValue = 65535.0; if (BreakUpFlow()) return; if (checked((ulong)uInt16MaxValue) != 65535) { Console.WriteLine($"'(ulong)65535.0' was evaluted to '{(ulong)uInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderUInt16MaxValue = 65534.99999999999d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ulong)65534.99999999999d' was evaluted to '{(ulong)doubleOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt16MaxValue = 65534d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ulong)65534d' was evaluted to '{(ulong)doubleOneFullDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveUInt16MaxValue = 65535.00000000001d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveUInt16MaxValue) != 65535) { Console.WriteLine($"'(ulong)65535.00000000001d' was evaluted to '{(ulong)doubleOneIncrementAboveUInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt16MaxValue = 65536d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(ulong)65536d' was evaluted to '{(ulong)doubleOneFullIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderUInt16MaxValue = 65534.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ulong)65534.0' was evaluted to '{(ulong)integerOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveUInt16MaxValue = 65536.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(ulong)65536.0' was evaluted to '{(ulong)integerOneIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToUInt64Overflows() { double from = -2147483648.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToUInt64IsFoldedCorrectly() { double int32MaxValue = 2147483647.0; if (BreakUpFlow()) return; if (checked((ulong)int32MaxValue) != 2147483647) { Console.WriteLine($"'(ulong)2147483647.0' was evaluted to '{(ulong)int32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt64Overflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt64Overflows() { double from = -2147483649d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt64Overflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt64Overflows() { double from = -2147483647d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MaxValue = 2147483646.9999998d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(ulong)2147483646.9999998d' was evaluted to '{(ulong)doubleOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt32MaxValue = 2147483646d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(ulong)2147483646d' was evaluted to '{(ulong)doubleOneFullDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MaxValue = 2147483647.0000002d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveInt32MaxValue) != 2147483647) { Console.WriteLine($"'(ulong)2147483647.0000002d' was evaluted to '{(ulong)doubleOneIncrementAboveInt32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt32MaxValue = 2147483648d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(ulong)2147483648d' was evaluted to '{(ulong)doubleOneFullIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt64Overflows() { double from = -2147483649.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt64Overflows() { double from = -2147483647.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt32MaxValue = 2147483646.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(ulong)2147483646.0' was evaluted to '{(ulong)integerOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt32MaxValue = 2147483648.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(ulong)2147483648.0' was evaluted to '{(ulong)integerOneIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double uInt32MaxValue = 4294967295.0; if (BreakUpFlow()) return; if (checked((ulong)uInt32MaxValue) != 4294967295) { Console.WriteLine($"'(ulong)4294967295.0' was evaluted to '{(ulong)uInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderUInt32MaxValue = 4294967294.9999995d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(ulong)4294967294.9999995d' was evaluted to '{(ulong)doubleOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt32MaxValue = 4294967294d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(ulong)4294967294d' was evaluted to '{(ulong)doubleOneFullDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveUInt32MaxValue = 4294967295.0000005d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveUInt32MaxValue) != 4294967295) { Console.WriteLine($"'(ulong)4294967295.0000005d' was evaluted to '{(ulong)doubleOneIncrementAboveUInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt32MaxValue = 4294967296d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveUInt32MaxValue) != 4294967296) { Console.WriteLine($"'(ulong)4294967296d' was evaluted to '{(ulong)doubleOneFullIncrementAboveUInt32MaxValue}'. Expected: '4294967296'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderUInt32MaxValue = 4294967294.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(ulong)4294967294.0' was evaluted to '{(ulong)integerOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveUInt32MaxValue = 4294967296.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveUInt32MaxValue) != 4294967296) { Console.WriteLine($"'(ulong)4294967296.0' was evaluted to '{(ulong)integerOneIncrementAboveUInt32MaxValue}'. Expected: '4294967296'."); _counter++; } } ConfirmInt64MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToUInt64Overflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToUInt64IsFoldedCorrectly() { double int64MaxValue = 9223372036854775807.0; if (BreakUpFlow()) return; if (checked((ulong)int64MaxValue) != 9223372036854775808) { Console.WriteLine($"'(ulong)9223372036854775807.0' was evaluted to '{(ulong)int64MaxValue}'. Expected: '9223372036854775808'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt64Overflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt64MaxValue = 9.223372036854775E+18d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderInt64MaxValue) != 9223372036854774784) { Console.WriteLine($"'(ulong)9.223372036854775E+18d' was evaluted to '{(ulong)doubleOneDecrementUnderInt64MaxValue}'. Expected: '9223372036854774784'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt64MaxValue = 9.223372036854778E+18d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveInt64MaxValue) != 9223372036854777856) { Console.WriteLine($"'(ulong)9.223372036854778E+18d' was evaluted to '{(ulong)doubleOneIncrementAboveInt64MaxValue}'. Expected: '9223372036854777856'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt64MaxValue = 9.223372036854776E+18d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveInt64MaxValue) != 9223372036854775808) { Console.WriteLine($"'(ulong)9.223372036854776E+18d' was evaluted to '{(ulong)doubleOneFullIncrementAboveInt64MaxValue}'. Expected: '9223372036854775808'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt64Overflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt64MaxValue = 9223372036854775806.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderInt64MaxValue) != 9223372036854775808) { Console.WriteLine($"'(ulong)9223372036854775806.0' was evaluted to '{(ulong)integerOneDecrementUnderInt64MaxValue}'. Expected: '9223372036854775808'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt64MaxValue = 9223372036854775808.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveInt64MaxValue) != 9223372036854775808) { Console.WriteLine($"'(ulong)9223372036854775808.0' was evaluted to '{(ulong)integerOneIncrementAboveInt64MaxValue}'. Expected: '9223372036854775808'."); _counter++; } } ConfirmUInt64MaxValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToUInt64Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderUInt64MaxValue = 1.844674407370955E+19d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderUInt64MaxValue) != 18446744073709549568) { Console.WriteLine($"'(ulong)1.844674407370955E+19d' was evaluted to '{(ulong)doubleOneDecrementUnderUInt64MaxValue}'. Expected: '18446744073709549568'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt64Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)18446744073709551614.0)' did not throw OverflowException."); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.CompilerServices; public partial class ValueNumberingCheckedCastsOfConstants { private static void TestCastingDoubleToSByte() { ConfirmIntegerZeroCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToSByteIsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((sbyte)integerZero) != 0) { Console.WriteLine($"'(sbyte)0.0' was evaluted to '{(sbyte)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToSByteIsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((sbyte)doubleMinusZero) != 0) { Console.WriteLine($"'(sbyte)-0d' was evaluted to '{(sbyte)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToSByteIsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((sbyte)doubleZero) != 0) { Console.WriteLine($"'(sbyte)0d' was evaluted to '{(sbyte)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToSByteOverflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToSByteOverflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToSByteIsFoldedCorrectly() { double sByteMinValue = -128.0; if (BreakUpFlow()) return; if (checked((sbyte)sByteMinValue) != -128) { Console.WriteLine($"'(sbyte)-128.0' was evaluted to '{(sbyte)sByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmSByteMaxValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToSByteIsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((sbyte)sByteMaxValue) != 127) { Console.WriteLine($"'(sbyte)127.0' was evaluted to '{(sbyte)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneDecrementUnderSByteMinValue = -128.00000000000003d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneDecrementUnderSByteMinValue) != -128) { Console.WriteLine($"'(sbyte)-128.00000000000003d' was evaluted to '{(sbyte)doubleOneDecrementUnderSByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToSByteOverflows() { double from = -129d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-129d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneIncrementAboveSByteMinValue = -127.99999999999999d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(sbyte)-127.99999999999999d' was evaluted to '{(sbyte)doubleOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMinValue = -127d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneFullIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(sbyte)-127d' was evaluted to '{(sbyte)doubleOneFullIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(sbyte)126.99999999999999d' was evaluted to '{(sbyte)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(sbyte)126d' was evaluted to '{(sbyte)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToSByteIsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(sbyte)127.00000000000001d' was evaluted to '{(sbyte)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToSByteOverflows() { double from = 128d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)128d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderSByteMinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToSByteOverflows() { double from = -129.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-129.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToSByteIsFoldedCorrectly() { double integerOneIncrementAboveSByteMinValue = -127.0; if (BreakUpFlow()) return; if (checked((sbyte)integerOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(sbyte)-127.0' was evaluted to '{(sbyte)integerOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToSByteIsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((sbyte)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(sbyte)126.0' was evaluted to '{(sbyte)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToSByteOverflows() { double from = 128.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)128.0)' did not throw OverflowException."); } ConfirmByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToSByteOverflows() { double from = 255.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)255.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(sbyte)-5E-324d' was evaluted to '{(sbyte)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMinValue = -1d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneFullDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(sbyte)-1d' was evaluted to '{(sbyte)doubleOneFullDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(sbyte)5E-324d' was evaluted to '{(sbyte)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((sbyte)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(sbyte)1d' was evaluted to '{(sbyte)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToSByteOverflows() { double from = 254.99999999999997d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)254.99999999999997d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToSByteOverflows() { double from = 254d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)254d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToSByteOverflows() { double from = 255.00000000000003d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)255.00000000000003d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToSByteOverflows() { double from = 256d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)256d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToSByteIsFoldedCorrectly() { double integerOneDecrementUnderByteMinValue = -1.0; if (BreakUpFlow()) return; if (checked((sbyte)integerOneDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(sbyte)-1.0' was evaluted to '{(sbyte)integerOneDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToSByteIsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((sbyte)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(sbyte)1.0' was evaluted to '{(sbyte)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToSByteOverflows() { double from = 254.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)254.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveByteMaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToSByteOverflows() { double from = 256.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)256.0)' did not throw OverflowException."); } ConfirmInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToSByteOverflows() { double from = -32768.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32768.0)' did not throw OverflowException."); } ConfirmInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToSByteOverflows() { double from = 32767.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32767.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToSByteOverflows() { double from = -32768.00000000001d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32768.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToSByteOverflows() { double from = -32769d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToSByteOverflows() { double from = -32767.999999999996d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32767.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToSByteOverflows() { double from = -32767d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32767d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToSByteOverflows() { double from = 32766.999999999996d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32766.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToSByteOverflows() { double from = 32766d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32766d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToSByteOverflows() { double from = 32767.000000000004d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32767.000000000004d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToSByteOverflows() { double from = 32768d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32768d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToSByteOverflows() { double from = -32769.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToSByteOverflows() { double from = -32767.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-32767.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToSByteOverflows() { double from = 32766.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32766.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToSByteOverflows() { double from = 32768.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)32768.0)' did not throw OverflowException."); } ConfirmUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToSByteOverflows() { double from = 65535.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65535.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToSByteOverflows() { double from = 65534.99999999999d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65534.99999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToSByteOverflows() { double from = 65534d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65534d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToSByteOverflows() { double from = 65535.00000000001d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65535.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToSByteOverflows() { double from = 65536d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65536d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToSByteOverflows() { double from = 65534.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65534.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToSByteOverflows() { double from = 65536.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)65536.0)' did not throw OverflowException."); } ConfirmInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToSByteOverflows() { double from = -2147483648.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToSByteOverflows() { double from = 2147483647.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483647.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToSByteOverflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToSByteOverflows() { double from = -2147483649d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToSByteOverflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToSByteOverflows() { double from = -2147483647d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToSByteOverflows() { double from = 2147483646.9999998d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483646.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToSByteOverflows() { double from = 2147483646d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483646d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToSByteOverflows() { double from = 2147483647.0000002d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483647.0000002d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToSByteOverflows() { double from = 2147483648d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483648d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToSByteOverflows() { double from = -2147483649.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToSByteOverflows() { double from = -2147483647.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToSByteOverflows() { double from = 2147483646.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483646.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToSByteOverflows() { double from = 2147483648.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)2147483648.0)' did not throw OverflowException."); } ConfirmUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToSByteOverflows() { double from = 4294967295.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967295.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToSByteOverflows() { double from = 4294967294.9999995d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967294.9999995d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToSByteOverflows() { double from = 4294967294d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967294d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToSByteOverflows() { double from = 4294967295.0000005d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967295.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToSByteOverflows() { double from = 4294967296d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToSByteOverflows() { double from = 4294967294.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967294.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToSByteOverflows() { double from = 4294967296.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToSByteOverflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToSByteOverflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToSByteOverflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToSByteOverflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToSByteOverflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToSByteOverflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToSByteOverflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToSByteOverflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToSByteOverflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToSByteOverflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToSByteOverflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToSByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToSByteOverflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((sbyte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((sbyte)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToByte() { ConfirmIntegerZeroCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToByteIsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((byte)integerZero) != 0) { Console.WriteLine($"'(byte)0.0' was evaluted to '{(byte)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToByteIsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((byte)doubleMinusZero) != 0) { Console.WriteLine($"'(byte)-0d' was evaluted to '{(byte)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToByteIsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((byte)doubleZero) != 0) { Console.WriteLine($"'(byte)0d' was evaluted to '{(byte)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToByteOverflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToByteOverflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToByteOverflows() { double from = -128.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-128.0)' did not throw OverflowException."); } ConfirmSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToByteIsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((byte)sByteMaxValue) != 127) { Console.WriteLine($"'(byte)127.0' was evaluted to '{(byte)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToByteOverflows() { double from = -128.00000000000003d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-128.00000000000003d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToByteOverflows() { double from = -129d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-129d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToByteOverflows() { double from = -127.99999999999999d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-127.99999999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToByteOverflows() { double from = -127d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-127d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((byte)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(byte)126.99999999999999d' was evaluted to '{(byte)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((byte)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(byte)126d' was evaluted to '{(byte)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((byte)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(byte)127.00000000000001d' was evaluted to '{(byte)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((byte)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(byte)128d' was evaluted to '{(byte)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToByteOverflows() { double from = -129.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-129.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveSByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToByteOverflows() { double from = -127.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-127.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToByteIsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((byte)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(byte)126.0' was evaluted to '{(byte)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToByteIsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((byte)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(byte)128.0' was evaluted to '{(byte)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToByteIsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((byte)byteMaxValue) != 255) { Console.WriteLine($"'(byte)255.0' was evaluted to '{(byte)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToByteIsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((byte)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(byte)-5E-324d' was evaluted to '{(byte)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToByteOverflows() { double from = -1d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-1d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveByteMinValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToByteIsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((byte)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(byte)5E-324d' was evaluted to '{(byte)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToByteIsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((byte)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(byte)1d' was evaluted to '{(byte)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((byte)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(byte)254.99999999999997d' was evaluted to '{(byte)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((byte)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(byte)254d' was evaluted to '{(byte)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToByteIsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((byte)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(byte)255.00000000000003d' was evaluted to '{(byte)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToByteOverflows() { double from = 256d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)256d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderByteMinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToByteOverflows() { double from = -1.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-1.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveByteMinValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToByteIsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((byte)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(byte)1.0' was evaluted to '{(byte)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToByteIsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((byte)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(byte)254.0' was evaluted to '{(byte)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToByteOverflows() { double from = 256.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)256.0)' did not throw OverflowException."); } ConfirmInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToByteOverflows() { double from = -32768.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32768.0)' did not throw OverflowException."); } ConfirmInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToByteOverflows() { double from = 32767.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32767.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToByteOverflows() { double from = -32768.00000000001d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32768.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToByteOverflows() { double from = -32769d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToByteOverflows() { double from = -32767.999999999996d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32767.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToByteOverflows() { double from = -32767d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32767d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToByteOverflows() { double from = 32766.999999999996d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32766.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToByteOverflows() { double from = 32766d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32766d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToByteOverflows() { double from = 32767.000000000004d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32767.000000000004d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToByteOverflows() { double from = 32768d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32768d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToByteOverflows() { double from = -32769.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToByteOverflows() { double from = -32767.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-32767.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToByteOverflows() { double from = 32766.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32766.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToByteOverflows() { double from = 32768.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)32768.0)' did not throw OverflowException."); } ConfirmUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToByteOverflows() { double from = 65535.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65535.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToByteOverflows() { double from = 65534.99999999999d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65534.99999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToByteOverflows() { double from = 65534d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65534d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToByteOverflows() { double from = 65535.00000000001d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65535.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToByteOverflows() { double from = 65536d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65536d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToByteOverflows() { double from = 65534.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65534.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToByteOverflows() { double from = 65536.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)65536.0)' did not throw OverflowException."); } ConfirmInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToByteOverflows() { double from = -2147483648.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToByteOverflows() { double from = 2147483647.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483647.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToByteOverflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToByteOverflows() { double from = -2147483649d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToByteOverflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToByteOverflows() { double from = -2147483647d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToByteOverflows() { double from = 2147483646.9999998d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483646.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToByteOverflows() { double from = 2147483646d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483646d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToByteOverflows() { double from = 2147483647.0000002d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483647.0000002d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToByteOverflows() { double from = 2147483648d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483648d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToByteOverflows() { double from = -2147483649.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToByteOverflows() { double from = -2147483647.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToByteOverflows() { double from = 2147483646.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483646.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToByteOverflows() { double from = 2147483648.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)2147483648.0)' did not throw OverflowException."); } ConfirmUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToByteOverflows() { double from = 4294967295.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967295.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToByteOverflows() { double from = 4294967294.9999995d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967294.9999995d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToByteOverflows() { double from = 4294967294d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967294d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToByteOverflows() { double from = 4294967295.0000005d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967295.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToByteOverflows() { double from = 4294967296d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToByteOverflows() { double from = 4294967294.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967294.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToByteOverflows() { double from = 4294967296.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToByteOverflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToByteOverflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToByteOverflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToByteOverflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToByteOverflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToByteOverflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToByteOverflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToByteOverflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToByteOverflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToByteOverflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToByteOverflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToByteOverflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToByteOverflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((byte)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((byte)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToInt16() { ConfirmIntegerZeroCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToInt16IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((short)integerZero) != 0) { Console.WriteLine($"'(short)0.0' was evaluted to '{(short)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToInt16IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((short)doubleMinusZero) != 0) { Console.WriteLine($"'(short)-0d' was evaluted to '{(short)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToInt16IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((short)doubleZero) != 0) { Console.WriteLine($"'(short)0d' was evaluted to '{(short)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToInt16Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToInt16Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToInt16IsFoldedCorrectly() { double sByteMinValue = -128.0; if (BreakUpFlow()) return; if (checked((short)sByteMinValue) != -128) { Console.WriteLine($"'(short)-128.0' was evaluted to '{(short)sByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToInt16IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((short)sByteMaxValue) != 127) { Console.WriteLine($"'(short)127.0' was evaluted to '{(short)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMinValue = -128.00000000000003d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderSByteMinValue) != -128) { Console.WriteLine($"'(short)-128.00000000000003d' was evaluted to '{(short)doubleOneDecrementUnderSByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMinValue = -129d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(short)-129d' was evaluted to '{(short)doubleOneFullDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMinValue = -127.99999999999999d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(short)-127.99999999999999d' was evaluted to '{(short)doubleOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMinValue = -127d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(short)-127d' was evaluted to '{(short)doubleOneFullIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(short)126.99999999999999d' was evaluted to '{(short)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(short)126d' was evaluted to '{(short)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(short)127.00000000000001d' was evaluted to '{(short)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(short)128d' was evaluted to '{(short)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt16IsFoldedCorrectly() { double integerOneDecrementUnderSByteMinValue = -129.0; if (BreakUpFlow()) return; if (checked((short)integerOneDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(short)-129.0' was evaluted to '{(short)integerOneDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt16IsFoldedCorrectly() { double integerOneIncrementAboveSByteMinValue = -127.0; if (BreakUpFlow()) return; if (checked((short)integerOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(short)-127.0' was evaluted to '{(short)integerOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt16IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((short)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(short)126.0' was evaluted to '{(short)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt16IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((short)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(short)128.0' was evaluted to '{(short)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToInt16IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((short)byteMaxValue) != 255) { Console.WriteLine($"'(short)255.0' was evaluted to '{(short)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(short)-5E-324d' was evaluted to '{(short)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMinValue = -1d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(short)-1d' was evaluted to '{(short)doubleOneFullDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(short)5E-324d' was evaluted to '{(short)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(short)1d' was evaluted to '{(short)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(short)254.99999999999997d' was evaluted to '{(short)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(short)254d' was evaluted to '{(short)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(short)255.00000000000003d' was evaluted to '{(short)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(short)256d' was evaluted to '{(short)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToInt16IsFoldedCorrectly() { double integerOneDecrementUnderByteMinValue = -1.0; if (BreakUpFlow()) return; if (checked((short)integerOneDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(short)-1.0' was evaluted to '{(short)integerOneDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToInt16IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((short)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(short)1.0' was evaluted to '{(short)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt16IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((short)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(short)254.0' was evaluted to '{(short)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt16IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((short)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(short)256.0' was evaluted to '{(short)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToInt16IsFoldedCorrectly() { double int16MinValue = -32768.0; if (BreakUpFlow()) return; if (checked((short)int16MinValue) != -32768) { Console.WriteLine($"'(short)-32768.0' was evaluted to '{(short)int16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmInt16MaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToInt16IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((short)int16MaxValue) != 32767) { Console.WriteLine($"'(short)32767.0' was evaluted to '{(short)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MinValue = -32768.00000000001d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderInt16MinValue) != -32768) { Console.WriteLine($"'(short)-32768.00000000001d' was evaluted to '{(short)doubleOneDecrementUnderInt16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt16Overflows() { double from = -32769d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MinValue = -32767.999999999996d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(short)-32767.999999999996d' was evaluted to '{(short)doubleOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MinValue = -32767d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(short)-32767d' was evaluted to '{(short)doubleOneFullIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((short)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(short)32766.999999999996d' was evaluted to '{(short)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((short)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(short)32766d' was evaluted to '{(short)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt16IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((short)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(short)32767.000000000004d' was evaluted to '{(short)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt16Overflows() { double from = 32768d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)32768d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt16Overflows() { double from = -32769.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt16IsFoldedCorrectly() { double integerOneIncrementAboveInt16MinValue = -32767.0; if (BreakUpFlow()) return; if (checked((short)integerOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(short)-32767.0' was evaluted to '{(short)integerOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt16IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((short)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(short)32766.0' was evaluted to '{(short)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt16Overflows() { double from = 32768.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)32768.0)' did not throw OverflowException."); } ConfirmUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToInt16Overflows() { double from = 65535.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65535.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt16Overflows() { double from = 65534.99999999999d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65534.99999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt16Overflows() { double from = 65534d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65534d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt16Overflows() { double from = 65535.00000000001d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65535.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt16Overflows() { double from = 65536d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65536d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt16Overflows() { double from = 65534.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65534.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt16Overflows() { double from = 65536.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)65536.0)' did not throw OverflowException."); } ConfirmInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToInt16Overflows() { double from = -2147483648.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToInt16Overflows() { double from = 2147483647.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483647.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt16Overflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt16Overflows() { double from = -2147483649d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt16Overflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt16Overflows() { double from = -2147483647d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt16Overflows() { double from = 2147483646.9999998d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483646.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt16Overflows() { double from = 2147483646d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483646d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt16Overflows() { double from = 2147483647.0000002d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483647.0000002d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt16Overflows() { double from = 2147483648d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483648d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt16Overflows() { double from = -2147483649.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt16Overflows() { double from = -2147483647.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt16Overflows() { double from = 2147483646.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483646.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt16Overflows() { double from = 2147483648.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)2147483648.0)' did not throw OverflowException."); } ConfirmUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToInt16Overflows() { double from = 4294967295.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967295.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt16Overflows() { double from = 4294967294.9999995d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967294.9999995d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt16Overflows() { double from = 4294967294d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967294d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt16Overflows() { double from = 4294967295.0000005d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967295.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt16Overflows() { double from = 4294967296d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt16Overflows() { double from = 4294967294.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967294.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt16Overflows() { double from = 4294967296.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToInt16Overflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToInt16Overflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt16Overflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt16Overflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt16Overflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt16Overflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt16Overflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt16Overflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt16Overflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToInt16Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt16Overflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt16Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((short)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((short)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToUInt16() { ConfirmIntegerZeroCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToUInt16IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((ushort)integerZero) != 0) { Console.WriteLine($"'(ushort)0.0' was evaluted to '{(ushort)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToUInt16IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((ushort)doubleMinusZero) != 0) { Console.WriteLine($"'(ushort)-0d' was evaluted to '{(ushort)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToUInt16IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((ushort)doubleZero) != 0) { Console.WriteLine($"'(ushort)0d' was evaluted to '{(ushort)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToUInt16Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToUInt16Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToUInt16Overflows() { double from = -128.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-128.0)' did not throw OverflowException."); } ConfirmSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToUInt16IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((ushort)sByteMaxValue) != 127) { Console.WriteLine($"'(ushort)127.0' was evaluted to '{(ushort)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt16Overflows() { double from = -128.00000000000003d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-128.00000000000003d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt16Overflows() { double from = -129d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-129d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt16Overflows() { double from = -127.99999999999999d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-127.99999999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt16Overflows() { double from = -127d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-127d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ushort)126.99999999999999d' was evaluted to '{(ushort)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ushort)126d' was evaluted to '{(ushort)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(ushort)127.00000000000001d' was evaluted to '{(ushort)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(ushort)128d' was evaluted to '{(ushort)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt16Overflows() { double from = -129.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-129.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt16Overflows() { double from = -127.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-127.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt16IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ushort)126.0' was evaluted to '{(ushort)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt16IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(ushort)128.0' was evaluted to '{(ushort)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToUInt16IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((ushort)byteMaxValue) != 255) { Console.WriteLine($"'(ushort)255.0' was evaluted to '{(ushort)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt16IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(ushort)-5E-324d' was evaluted to '{(ushort)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt16Overflows() { double from = -1d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-1d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(ushort)5E-324d' was evaluted to '{(ushort)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(ushort)1d' was evaluted to '{(ushort)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ushort)254.99999999999997d' was evaluted to '{(ushort)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ushort)254d' was evaluted to '{(ushort)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(ushort)255.00000000000003d' was evaluted to '{(ushort)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(ushort)256d' was evaluted to '{(ushort)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt16Overflows() { double from = -1.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-1.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt16IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(ushort)1.0' was evaluted to '{(ushort)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt16IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ushort)254.0' was evaluted to '{(ushort)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt16IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(ushort)256.0' was evaluted to '{(ushort)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToUInt16Overflows() { double from = -32768.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32768.0)' did not throw OverflowException."); } ConfirmInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToUInt16IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((ushort)int16MaxValue) != 32767) { Console.WriteLine($"'(ushort)32767.0' was evaluted to '{(ushort)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt16Overflows() { double from = -32768.00000000001d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32768.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt16Overflows() { double from = -32769d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt16Overflows() { double from = -32767.999999999996d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32767.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt16Overflows() { double from = -32767d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32767d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ushort)32766.999999999996d' was evaluted to '{(ushort)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ushort)32766d' was evaluted to '{(ushort)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(ushort)32767.000000000004d' was evaluted to '{(ushort)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MaxValue = 32768d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(ushort)32768d' was evaluted to '{(ushort)doubleOneFullIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt16Overflows() { double from = -32769.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt16Overflows() { double from = -32767.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-32767.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt16IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ushort)32766.0' was evaluted to '{(ushort)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt16IsFoldedCorrectly() { double integerOneIncrementAboveInt16MaxValue = 32768.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(ushort)32768.0' was evaluted to '{(ushort)integerOneIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmUInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToUInt16IsFoldedCorrectly() { double uInt16MaxValue = 65535.0; if (BreakUpFlow()) return; if (checked((ushort)uInt16MaxValue) != 65535) { Console.WriteLine($"'(ushort)65535.0' was evaluted to '{(ushort)uInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneDecrementUnderUInt16MaxValue = 65534.99999999999d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ushort)65534.99999999999d' was evaluted to '{(ushort)doubleOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt16MaxValue = 65534d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneFullDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ushort)65534d' was evaluted to '{(ushort)doubleOneFullDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt16IsFoldedCorrectly() { double doubleOneIncrementAboveUInt16MaxValue = 65535.00000000001d; if (BreakUpFlow()) return; if (checked((ushort)doubleOneIncrementAboveUInt16MaxValue) != 65535) { Console.WriteLine($"'(ushort)65535.00000000001d' was evaluted to '{(ushort)doubleOneIncrementAboveUInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt16Overflows() { double from = 65536d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)65536d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt16IsFoldedCorrectly() { double integerOneDecrementUnderUInt16MaxValue = 65534.0; if (BreakUpFlow()) return; if (checked((ushort)integerOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ushort)65534.0' was evaluted to '{(ushort)integerOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt16Overflows() { double from = 65536.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)65536.0)' did not throw OverflowException."); } ConfirmInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToUInt16Overflows() { double from = -2147483648.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToUInt16Overflows() { double from = 2147483647.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483647.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt16Overflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt16Overflows() { double from = -2147483649d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt16Overflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt16Overflows() { double from = -2147483647d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt16Overflows() { double from = 2147483646.9999998d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483646.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt16Overflows() { double from = 2147483646d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483646d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt16Overflows() { double from = 2147483647.0000002d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483647.0000002d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt16Overflows() { double from = 2147483648d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483648d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt16Overflows() { double from = -2147483649.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt16Overflows() { double from = -2147483647.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt16Overflows() { double from = 2147483646.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483646.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt16Overflows() { double from = 2147483648.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)2147483648.0)' did not throw OverflowException."); } ConfirmUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToUInt16Overflows() { double from = 4294967295.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967295.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt16Overflows() { double from = 4294967294.9999995d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967294.9999995d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt16Overflows() { double from = 4294967294d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967294d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt16Overflows() { double from = 4294967295.0000005d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967295.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt16Overflows() { double from = 4294967296d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt16Overflows() { double from = 4294967294.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967294.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt16Overflows() { double from = 4294967296.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToUInt16Overflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToUInt16Overflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt16Overflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt16Overflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt16Overflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt16Overflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt16Overflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt16Overflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt16Overflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToUInt16Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt16Overflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt16Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt16Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((ushort)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ushort)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToInt32() { ConfirmIntegerZeroCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToInt32IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((int)integerZero) != 0) { Console.WriteLine($"'(int)0.0' was evaluted to '{(int)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToInt32IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((int)doubleMinusZero) != 0) { Console.WriteLine($"'(int)-0d' was evaluted to '{(int)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToInt32IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((int)doubleZero) != 0) { Console.WriteLine($"'(int)0d' was evaluted to '{(int)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToInt32Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToInt32Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToInt32IsFoldedCorrectly() { double sByteMinValue = -128.0; if (BreakUpFlow()) return; if (checked((int)sByteMinValue) != -128) { Console.WriteLine($"'(int)-128.0' was evaluted to '{(int)sByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToInt32IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((int)sByteMaxValue) != 127) { Console.WriteLine($"'(int)127.0' was evaluted to '{(int)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMinValue = -128.00000000000003d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderSByteMinValue) != -128) { Console.WriteLine($"'(int)-128.00000000000003d' was evaluted to '{(int)doubleOneDecrementUnderSByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMinValue = -129d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(int)-129d' was evaluted to '{(int)doubleOneFullDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMinValue = -127.99999999999999d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(int)-127.99999999999999d' was evaluted to '{(int)doubleOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMinValue = -127d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(int)-127d' was evaluted to '{(int)doubleOneFullIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(int)126.99999999999999d' was evaluted to '{(int)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(int)126d' was evaluted to '{(int)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(int)127.00000000000001d' was evaluted to '{(int)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(int)128d' was evaluted to '{(int)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderSByteMinValue = -129.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(int)-129.0' was evaluted to '{(int)integerOneDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveSByteMinValue = -127.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(int)-127.0' was evaluted to '{(int)integerOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(int)126.0' was evaluted to '{(int)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(int)128.0' was evaluted to '{(int)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToInt32IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((int)byteMaxValue) != 255) { Console.WriteLine($"'(int)255.0' was evaluted to '{(int)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(int)-5E-324d' was evaluted to '{(int)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMinValue = -1d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(int)-1d' was evaluted to '{(int)doubleOneFullDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(int)5E-324d' was evaluted to '{(int)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(int)1d' was evaluted to '{(int)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(int)254.99999999999997d' was evaluted to '{(int)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(int)254d' was evaluted to '{(int)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(int)255.00000000000003d' was evaluted to '{(int)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(int)256d' was evaluted to '{(int)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderByteMinValue = -1.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(int)-1.0' was evaluted to '{(int)integerOneDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(int)1.0' was evaluted to '{(int)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(int)254.0' was evaluted to '{(int)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(int)256.0' was evaluted to '{(int)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToInt32IsFoldedCorrectly() { double int16MinValue = -32768.0; if (BreakUpFlow()) return; if (checked((int)int16MinValue) != -32768) { Console.WriteLine($"'(int)-32768.0' was evaluted to '{(int)int16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToInt32IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((int)int16MaxValue) != 32767) { Console.WriteLine($"'(int)32767.0' was evaluted to '{(int)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MinValue = -32768.00000000001d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderInt16MinValue) != -32768) { Console.WriteLine($"'(int)-32768.00000000001d' was evaluted to '{(int)doubleOneDecrementUnderInt16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MinValue = -32769d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderInt16MinValue) != -32769) { Console.WriteLine($"'(int)-32769d' was evaluted to '{(int)doubleOneFullDecrementUnderInt16MinValue}'. Expected: '-32769'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MinValue = -32767.999999999996d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(int)-32767.999999999996d' was evaluted to '{(int)doubleOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MinValue = -32767d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(int)-32767d' was evaluted to '{(int)doubleOneFullIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(int)32766.999999999996d' was evaluted to '{(int)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(int)32766d' was evaluted to '{(int)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(int)32767.000000000004d' was evaluted to '{(int)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MaxValue = 32768d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(int)32768d' was evaluted to '{(int)doubleOneFullIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderInt16MinValue = -32769.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderInt16MinValue) != -32769) { Console.WriteLine($"'(int)-32769.0' was evaluted to '{(int)integerOneDecrementUnderInt16MinValue}'. Expected: '-32769'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveInt16MinValue = -32767.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(int)-32767.0' was evaluted to '{(int)integerOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(int)32766.0' was evaluted to '{(int)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveInt16MaxValue = 32768.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(int)32768.0' was evaluted to '{(int)integerOneIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToInt32IsFoldedCorrectly() { double uInt16MaxValue = 65535.0; if (BreakUpFlow()) return; if (checked((int)uInt16MaxValue) != 65535) { Console.WriteLine($"'(int)65535.0' was evaluted to '{(int)uInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderUInt16MaxValue = 65534.99999999999d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(int)65534.99999999999d' was evaluted to '{(int)doubleOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt16MaxValue = 65534d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(int)65534d' was evaluted to '{(int)doubleOneFullDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveUInt16MaxValue = 65535.00000000001d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveUInt16MaxValue) != 65535) { Console.WriteLine($"'(int)65535.00000000001d' was evaluted to '{(int)doubleOneIncrementAboveUInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt16MaxValue = 65536d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(int)65536d' was evaluted to '{(int)doubleOneFullIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderUInt16MaxValue = 65534.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(int)65534.0' was evaluted to '{(int)integerOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveUInt16MaxValue = 65536.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(int)65536.0' was evaluted to '{(int)integerOneIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmInt32MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToInt32IsFoldedCorrectly() { double int32MinValue = -2147483648.0; if (BreakUpFlow()) return; if (checked((int)int32MinValue) != -2147483648) { Console.WriteLine($"'(int)-2147483648.0' was evaluted to '{(int)int32MinValue}'. Expected: '-2147483648'."); _counter++; } } ConfirmInt32MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToInt32IsFoldedCorrectly() { double int32MaxValue = 2147483647.0; if (BreakUpFlow()) return; if (checked((int)int32MaxValue) != 2147483647) { Console.WriteLine($"'(int)2147483647.0' was evaluted to '{(int)int32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MinValue = -2147483648.0000005d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderInt32MinValue) != -2147483648) { Console.WriteLine($"'(int)-2147483648.0000005d' was evaluted to '{(int)doubleOneDecrementUnderInt32MinValue}'. Expected: '-2147483648'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt32Overflows() { double from = -2147483649d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MinValue = -2147483647.9999998d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(int)-2147483647.9999998d' was evaluted to '{(int)doubleOneIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt32MinValue = -2147483647d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(int)-2147483647d' was evaluted to '{(int)doubleOneFullIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MaxValue = 2147483646.9999998d; if (BreakUpFlow()) return; if (checked((int)doubleOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(int)2147483646.9999998d' was evaluted to '{(int)doubleOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt32MaxValue = 2147483646d; if (BreakUpFlow()) return; if (checked((int)doubleOneFullDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(int)2147483646d' was evaluted to '{(int)doubleOneFullDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MaxValue = 2147483647.0000002d; if (BreakUpFlow()) return; if (checked((int)doubleOneIncrementAboveInt32MaxValue) != 2147483647) { Console.WriteLine($"'(int)2147483647.0000002d' was evaluted to '{(int)doubleOneIncrementAboveInt32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt32Overflows() { double from = 2147483648d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)2147483648d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt32Overflows() { double from = -2147483649.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt32IsFoldedCorrectly() { double integerOneIncrementAboveInt32MinValue = -2147483647.0; if (BreakUpFlow()) return; if (checked((int)integerOneIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(int)-2147483647.0' was evaluted to '{(int)integerOneIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt32IsFoldedCorrectly() { double integerOneDecrementUnderInt32MaxValue = 2147483646.0; if (BreakUpFlow()) return; if (checked((int)integerOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(int)2147483646.0' was evaluted to '{(int)integerOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt32Overflows() { double from = 2147483648.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)2147483648.0)' did not throw OverflowException."); } ConfirmUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToInt32Overflows() { double from = 4294967295.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967295.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt32Overflows() { double from = 4294967294.9999995d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967294.9999995d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt32Overflows() { double from = 4294967294d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967294d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt32Overflows() { double from = 4294967295.0000005d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967295.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt32Overflows() { double from = 4294967296d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt32Overflows() { double from = 4294967294.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967294.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt32Overflows() { double from = 4294967296.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToInt32Overflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToInt32Overflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt32Overflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt32Overflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt32Overflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt32Overflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt32Overflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt32Overflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt32Overflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToInt32Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt32Overflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt32Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((int)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((int)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToUInt32() { ConfirmIntegerZeroCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToUInt32IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((uint)integerZero) != 0) { Console.WriteLine($"'(uint)0.0' was evaluted to '{(uint)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToUInt32IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((uint)doubleMinusZero) != 0) { Console.WriteLine($"'(uint)-0d' was evaluted to '{(uint)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToUInt32IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((uint)doubleZero) != 0) { Console.WriteLine($"'(uint)0d' was evaluted to '{(uint)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToUInt32Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToUInt32Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToUInt32Overflows() { double from = -128.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-128.0)' did not throw OverflowException."); } ConfirmSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToUInt32IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((uint)sByteMaxValue) != 127) { Console.WriteLine($"'(uint)127.0' was evaluted to '{(uint)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt32Overflows() { double from = -128.00000000000003d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-128.00000000000003d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt32Overflows() { double from = -129d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-129d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt32Overflows() { double from = -127.99999999999999d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-127.99999999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt32Overflows() { double from = -127d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-127d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(uint)126.99999999999999d' was evaluted to '{(uint)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(uint)126d' was evaluted to '{(uint)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(uint)127.00000000000001d' was evaluted to '{(uint)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(uint)128d' was evaluted to '{(uint)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt32Overflows() { double from = -129.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-129.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt32Overflows() { double from = -127.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-127.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(uint)126.0' was evaluted to '{(uint)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(uint)128.0' was evaluted to '{(uint)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToUInt32IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((uint)byteMaxValue) != 255) { Console.WriteLine($"'(uint)255.0' was evaluted to '{(uint)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(uint)-5E-324d' was evaluted to '{(uint)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt32Overflows() { double from = -1d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-1d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(uint)5E-324d' was evaluted to '{(uint)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(uint)1d' was evaluted to '{(uint)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(uint)254.99999999999997d' was evaluted to '{(uint)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(uint)254d' was evaluted to '{(uint)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(uint)255.00000000000003d' was evaluted to '{(uint)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(uint)256d' was evaluted to '{(uint)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt32Overflows() { double from = -1.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-1.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(uint)1.0' was evaluted to '{(uint)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(uint)254.0' was evaluted to '{(uint)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(uint)256.0' was evaluted to '{(uint)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToUInt32Overflows() { double from = -32768.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32768.0)' did not throw OverflowException."); } ConfirmInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToUInt32IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((uint)int16MaxValue) != 32767) { Console.WriteLine($"'(uint)32767.0' was evaluted to '{(uint)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt32Overflows() { double from = -32768.00000000001d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32768.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt32Overflows() { double from = -32769d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt32Overflows() { double from = -32767.999999999996d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32767.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt32Overflows() { double from = -32767d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32767d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(uint)32766.999999999996d' was evaluted to '{(uint)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(uint)32766d' was evaluted to '{(uint)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(uint)32767.000000000004d' was evaluted to '{(uint)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MaxValue = 32768d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(uint)32768d' was evaluted to '{(uint)doubleOneFullIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt32Overflows() { double from = -32769.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt32Overflows() { double from = -32767.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-32767.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(uint)32766.0' was evaluted to '{(uint)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveInt16MaxValue = 32768.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(uint)32768.0' was evaluted to '{(uint)integerOneIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double uInt16MaxValue = 65535.0; if (BreakUpFlow()) return; if (checked((uint)uInt16MaxValue) != 65535) { Console.WriteLine($"'(uint)65535.0' was evaluted to '{(uint)uInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderUInt16MaxValue = 65534.99999999999d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(uint)65534.99999999999d' was evaluted to '{(uint)doubleOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt16MaxValue = 65534d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(uint)65534d' was evaluted to '{(uint)doubleOneFullDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveUInt16MaxValue = 65535.00000000001d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveUInt16MaxValue) != 65535) { Console.WriteLine($"'(uint)65535.00000000001d' was evaluted to '{(uint)doubleOneIncrementAboveUInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt16MaxValue = 65536d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(uint)65536d' was evaluted to '{(uint)doubleOneFullIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderUInt16MaxValue = 65534.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(uint)65534.0' was evaluted to '{(uint)integerOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveUInt16MaxValue = 65536.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(uint)65536.0' was evaluted to '{(uint)integerOneIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToUInt32Overflows() { double from = -2147483648.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToUInt32IsFoldedCorrectly() { double int32MaxValue = 2147483647.0; if (BreakUpFlow()) return; if (checked((uint)int32MaxValue) != 2147483647) { Console.WriteLine($"'(uint)2147483647.0' was evaluted to '{(uint)int32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt32Overflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt32Overflows() { double from = -2147483649d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt32Overflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt32Overflows() { double from = -2147483647d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MaxValue = 2147483646.9999998d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(uint)2147483646.9999998d' was evaluted to '{(uint)doubleOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt32MaxValue = 2147483646d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(uint)2147483646d' was evaluted to '{(uint)doubleOneFullDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MaxValue = 2147483647.0000002d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveInt32MaxValue) != 2147483647) { Console.WriteLine($"'(uint)2147483647.0000002d' was evaluted to '{(uint)doubleOneIncrementAboveInt32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt32MaxValue = 2147483648d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(uint)2147483648d' was evaluted to '{(uint)doubleOneFullIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt32Overflows() { double from = -2147483649.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt32Overflows() { double from = -2147483647.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderInt32MaxValue = 2147483646.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(uint)2147483646.0' was evaluted to '{(uint)integerOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneIncrementAboveInt32MaxValue = 2147483648.0; if (BreakUpFlow()) return; if (checked((uint)integerOneIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(uint)2147483648.0' was evaluted to '{(uint)integerOneIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmUInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToUInt32IsFoldedCorrectly() { double uInt32MaxValue = 4294967295.0; if (BreakUpFlow()) return; if (checked((uint)uInt32MaxValue) != 4294967295) { Console.WriteLine($"'(uint)4294967295.0' was evaluted to '{(uint)uInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneDecrementUnderUInt32MaxValue = 4294967294.9999995d; if (BreakUpFlow()) return; if (checked((uint)doubleOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(uint)4294967294.9999995d' was evaluted to '{(uint)doubleOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt32MaxValue = 4294967294d; if (BreakUpFlow()) return; if (checked((uint)doubleOneFullDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(uint)4294967294d' was evaluted to '{(uint)doubleOneFullDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt32IsFoldedCorrectly() { double doubleOneIncrementAboveUInt32MaxValue = 4294967295.0000005d; if (BreakUpFlow()) return; if (checked((uint)doubleOneIncrementAboveUInt32MaxValue) != 4294967295) { Console.WriteLine($"'(uint)4294967295.0000005d' was evaluted to '{(uint)doubleOneIncrementAboveUInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt32Overflows() { double from = 4294967296d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)4294967296d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt32IsFoldedCorrectly() { double integerOneDecrementUnderUInt32MaxValue = 4294967294.0; if (BreakUpFlow()) return; if (checked((uint)integerOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(uint)4294967294.0' was evaluted to '{(uint)integerOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt32Overflows() { double from = 4294967296.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)4294967296.0)' did not throw OverflowException."); } ConfirmInt64MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToUInt32Overflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToUInt32Overflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt32Overflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt32Overflows() { double from = 9.223372036854775E+18d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt32Overflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt32Overflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt32Overflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt32Overflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt32Overflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToUInt32Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt32Overflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt32Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt32Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((uint)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((uint)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToInt64() { ConfirmIntegerZeroCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToInt64IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((long)integerZero) != 0) { Console.WriteLine($"'(long)0.0' was evaluted to '{(long)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToInt64IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((long)doubleMinusZero) != 0) { Console.WriteLine($"'(long)-0d' was evaluted to '{(long)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToInt64IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((long)doubleZero) != 0) { Console.WriteLine($"'(long)0d' was evaluted to '{(long)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToInt64Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToInt64Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToInt64IsFoldedCorrectly() { double sByteMinValue = -128.0; if (BreakUpFlow()) return; if (checked((long)sByteMinValue) != -128) { Console.WriteLine($"'(long)-128.0' was evaluted to '{(long)sByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToInt64IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((long)sByteMaxValue) != 127) { Console.WriteLine($"'(long)127.0' was evaluted to '{(long)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMinValue = -128.00000000000003d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderSByteMinValue) != -128) { Console.WriteLine($"'(long)-128.00000000000003d' was evaluted to '{(long)doubleOneDecrementUnderSByteMinValue}'. Expected: '-128'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMinValue = -129d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(long)-129d' was evaluted to '{(long)doubleOneFullDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMinValue = -127.99999999999999d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(long)-127.99999999999999d' was evaluted to '{(long)doubleOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMinValue = -127d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(long)-127d' was evaluted to '{(long)doubleOneFullIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(long)126.99999999999999d' was evaluted to '{(long)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(long)126d' was evaluted to '{(long)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(long)127.00000000000001d' was evaluted to '{(long)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(long)128d' was evaluted to '{(long)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderSByteMinValue = -129.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderSByteMinValue) != -129) { Console.WriteLine($"'(long)-129.0' was evaluted to '{(long)integerOneDecrementUnderSByteMinValue}'. Expected: '-129'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveSByteMinValue = -127.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveSByteMinValue) != -127) { Console.WriteLine($"'(long)-127.0' was evaluted to '{(long)integerOneIncrementAboveSByteMinValue}'. Expected: '-127'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(long)126.0' was evaluted to '{(long)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(long)128.0' was evaluted to '{(long)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToInt64IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((long)byteMaxValue) != 255) { Console.WriteLine($"'(long)255.0' was evaluted to '{(long)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(long)-5E-324d' was evaluted to '{(long)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMinValue = -1d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(long)-1d' was evaluted to '{(long)doubleOneFullDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(long)5E-324d' was evaluted to '{(long)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(long)1d' was evaluted to '{(long)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(long)254.99999999999997d' was evaluted to '{(long)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(long)254d' was evaluted to '{(long)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(long)255.00000000000003d' was evaluted to '{(long)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(long)256d' was evaluted to '{(long)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderByteMinValue = -1.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderByteMinValue) != -1) { Console.WriteLine($"'(long)-1.0' was evaluted to '{(long)integerOneDecrementUnderByteMinValue}'. Expected: '-1'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(long)1.0' was evaluted to '{(long)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(long)254.0' was evaluted to '{(long)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(long)256.0' was evaluted to '{(long)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToInt64IsFoldedCorrectly() { double int16MinValue = -32768.0; if (BreakUpFlow()) return; if (checked((long)int16MinValue) != -32768) { Console.WriteLine($"'(long)-32768.0' was evaluted to '{(long)int16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToInt64IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((long)int16MaxValue) != 32767) { Console.WriteLine($"'(long)32767.0' was evaluted to '{(long)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MinValue = -32768.00000000001d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderInt16MinValue) != -32768) { Console.WriteLine($"'(long)-32768.00000000001d' was evaluted to '{(long)doubleOneDecrementUnderInt16MinValue}'. Expected: '-32768'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MinValue = -32769d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderInt16MinValue) != -32769) { Console.WriteLine($"'(long)-32769d' was evaluted to '{(long)doubleOneFullDecrementUnderInt16MinValue}'. Expected: '-32769'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MinValue = -32767.999999999996d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(long)-32767.999999999996d' was evaluted to '{(long)doubleOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MinValue = -32767d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(long)-32767d' was evaluted to '{(long)doubleOneFullIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(long)32766.999999999996d' was evaluted to '{(long)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(long)32766d' was evaluted to '{(long)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(long)32767.000000000004d' was evaluted to '{(long)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MaxValue = 32768d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(long)32768d' was evaluted to '{(long)doubleOneFullIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt16MinValue = -32769.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderInt16MinValue) != -32769) { Console.WriteLine($"'(long)-32769.0' was evaluted to '{(long)integerOneDecrementUnderInt16MinValue}'. Expected: '-32769'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt16MinValue = -32767.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveInt16MinValue) != -32767) { Console.WriteLine($"'(long)-32767.0' was evaluted to '{(long)integerOneIncrementAboveInt16MinValue}'. Expected: '-32767'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(long)32766.0' was evaluted to '{(long)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt16MaxValue = 32768.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(long)32768.0' was evaluted to '{(long)integerOneIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToInt64IsFoldedCorrectly() { double uInt16MaxValue = 65535.0; if (BreakUpFlow()) return; if (checked((long)uInt16MaxValue) != 65535) { Console.WriteLine($"'(long)65535.0' was evaluted to '{(long)uInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderUInt16MaxValue = 65534.99999999999d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(long)65534.99999999999d' was evaluted to '{(long)doubleOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt16MaxValue = 65534d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(long)65534d' was evaluted to '{(long)doubleOneFullDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveUInt16MaxValue = 65535.00000000001d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveUInt16MaxValue) != 65535) { Console.WriteLine($"'(long)65535.00000000001d' was evaluted to '{(long)doubleOneIncrementAboveUInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt16MaxValue = 65536d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(long)65536d' was evaluted to '{(long)doubleOneFullIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderUInt16MaxValue = 65534.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(long)65534.0' was evaluted to '{(long)integerOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveUInt16MaxValue = 65536.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(long)65536.0' was evaluted to '{(long)integerOneIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToInt64IsFoldedCorrectly() { double int32MinValue = -2147483648.0; if (BreakUpFlow()) return; if (checked((long)int32MinValue) != -2147483648) { Console.WriteLine($"'(long)-2147483648.0' was evaluted to '{(long)int32MinValue}'. Expected: '-2147483648'."); _counter++; } } ConfirmInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToInt64IsFoldedCorrectly() { double int32MaxValue = 2147483647.0; if (BreakUpFlow()) return; if (checked((long)int32MaxValue) != 2147483647) { Console.WriteLine($"'(long)2147483647.0' was evaluted to '{(long)int32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MinValue = -2147483648.0000005d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderInt32MinValue) != -2147483648) { Console.WriteLine($"'(long)-2147483648.0000005d' was evaluted to '{(long)doubleOneDecrementUnderInt32MinValue}'. Expected: '-2147483648'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt32MinValue = -2147483649d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderInt32MinValue) != -2147483649) { Console.WriteLine($"'(long)-2147483649d' was evaluted to '{(long)doubleOneFullDecrementUnderInt32MinValue}'. Expected: '-2147483649'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MinValue = -2147483647.9999998d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(long)-2147483647.9999998d' was evaluted to '{(long)doubleOneIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt32MinValue = -2147483647d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(long)-2147483647d' was evaluted to '{(long)doubleOneFullIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MaxValue = 2147483646.9999998d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(long)2147483646.9999998d' was evaluted to '{(long)doubleOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt32MaxValue = 2147483646d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(long)2147483646d' was evaluted to '{(long)doubleOneFullDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MaxValue = 2147483647.0000002d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveInt32MaxValue) != 2147483647) { Console.WriteLine($"'(long)2147483647.0000002d' was evaluted to '{(long)doubleOneIncrementAboveInt32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt32MaxValue = 2147483648d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(long)2147483648d' was evaluted to '{(long)doubleOneFullIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt32MinValue = -2147483649.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderInt32MinValue) != -2147483649) { Console.WriteLine($"'(long)-2147483649.0' was evaluted to '{(long)integerOneDecrementUnderInt32MinValue}'. Expected: '-2147483649'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt32MinValue = -2147483647.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveInt32MinValue) != -2147483647) { Console.WriteLine($"'(long)-2147483647.0' was evaluted to '{(long)integerOneIncrementAboveInt32MinValue}'. Expected: '-2147483647'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt32MaxValue = 2147483646.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(long)2147483646.0' was evaluted to '{(long)integerOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt32MaxValue = 2147483648.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(long)2147483648.0' was evaluted to '{(long)integerOneIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToInt64IsFoldedCorrectly() { double uInt32MaxValue = 4294967295.0; if (BreakUpFlow()) return; if (checked((long)uInt32MaxValue) != 4294967295) { Console.WriteLine($"'(long)4294967295.0' was evaluted to '{(long)uInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderUInt32MaxValue = 4294967294.9999995d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(long)4294967294.9999995d' was evaluted to '{(long)doubleOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt32MaxValue = 4294967294d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(long)4294967294d' was evaluted to '{(long)doubleOneFullDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveUInt32MaxValue = 4294967295.0000005d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveUInt32MaxValue) != 4294967295) { Console.WriteLine($"'(long)4294967295.0000005d' was evaluted to '{(long)doubleOneIncrementAboveUInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt32MaxValue = 4294967296d; if (BreakUpFlow()) return; if (checked((long)doubleOneFullIncrementAboveUInt32MaxValue) != 4294967296) { Console.WriteLine($"'(long)4294967296d' was evaluted to '{(long)doubleOneFullIncrementAboveUInt32MaxValue}'. Expected: '4294967296'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToInt64IsFoldedCorrectly() { double integerOneDecrementUnderUInt32MaxValue = 4294967294.0; if (BreakUpFlow()) return; if (checked((long)integerOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(long)4294967294.0' was evaluted to '{(long)integerOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveUInt32MaxValue = 4294967296.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveUInt32MaxValue) != 4294967296) { Console.WriteLine($"'(long)4294967296.0' was evaluted to '{(long)integerOneIncrementAboveUInt32MaxValue}'. Expected: '4294967296'."); _counter++; } } ConfirmInt64MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToInt64IsFoldedCorrectly() { double int64MinValue = -9223372036854775808.0; if (BreakUpFlow()) return; if (checked((long)int64MinValue) != -9223372036854775808) { Console.WriteLine($"'(long)-9223372036854775808.0' was evaluted to '{(long)int64MinValue}'. Expected: '-9223372036854775808'."); _counter++; } } ConfirmInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToInt64Overflows() { double from = 9223372036854775807.0; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)9223372036854775807.0)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt64MinValue = -9.223372036854775E+18d; if (BreakUpFlow()) return; if (checked((long)doubleOneIncrementAboveInt64MinValue) != -9223372036854774784) { Console.WriteLine($"'(long)-9.223372036854775E+18d' was evaluted to '{(long)doubleOneIncrementAboveInt64MinValue}'. Expected: '-9223372036854774784'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt64MaxValue = 9.223372036854775E+18d; if (BreakUpFlow()) return; if (checked((long)doubleOneDecrementUnderInt64MaxValue) != 9223372036854774784) { Console.WriteLine($"'(long)9.223372036854775E+18d' was evaluted to '{(long)doubleOneDecrementUnderInt64MaxValue}'. Expected: '9223372036854774784'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToInt64Overflows() { double from = 9.223372036854778E+18d; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)9.223372036854778E+18d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToInt64Overflows() { double from = 9.223372036854776E+18d; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)9.223372036854776E+18d)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt64MinValue = -9223372036854775807.0; if (BreakUpFlow()) return; if (checked((long)integerOneIncrementAboveInt64MinValue) != -9223372036854775808) { Console.WriteLine($"'(long)-9223372036854775807.0' was evaluted to '{(long)integerOneIncrementAboveInt64MinValue}'. Expected: '-9223372036854775808'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToInt64Overflows() { double from = 9223372036854775806.0; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)9223372036854775806.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToInt64Overflows() { double from = 9223372036854775808.0; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)9223372036854775808.0)' did not throw OverflowException."); } ConfirmUInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToInt64Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToInt64Overflows() { double from = 1.844674407370955E+19d; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)1.844674407370955E+19d)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToInt64Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((long)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((long)18446744073709551614.0)' did not throw OverflowException."); } } private static void TestCastingDoubleToUInt64() { ConfirmIntegerZeroCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerZeroCastToUInt64IsFoldedCorrectly() { double integerZero = 0.0; if (BreakUpFlow()) return; if (checked((ulong)integerZero) != 0) { Console.WriteLine($"'(ulong)0.0' was evaluted to '{(ulong)integerZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinusZeroCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinusZeroCastToUInt64IsFoldedCorrectly() { double doubleMinusZero = -0d; if (BreakUpFlow()) return; if (checked((ulong)doubleMinusZero) != 0) { Console.WriteLine($"'(ulong)-0d' was evaluted to '{(ulong)doubleMinusZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleZeroCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleZeroCastToUInt64IsFoldedCorrectly() { double doubleZero = 0d; if (BreakUpFlow()) return; if (checked((ulong)doubleZero) != 0) { Console.WriteLine($"'(ulong)0d' was evaluted to '{(ulong)doubleZero}'. Expected: '0'."); _counter++; } } ConfirmDoubleMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMinValueCastToUInt64Overflows() { double from = -1.7976931348623157E+308d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmDoubleMaxValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleMaxValueCastToUInt64Overflows() { double from = 1.7976931348623157E+308d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)1.7976931348623157E+308d)' did not throw OverflowException."); } ConfirmSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMinValueCastToUInt64Overflows() { double from = -128.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-128.0)' did not throw OverflowException."); } ConfirmSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmSByteMaxValueCastToUInt64IsFoldedCorrectly() { double sByteMaxValue = 127.0; if (BreakUpFlow()) return; if (checked((ulong)sByteMaxValue) != 127) { Console.WriteLine($"'(ulong)127.0' was evaluted to '{(ulong)sByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMinValueCastToUInt64Overflows() { double from = -128.00000000000003d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-128.00000000000003d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMinValueCastToUInt64Overflows() { double from = -129d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-129d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMinValueCastToUInt64Overflows() { double from = -127.99999999999999d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-127.99999999999999d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMinValueCastToUInt64Overflows() { double from = -127d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-127d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderSByteMaxValue = 126.99999999999999d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ulong)126.99999999999999d' was evaluted to '{(ulong)doubleOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderSByteMaxValue = 126d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ulong)126d' was evaluted to '{(ulong)doubleOneFullDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveSByteMaxValue = 127.00000000000001d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveSByteMaxValue) != 127) { Console.WriteLine($"'(ulong)127.00000000000001d' was evaluted to '{(ulong)doubleOneIncrementAboveSByteMaxValue}'. Expected: '127'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveSByteMaxValue = 128d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(ulong)128d' was evaluted to '{(ulong)doubleOneFullIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMinValueCastToUInt64Overflows() { double from = -129.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-129.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMinValueCastToUInt64Overflows() { double from = -127.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-127.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderSByteMaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderSByteMaxValue = 126.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderSByteMaxValue) != 126) { Console.WriteLine($"'(ulong)126.0' was evaluted to '{(ulong)integerOneDecrementUnderSByteMaxValue}'. Expected: '126'."); _counter++; } } ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveSByteMaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveSByteMaxValue = 128.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveSByteMaxValue) != 128) { Console.WriteLine($"'(ulong)128.0' was evaluted to '{(ulong)integerOneIncrementAboveSByteMaxValue}'. Expected: '128'."); _counter++; } } ConfirmByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmByteMaxValueCastToUInt64IsFoldedCorrectly() { double byteMaxValue = 255.0; if (BreakUpFlow()) return; if (checked((ulong)byteMaxValue) != 255) { Console.WriteLine($"'(ulong)255.0' was evaluted to '{(ulong)byteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMinValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderByteMinValue = -5E-324d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderByteMinValue) != 0) { Console.WriteLine($"'(ulong)-5E-324d' was evaluted to '{(ulong)doubleOneDecrementUnderByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMinValueCastToUInt64Overflows() { double from = -1d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-1d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveByteMinValue = 5E-324d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveByteMinValue) != 0) { Console.WriteLine($"'(ulong)5E-324d' was evaluted to '{(ulong)doubleOneIncrementAboveByteMinValue}'. Expected: '0'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMinValue = 1d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(ulong)1d' was evaluted to '{(ulong)doubleOneFullIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderByteMaxValue = 254.99999999999997d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ulong)254.99999999999997d' was evaluted to '{(ulong)doubleOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderByteMaxValue = 254d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ulong)254d' was evaluted to '{(ulong)doubleOneFullDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveByteMaxValue = 255.00000000000003d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveByteMaxValue) != 255) { Console.WriteLine($"'(ulong)255.00000000000003d' was evaluted to '{(ulong)doubleOneIncrementAboveByteMaxValue}'. Expected: '255'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveByteMaxValue = 256d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(ulong)256d' was evaluted to '{(ulong)doubleOneFullIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMinValueCastToUInt64Overflows() { double from = -1.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-1.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMinValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveByteMinValue = 1.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveByteMinValue) != 1) { Console.WriteLine($"'(ulong)1.0' was evaluted to '{(ulong)integerOneIncrementAboveByteMinValue}'. Expected: '1'."); _counter++; } } ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderByteMaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderByteMaxValue = 254.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderByteMaxValue) != 254) { Console.WriteLine($"'(ulong)254.0' was evaluted to '{(ulong)integerOneDecrementUnderByteMaxValue}'. Expected: '254'."); _counter++; } } ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveByteMaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveByteMaxValue = 256.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveByteMaxValue) != 256) { Console.WriteLine($"'(ulong)256.0' was evaluted to '{(ulong)integerOneIncrementAboveByteMaxValue}'. Expected: '256'."); _counter++; } } ConfirmInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MinValueCastToUInt64Overflows() { double from = -32768.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32768.0)' did not throw OverflowException."); } ConfirmInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt16MaxValueCastToUInt64IsFoldedCorrectly() { double int16MaxValue = 32767.0; if (BreakUpFlow()) return; if (checked((ulong)int16MaxValue) != 32767) { Console.WriteLine($"'(ulong)32767.0' was evaluted to '{(ulong)int16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MinValueCastToUInt64Overflows() { double from = -32768.00000000001d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32768.00000000001d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MinValueCastToUInt64Overflows() { double from = -32769d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32769d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MinValueCastToUInt64Overflows() { double from = -32767.999999999996d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32767.999999999996d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MinValueCastToUInt64Overflows() { double from = -32767d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32767d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt16MaxValue = 32766.999999999996d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ulong)32766.999999999996d' was evaluted to '{(ulong)doubleOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt16MaxValue = 32766d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ulong)32766d' was evaluted to '{(ulong)doubleOneFullDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt16MaxValue = 32767.000000000004d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveInt16MaxValue) != 32767) { Console.WriteLine($"'(ulong)32767.000000000004d' was evaluted to '{(ulong)doubleOneIncrementAboveInt16MaxValue}'. Expected: '32767'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt16MaxValue = 32768d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(ulong)32768d' was evaluted to '{(ulong)doubleOneFullIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MinValueCastToUInt64Overflows() { double from = -32769.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32769.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MinValueCastToUInt64Overflows() { double from = -32767.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-32767.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt16MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt16MaxValue = 32766.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderInt16MaxValue) != 32766) { Console.WriteLine($"'(ulong)32766.0' was evaluted to '{(ulong)integerOneDecrementUnderInt16MaxValue}'. Expected: '32766'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt16MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt16MaxValue = 32768.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveInt16MaxValue) != 32768) { Console.WriteLine($"'(ulong)32768.0' was evaluted to '{(ulong)integerOneIncrementAboveInt16MaxValue}'. Expected: '32768'."); _counter++; } } ConfirmUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double uInt16MaxValue = 65535.0; if (BreakUpFlow()) return; if (checked((ulong)uInt16MaxValue) != 65535) { Console.WriteLine($"'(ulong)65535.0' was evaluted to '{(ulong)uInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderUInt16MaxValue = 65534.99999999999d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ulong)65534.99999999999d' was evaluted to '{(ulong)doubleOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt16MaxValue = 65534d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ulong)65534d' was evaluted to '{(ulong)doubleOneFullDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveUInt16MaxValue = 65535.00000000001d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveUInt16MaxValue) != 65535) { Console.WriteLine($"'(ulong)65535.00000000001d' was evaluted to '{(ulong)doubleOneIncrementAboveUInt16MaxValue}'. Expected: '65535'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt16MaxValue = 65536d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(ulong)65536d' was evaluted to '{(ulong)doubleOneFullIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderUInt16MaxValue = 65534.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderUInt16MaxValue) != 65534) { Console.WriteLine($"'(ulong)65534.0' was evaluted to '{(ulong)integerOneDecrementUnderUInt16MaxValue}'. Expected: '65534'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt16MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveUInt16MaxValue = 65536.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveUInt16MaxValue) != 65536) { Console.WriteLine($"'(ulong)65536.0' was evaluted to '{(ulong)integerOneIncrementAboveUInt16MaxValue}'. Expected: '65536'."); _counter++; } } ConfirmInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MinValueCastToUInt64Overflows() { double from = -2147483648.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483648.0)' did not throw OverflowException."); } ConfirmInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt32MaxValueCastToUInt64IsFoldedCorrectly() { double int32MaxValue = 2147483647.0; if (BreakUpFlow()) return; if (checked((ulong)int32MaxValue) != 2147483647) { Console.WriteLine($"'(ulong)2147483647.0' was evaluted to '{(ulong)int32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MinValueCastToUInt64Overflows() { double from = -2147483648.0000005d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483648.0000005d)' did not throw OverflowException."); } ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MinValueCastToUInt64Overflows() { double from = -2147483649d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483649d)' did not throw OverflowException."); } ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MinValueCastToUInt64Overflows() { double from = -2147483647.9999998d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483647.9999998d)' did not throw OverflowException."); } ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MinValueCastToUInt64Overflows() { double from = -2147483647d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483647d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt32MaxValue = 2147483646.9999998d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(ulong)2147483646.9999998d' was evaluted to '{(ulong)doubleOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderInt32MaxValue = 2147483646d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(ulong)2147483646d' was evaluted to '{(ulong)doubleOneFullDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt32MaxValue = 2147483647.0000002d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveInt32MaxValue) != 2147483647) { Console.WriteLine($"'(ulong)2147483647.0000002d' was evaluted to '{(ulong)doubleOneIncrementAboveInt32MaxValue}'. Expected: '2147483647'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt32MaxValue = 2147483648d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(ulong)2147483648d' was evaluted to '{(ulong)doubleOneFullIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MinValueCastToUInt64Overflows() { double from = -2147483649.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483649.0)' did not throw OverflowException."); } ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MinValueCastToUInt64Overflows() { double from = -2147483647.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-2147483647.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt32MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt32MaxValue = 2147483646.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderInt32MaxValue) != 2147483646) { Console.WriteLine($"'(ulong)2147483646.0' was evaluted to '{(ulong)integerOneDecrementUnderInt32MaxValue}'. Expected: '2147483646'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt32MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt32MaxValue = 2147483648.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveInt32MaxValue) != 2147483648) { Console.WriteLine($"'(ulong)2147483648.0' was evaluted to '{(ulong)integerOneIncrementAboveInt32MaxValue}'. Expected: '2147483648'."); _counter++; } } ConfirmUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double uInt32MaxValue = 4294967295.0; if (BreakUpFlow()) return; if (checked((ulong)uInt32MaxValue) != 4294967295) { Console.WriteLine($"'(ulong)4294967295.0' was evaluted to '{(ulong)uInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderUInt32MaxValue = 4294967294.9999995d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(ulong)4294967294.9999995d' was evaluted to '{(ulong)doubleOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullDecrementUnderUInt32MaxValue = 4294967294d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(ulong)4294967294d' was evaluted to '{(ulong)doubleOneFullDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveUInt32MaxValue = 4294967295.0000005d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveUInt32MaxValue) != 4294967295) { Console.WriteLine($"'(ulong)4294967295.0000005d' was evaluted to '{(ulong)doubleOneIncrementAboveUInt32MaxValue}'. Expected: '4294967295'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveUInt32MaxValue = 4294967296d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveUInt32MaxValue) != 4294967296) { Console.WriteLine($"'(ulong)4294967296d' was evaluted to '{(ulong)doubleOneFullIncrementAboveUInt32MaxValue}'. Expected: '4294967296'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderUInt32MaxValue = 4294967294.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderUInt32MaxValue) != 4294967294) { Console.WriteLine($"'(ulong)4294967294.0' was evaluted to '{(ulong)integerOneDecrementUnderUInt32MaxValue}'. Expected: '4294967294'."); _counter++; } } ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveUInt32MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveUInt32MaxValue = 4294967296.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveUInt32MaxValue) != 4294967296) { Console.WriteLine($"'(ulong)4294967296.0' was evaluted to '{(ulong)integerOneIncrementAboveUInt32MaxValue}'. Expected: '4294967296'."); _counter++; } } ConfirmInt64MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MinValueCastToUInt64Overflows() { double from = -9223372036854775808.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-9223372036854775808.0)' did not throw OverflowException."); } ConfirmInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmInt64MaxValueCastToUInt64IsFoldedCorrectly() { double int64MaxValue = 9223372036854775807.0; if (BreakUpFlow()) return; if (checked((ulong)int64MaxValue) != 9223372036854775808) { Console.WriteLine($"'(ulong)9223372036854775807.0' was evaluted to '{(ulong)int64MaxValue}'. Expected: '9223372036854775808'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MinValueCastToUInt64Overflows() { double from = -9.223372036854775E+18d; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-9.223372036854775E+18d)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderInt64MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderInt64MaxValue = 9.223372036854775E+18d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderInt64MaxValue) != 9223372036854774784) { Console.WriteLine($"'(ulong)9.223372036854775E+18d' was evaluted to '{(ulong)doubleOneDecrementUnderInt64MaxValue}'. Expected: '9223372036854774784'."); _counter++; } } ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneIncrementAboveInt64MaxValue = 9.223372036854778E+18d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneIncrementAboveInt64MaxValue) != 9223372036854777856) { Console.WriteLine($"'(ulong)9.223372036854778E+18d' was evaluted to '{(ulong)doubleOneIncrementAboveInt64MaxValue}'. Expected: '9223372036854777856'."); _counter++; } } ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneFullIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneFullIncrementAboveInt64MaxValue = 9.223372036854776E+18d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneFullIncrementAboveInt64MaxValue) != 9223372036854775808) { Console.WriteLine($"'(ulong)9.223372036854776E+18d' was evaluted to '{(ulong)doubleOneFullIncrementAboveInt64MaxValue}'. Expected: '9223372036854775808'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MinValueCastToUInt64Overflows() { double from = -9223372036854775807.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)-9223372036854775807.0)' did not throw OverflowException."); } ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderInt64MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneDecrementUnderInt64MaxValue = 9223372036854775806.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneDecrementUnderInt64MaxValue) != 9223372036854775808) { Console.WriteLine($"'(ulong)9223372036854775806.0' was evaluted to '{(ulong)integerOneDecrementUnderInt64MaxValue}'. Expected: '9223372036854775808'."); _counter++; } } ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneIncrementAboveInt64MaxValueCastToUInt64IsFoldedCorrectly() { double integerOneIncrementAboveInt64MaxValue = 9223372036854775808.0; if (BreakUpFlow()) return; if (checked((ulong)integerOneIncrementAboveInt64MaxValue) != 9223372036854775808) { Console.WriteLine($"'(ulong)9223372036854775808.0' was evaluted to '{(ulong)integerOneIncrementAboveInt64MaxValue}'. Expected: '9223372036854775808'."); _counter++; } } ConfirmUInt64MaxValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmUInt64MaxValueCastToUInt64Overflows() { double from = 18446744073709551615.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)18446744073709551615.0)' did not throw OverflowException."); } ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt64IsFoldedCorrectly(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmDoubleOneDecrementUnderUInt64MaxValueCastToUInt64IsFoldedCorrectly() { double doubleOneDecrementUnderUInt64MaxValue = 1.844674407370955E+19d; if (BreakUpFlow()) return; if (checked((ulong)doubleOneDecrementUnderUInt64MaxValue) != 18446744073709549568) { Console.WriteLine($"'(ulong)1.844674407370955E+19d' was evaluted to '{(ulong)doubleOneDecrementUnderUInt64MaxValue}'. Expected: '18446744073709549568'."); _counter++; } } ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt64Overflows(); [MethodImpl(MethodImplOptions.NoInlining)] static void ConfirmIntegerOneDecrementUnderUInt64MaxValueCastToUInt64Overflows() { double from = 18446744073709551614.0; _counter++; try { _ = checked((ulong)from); } catch (OverflowException) { _counter--; } if (_counter != 100) Console.WriteLine("'checked((ulong)18446744073709551614.0)' did not throw OverflowException."); } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/Loader/classloader/generics/GenericMethods/method001c.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="method001c.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <OutputType>Exe</OutputType> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="method001c.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/Loader/classloader/RefFields/Validate.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using InvalidCSharp; using Xunit; class Validate { [StructLayout(LayoutKind.Explicit)] private ref struct Explicit { [FieldOffset(0)] public Span<byte> Bytes; [FieldOffset(0)] public Guid Guid; } [Fact] public static void Validate_Invalid_RefField_Fails() { Console.WriteLine($"{nameof(Validate_Invalid_RefField_Fails)}..."); Assert.Throws<TypeLoadException>(() => { var t = typeof(InvalidStructWithRefField); }); Assert.Throws<TypeLoadException>(() => { var t = typeof(InvalidRefFieldAlignment); }); Assert.Throws<TypeLoadException>(() => { var t = typeof(InvalidObjectRefRefFieldOverlap); }); Assert.Throws<TypeLoadException>(() => { var t = new IntPtrRefFieldOverlap() { Field = IntPtr.Zero }; return t.Field.ToString(); }); Assert.Throws<TypeLoadException>(() => { var t = new IntPtrOverlapWithInnerFieldType() { Field = IntPtr.Zero }; ref var i = ref t.Invalid; return i.Size; }); Assert.Throws<TypeLoadException>(() => { var t = new Explicit() { Guid = Guid.NewGuid() }; return t.Bytes.Length; }); } [Fact] public static void Validate_RefStructWithRefField_Load() { Console.WriteLine($"{nameof(Validate_RefStructWithRefField_Load)}..."); var t = typeof(WithRefField); } [MethodImpl(MethodImplOptions.NoInlining)] private static void Create_RefField_Worker(string str, int depth) { if (depth == 5) { return; } WithRefField s = new(ref str); string newStr = new(str); Create_RefField_Worker(str + $" {depth}", depth + 1); Assert.False(s.ConfirmFieldInstance(newStr)); Assert.True(s.ConfirmFieldInstance(str)); } [Fact] public static void Validate_Create_RefField() { var str = nameof(Validate_Create_RefField); Console.WriteLine($"{str}..."); Create_RefField_Worker(str, 1); } [MethodImpl(MethodImplOptions.NoInlining)] private static void Create_RefStructField_Worker(string str, int depth) { if (depth == 5) { return; } WithRefField s = new(ref str); WithRefStructField t = new(ref s); Create_RefStructField_Worker(str + $" {depth}", depth + 1); Assert.True(t.ConfirmFieldInstance(ref s)); } [Fact] public static void Validate_Create_RefStructField() { var str = nameof(Validate_Create_RefStructField); Console.WriteLine($"{str}..."); Create_RefStructField_Worker(str, 1); } [MethodImpl(MethodImplOptions.NoInlining)] private static void Create_TypedReferenceRefField_Worker(Validate v, int depth) { if (depth == 5) { return; } WithTypedReferenceField<Validate> s = new(ref v); Create_TypedReferenceRefField_Worker(v, depth + 1); Assert.Equal(typeof(Validate), s.GetFieldType()); Assert.True(s.ConfirmFieldInstance(v)); } [Fact] public static void Validate_Create_TypedReferenceRefField() { Console.WriteLine($"{nameof(Validate_Create_TypedReferenceRefField)}..."); Validate v = new(); Create_TypedReferenceRefField_Worker(v, 1); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using InvalidCSharp; using Xunit; class Validate { [StructLayout(LayoutKind.Explicit)] private ref struct Explicit { [FieldOffset(0)] public Span<byte> Bytes; [FieldOffset(0)] public Guid Guid; } [Fact] public static void Validate_Invalid_RefField_Fails() { Console.WriteLine($"{nameof(Validate_Invalid_RefField_Fails)}..."); Assert.Throws<TypeLoadException>(() => { var t = typeof(InvalidStructWithRefField); }); Assert.Throws<TypeLoadException>(() => { var t = typeof(InvalidRefFieldAlignment); }); Assert.Throws<TypeLoadException>(() => { var t = typeof(InvalidObjectRefRefFieldOverlap); }); Assert.Throws<TypeLoadException>(() => { var t = new IntPtrRefFieldOverlap() { Field = IntPtr.Zero }; return t.Field.ToString(); }); Assert.Throws<TypeLoadException>(() => { var t = new IntPtrOverlapWithInnerFieldType() { Field = IntPtr.Zero }; ref var i = ref t.Invalid; return i.Size; }); Assert.Throws<TypeLoadException>(() => { var t = new Explicit() { Guid = Guid.NewGuid() }; return t.Bytes.Length; }); } [Fact] public static void Validate_RefStructWithRefField_Load() { Console.WriteLine($"{nameof(Validate_RefStructWithRefField_Load)}..."); var t = typeof(WithRefField); } [MethodImpl(MethodImplOptions.NoInlining)] private static void Create_RefField_Worker(string str, int depth) { if (depth == 5) { return; } WithRefField s = new(ref str); string newStr = new(str); Create_RefField_Worker(str + $" {depth}", depth + 1); Assert.False(s.ConfirmFieldInstance(newStr)); Assert.True(s.ConfirmFieldInstance(str)); } [Fact] public static void Validate_Create_RefField() { var str = nameof(Validate_Create_RefField); Console.WriteLine($"{str}..."); Create_RefField_Worker(str, 1); } [MethodImpl(MethodImplOptions.NoInlining)] private static void Create_RefStructField_Worker(string str, int depth) { if (depth == 5) { return; } WithRefField s = new(ref str); WithRefStructField t = new(ref s); Create_RefStructField_Worker(str + $" {depth}", depth + 1); Assert.True(t.ConfirmFieldInstance(ref s)); } [Fact] public static void Validate_Create_RefStructField() { var str = nameof(Validate_Create_RefStructField); Console.WriteLine($"{str}..."); Create_RefStructField_Worker(str, 1); } [MethodImpl(MethodImplOptions.NoInlining)] private static void Create_TypedReferenceRefField_Worker(Validate v, int depth) { if (depth == 5) { return; } WithTypedReferenceField<Validate> s = new(ref v); Create_TypedReferenceRefField_Worker(v, depth + 1); Assert.Equal(typeof(Validate), s.GetFieldType()); Assert.True(s.ConfirmFieldInstance(v)); } [Fact] public static void Validate_Create_TypedReferenceRefField() { Console.WriteLine($"{nameof(Validate_Create_TypedReferenceRefField)}..."); Validate v = new(); Create_TypedReferenceRefField_Worker(v, 1); } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/Methodical/int64/unsigned/ldsfld_mulovf_il_r.ilproj
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="ldsfld_mulovf.il" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> </PropertyGroup> <PropertyGroup> <DebugType>PdbOnly</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="ldsfld_mulovf.il" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/TestClasses/MessageTestExtensions.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #pragma warning disable SYSLIB0027 namespace Microsoft.Extensions.Logging.Generators.Tests.TestClasses { internal static partial class MessageTestExtensions { [LoggerMessage(EventId = 0, Level = LogLevel.Trace)] public static partial void M0(ILogger logger); [LoggerMessage(EventId = 1, Level = LogLevel.Debug, Message = "")] public static partial void M1(ILogger logger); #if false // Diagnostics produced by source generators do not respect the /warnAsError or /noWarn compiler flags. // Disabled due to https://github.com/dotnet/roslyn/issues/52527 // // These are handled fine by the logger generator and generate warnings. Unfortunately, the above warning suppression is // not being observed by the C# compiler at the moment, so having these here causes build warnings. [LoggerMessage(EventId = 2, Level = LogLevel.Trace)] public static partial void M2(ILogger logger, string p1, string p2); [LoggerMessage(EventId = 3, Level = LogLevel.Debug, Message = "")] public static partial void M3(ILogger logger, string p1, int p2); [LoggerMessage(EventId = 4, Level = LogLevel.Debug, Message = "{p1}")] public static partial void M4(ILogger logger, string p1, int p2, int p3); #endif [LoggerMessage] public static partial void M5(ILogger logger, LogLevel level); [LoggerMessage(EventId = 6, Message = "")] public static partial void M6(ILogger logger, LogLevel level); [LoggerMessage(EventId = 7, Message = "\"{Value1}\" -> \"{Value2}\"")] public static partial void M7(ILogger logger, LogLevel logLevel, string value1, string value2); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #pragma warning disable SYSLIB0027 namespace Microsoft.Extensions.Logging.Generators.Tests.TestClasses { internal static partial class MessageTestExtensions { [LoggerMessage(EventId = 0, Level = LogLevel.Trace)] public static partial void M0(ILogger logger); [LoggerMessage(EventId = 1, Level = LogLevel.Debug, Message = "")] public static partial void M1(ILogger logger); #if false // Diagnostics produced by source generators do not respect the /warnAsError or /noWarn compiler flags. // Disabled due to https://github.com/dotnet/roslyn/issues/52527 // // These are handled fine by the logger generator and generate warnings. Unfortunately, the above warning suppression is // not being observed by the C# compiler at the moment, so having these here causes build warnings. [LoggerMessage(EventId = 2, Level = LogLevel.Trace)] public static partial void M2(ILogger logger, string p1, string p2); [LoggerMessage(EventId = 3, Level = LogLevel.Debug, Message = "")] public static partial void M3(ILogger logger, string p1, int p2); [LoggerMessage(EventId = 4, Level = LogLevel.Debug, Message = "{p1}")] public static partial void M4(ILogger logger, string p1, int p2, int p3); #endif [LoggerMessage] public static partial void M5(ILogger logger, LogLevel level); [LoggerMessage(EventId = 6, Message = "")] public static partial void M6(ILogger logger, LogLevel level); [LoggerMessage(EventId = 7, Message = "\"{Value1}\" -> \"{Value2}\"")] public static partial void M7(ILogger logger, LogLevel logLevel, string value1, string value2); } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./eng/pipelines/coreclr/nativeaot-post-build-steps.yml
parameters: buildConfig: '' archType: '' osGroup: '' osSubgroup: '' platform: '' pgoType: '' runtimeVariant: '' uploadTests: false testFilter: tree nativeaot runSingleFileTests: true steps: # Can't run arm/arm64 tests on x64 build machines - ${{ if and(ne(parameters.archType, 'arm'), ne(parameters.archType, 'arm64')) }}: # Build coreclr native test output - ${{ if eq(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/tests/build.cmd nativeaot $(buildConfigUpper) ${{ parameters.archType }} ${{ parameters.testFilter }} /p:BuildNativeAotFrameworkObjects=true displayName: Build tests - ${{ if ne(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/tests/build.sh nativeaot $(buildConfigUpper) ${{ parameters.archType }} '${{ parameters.testFilter }}' displayName: Build tests - ${{ if eq(parameters.runSingleFileTests, true) }}: - ${{ if eq(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/tests/run.cmd runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} displayName: Run tests in single file mode - ${{ if ne(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/tests/run.sh --runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} displayName: Run tests in single file mode
parameters: buildConfig: '' archType: '' osGroup: '' osSubgroup: '' platform: '' pgoType: '' runtimeVariant: '' uploadTests: false testFilter: tree nativeaot runSingleFileTests: true steps: # Can't run arm/arm64 tests on x64 build machines - ${{ if and(ne(parameters.archType, 'arm'), ne(parameters.archType, 'arm64')) }}: # Build coreclr native test output - ${{ if eq(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/tests/build.cmd nativeaot $(buildConfigUpper) ${{ parameters.archType }} ${{ parameters.testFilter }} /p:BuildNativeAotFrameworkObjects=true displayName: Build tests - ${{ if ne(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/tests/build.sh nativeaot $(buildConfigUpper) ${{ parameters.archType }} '${{ parameters.testFilter }}' displayName: Build tests - ${{ if eq(parameters.runSingleFileTests, true) }}: - ${{ if eq(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/tests/run.cmd runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} displayName: Run tests in single file mode - ${{ if ne(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/tests/run.sh --runnativeaottests $(buildConfigUpper) ${{ parameters.archType }} displayName: Run tests in single file mode
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/Methodical/eh/nested/cascadedcatchret/cascadedexcept_il_d.ilproj
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> </PropertyGroup> <PropertyGroup> <DebugType>Full</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="cascadedexcept.il" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\..\..\common\eh_common.csproj" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk.IL"> <PropertyGroup> <OutputType>Exe</OutputType> </PropertyGroup> <PropertyGroup> <DebugType>Full</DebugType> </PropertyGroup> <ItemGroup> <Compile Include="cascadedexcept.il" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\..\..\common\eh_common.csproj" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector256BooleanGetElementNegativeOne.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics\General\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; namespace JIT.HardwareIntrinsics.General { public static partial class Program { private static void Vector256BooleanGetElementNegativeOne() { bool succeeded = false; try { bool result = default(Vector256<bool>).GetElement(-1); } catch (NotSupportedException) { succeeded = true; } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"Vector256BooleanGetElementNegativeOne: RunNotSupportedScenario failed to throw NotSupportedException."); TestLibrary.TestFramework.LogInformation(string.Empty); throw new Exception("One or more scenarios did not complete as expected."); } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics\General\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; namespace JIT.HardwareIntrinsics.General { public static partial class Program { private static void Vector256BooleanGetElementNegativeOne() { bool succeeded = false; try { bool result = default(Vector256<bool>).GetElement(-1); } catch (NotSupportedException) { succeeded = true; } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"Vector256BooleanGetElementNegativeOne: RunNotSupportedScenario failed to throw NotSupportedException."); TestLibrary.TestFramework.LogInformation(string.Empty); throw new Exception("One or more scenarios did not complete as expected."); } } } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/opt/OSR/mainlooptry3.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // Tricky case for OSR with patchpoint in try region. // // If we need to OSR at inner loop head, then both try // regions need trimming, but they can't trim down to the // same block, and the branch to the logical trimmed // entry point is not from the OSR entry. using System; class MainLoopCloselyNestedTry { public static int Main() { Console.WriteLine($"starting sum"); int result = 0; try { try { int temp = 0; for (int i = 0; i < 1_000; i++) { for (int j = 0; j < 1_000; j++) { temp += 1000 * i + j; } } result = temp; } catch (Exception) { } } finally { Console.WriteLine($"done, sum is {result}"); } return result == 1783293664 ? 100 : -1; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // Tricky case for OSR with patchpoint in try region. // // If we need to OSR at inner loop head, then both try // regions need trimming, but they can't trim down to the // same block, and the branch to the logical trimmed // entry point is not from the OSR entry. using System; class MainLoopCloselyNestedTry { public static int Main() { Console.WriteLine($"starting sum"); int result = 0; try { try { int temp = 0; for (int i = 0; i < 1_000; i++) { for (int j = 0; j < 1_000; j++) { temp += 1000 * i + j; } } result = temp; } catch (Exception) { } } finally { Console.WriteLine($"done, sum is {result}"); } return result == 1783293664 ? 100 : -1; } }
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/coreclr/inc/releaseholder.h
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // This class acts a smart pointer which calls the Release method on any object // you place in it when the ReleaseHolder class falls out of scope. You may use it // just like you would a standard pointer to a COM object (including if (foo), // if (!foo), if (foo == 0), etc) except for two caveats: // 1. This class never calls AddRef and it always calls Release when it // goes out of scope. // 2. You should never use & to try to get a pointer to a pointer unless // you call Release first, or you will leak whatever this object contains // prior to updating its internal pointer. template<class T> class ReleaseHolder { public: ReleaseHolder() : m_ptr(NULL) {} ReleaseHolder(T* ptr) : m_ptr(ptr) {} ~ReleaseHolder() { Release(); } void operator=(T *ptr) { Release(); m_ptr = ptr; } T* operator->() { return m_ptr; } operator T*() { return m_ptr; } T** operator&() { return &m_ptr; } T* GetPtr() const { return m_ptr; } T* Detach() { T* pT = m_ptr; m_ptr = NULL; return pT; } void Release() { if (m_ptr != NULL) { m_ptr->Release(); m_ptr = NULL; } } private: T* m_ptr; };
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // This class acts a smart pointer which calls the Release method on any object // you place in it when the ReleaseHolder class falls out of scope. You may use it // just like you would a standard pointer to a COM object (including if (foo), // if (!foo), if (foo == 0), etc) except for two caveats: // 1. This class never calls AddRef and it always calls Release when it // goes out of scope. // 2. You should never use & to try to get a pointer to a pointer unless // you call Release first, or you will leak whatever this object contains // prior to updating its internal pointer. template<class T> class ReleaseHolder { public: ReleaseHolder() : m_ptr(NULL) {} ReleaseHolder(T* ptr) : m_ptr(ptr) {} ~ReleaseHolder() { Release(); } void operator=(T *ptr) { Release(); m_ptr = ptr; } T* operator->() { return m_ptr; } operator T*() { return m_ptr; } T** operator&() { return &m_ptr; } T* GetPtr() const { return m_ptr; } T* Detach() { T* pT = m_ptr; m_ptr = NULL; return pT; } void Release() { if (m_ptr != NULL) { m_ptr->Release(); m_ptr = NULL; } } private: T* m_ptr; };
-1
dotnet/runtime
66,084
Add support for static virtual methods
Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
MichalStrehovsky
2022-03-02T14:32:50Z
2022-03-03T07:30:19Z
7b83da5eb2bb247e400d2b8f66bea79c41332db8
8dcfacbdec618924f36a95688173a7c1c101592f
Add support for static virtual methods. Took the type system changes from #54063 and cleaned them up, added unit tests. Hooked it up into JitInterface/ResolveConstraintMethodApprox. Using the pre-existing `ConstrainedMethodUseLookupResult` that wasn't currently getting emitted. We'll want to use it for its original purpose at some point, but I think we can make this work for both instance and static constrained calls. Missing things: * Support creating delegates to static virtual methods. This will need a RyuJIT/JitInterface change. * Type loader support. If `MakeGeneric` needs static virtuals at runtime, it will throw. But this is enough to get HttpClient working again. Fixes #65613. Contributes to dotnet/runtimelab#1665.
./src/tests/JIT/HardwareIntrinsics/X86/Sse1/UnpackLow_r.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> <PropertyGroup> <DebugType>Embedded</DebugType> <Optimize /> </PropertyGroup> <ItemGroup> <Compile Include="UnpackLow.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> </PropertyGroup> <PropertyGroup> <DebugType>Embedded</DebugType> <Optimize /> </PropertyGroup> <ItemGroup> <Compile Include="UnpackLow.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./eng/ApiCompatExcludeAttributes.txt
T:System.CLSCompliantAttribute T:System.Diagnostics.CodeAnalysis.MemberNotNullAttribute T:System.Diagnostics.DebuggerGuidedStepThroughAttribute T:System.Runtime.CompilerServices.EagerStaticClassConstructionAttribute
T:System.Diagnostics.CodeAnalysis.MemberNotNullAttribute T:System.Diagnostics.DebuggerGuidedStepThroughAttribute T:System.Runtime.CompilerServices.EagerStaticClassConstructionAttribute
1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // ------------------------------------------------------------------------------ // Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System { public sealed partial class DataMisalignedException : System.SystemException { public DataMisalignedException() { } public DataMisalignedException(string? message) { } public DataMisalignedException(string? message, System.Exception? innerException) { } } public partial class DllNotFoundException : System.TypeLoadException { public DllNotFoundException() { } protected DllNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public DllNotFoundException(string? message) { } public DllNotFoundException(string? message, System.Exception? inner) { } } } namespace System.IO { public partial class UnmanagedMemoryAccessor : System.IDisposable { protected UnmanagedMemoryAccessor() { } public UnmanagedMemoryAccessor(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long capacity) { } public UnmanagedMemoryAccessor(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long capacity, System.IO.FileAccess access) { } public bool CanRead { get { throw null; } } public bool CanWrite { get { throw null; } } public long Capacity { get { throw null; } } protected bool IsOpen { get { throw null; } } public void Dispose() { } protected virtual void Dispose(bool disposing) { } protected void Initialize(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long capacity, System.IO.FileAccess access) { } public int ReadArray<T>(long position, T[] array, int offset, int count) where T : struct { throw null; } public bool ReadBoolean(long position) { throw null; } public byte ReadByte(long position) { throw null; } public char ReadChar(long position) { throw null; } public decimal ReadDecimal(long position) { throw null; } public double ReadDouble(long position) { throw null; } public short ReadInt16(long position) { throw null; } public int ReadInt32(long position) { throw null; } public long ReadInt64(long position) { throw null; } [System.CLSCompliantAttribute(false)] public sbyte ReadSByte(long position) { throw null; } public float ReadSingle(long position) { throw null; } [System.CLSCompliantAttribute(false)] public ushort ReadUInt16(long position) { throw null; } [System.CLSCompliantAttribute(false)] public uint ReadUInt32(long position) { throw null; } [System.CLSCompliantAttribute(false)] public ulong ReadUInt64(long position) { throw null; } public void Read<T>(long position, out T structure) where T : struct { throw null; } public void Write(long position, bool value) { } public void Write(long position, byte value) { } public void Write(long position, char value) { } public void Write(long position, decimal value) { } public void Write(long position, double value) { } public void Write(long position, short value) { } public void Write(long position, int value) { } public void Write(long position, long value) { } [System.CLSCompliantAttribute(false)] public void Write(long position, sbyte value) { } public void Write(long position, float value) { } [System.CLSCompliantAttribute(false)] public void Write(long position, ushort value) { } [System.CLSCompliantAttribute(false)] public void Write(long position, uint value) { } [System.CLSCompliantAttribute(false)] public void Write(long position, ulong value) { } public void WriteArray<T>(long position, T[] array, int offset, int count) where T : struct { } public void Write<T>(long position, ref T structure) where T : struct { } } } namespace System.Runtime.CompilerServices { [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)] public sealed partial class IDispatchConstantAttribute : System.Runtime.CompilerServices.CustomConstantAttribute { public IDispatchConstantAttribute() { } public override object Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)] public sealed partial class IUnknownConstantAttribute : System.Runtime.CompilerServices.CustomConstantAttribute { public IUnknownConstantAttribute() { } public override object Value { get { throw null; } } } } namespace System.Runtime.InteropServices { [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] [System.AttributeUsageAttribute(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)] public sealed partial class AllowReversePInvokeCallsAttribute : System.Attribute { public AllowReversePInvokeCallsAttribute() { } } public readonly partial struct ArrayWithOffset : System.IEquatable<System.Runtime.InteropServices.ArrayWithOffset> { private readonly object _dummy; private readonly int _dummyPrimitive; public ArrayWithOffset(object? array, int offset) { throw null; } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public bool Equals(System.Runtime.InteropServices.ArrayWithOffset obj) { throw null; } public object? GetArray() { throw null; } public override int GetHashCode() { throw null; } public int GetOffset() { throw null; } public static bool operator ==(System.Runtime.InteropServices.ArrayWithOffset a, System.Runtime.InteropServices.ArrayWithOffset b) { throw null; } public static bool operator !=(System.Runtime.InteropServices.ArrayWithOffset a, System.Runtime.InteropServices.ArrayWithOffset b) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Interface, Inherited=false)] public sealed partial class AutomationProxyAttribute : System.Attribute { public AutomationProxyAttribute(bool val) { } public bool Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.Struct, Inherited=false)] public sealed partial class BestFitMappingAttribute : System.Attribute { public bool ThrowOnUnmappableChar; public BestFitMappingAttribute(bool BestFitMapping) { } public bool BestFitMapping { get { throw null; } } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class BStrWrapper { public BStrWrapper(object? value) { } public BStrWrapper(string? value) { } public string? WrappedObject { get { throw null; } } } public enum CallingConvention { Winapi = 1, Cdecl = 2, StdCall = 3, ThisCall = 4, FastCall = 5, } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class, Inherited=false)] public sealed partial class ClassInterfaceAttribute : System.Attribute { public ClassInterfaceAttribute(short classInterfaceType) { } public ClassInterfaceAttribute(System.Runtime.InteropServices.ClassInterfaceType classInterfaceType) { } public System.Runtime.InteropServices.ClassInterfaceType Value { get { throw null; } } } public enum ClassInterfaceType { None = 0, [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("Support for IDispatch may be unavailable in future releases.")] AutoDispatch = 1, [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("Support for IDispatch may be unavailable in future releases.")] AutoDual = 2, } [System.CLSCompliantAttribute(false)] public readonly partial struct CLong : System.IEquatable<System.Runtime.InteropServices.CLong> { private readonly int _dummyPrimitive; public CLong(int value) { throw null; } public CLong(nint value) { throw null; } public nint Value { get { throw null; } } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; } public bool Equals(System.Runtime.InteropServices.CLong other) { throw null; } public override int GetHashCode() { throw null; } public override string ToString() { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited=false)] public sealed partial class CoClassAttribute : System.Attribute { public CoClassAttribute(System.Type coClass) { } public System.Type CoClass { get { throw null; } } } public static partial class CollectionsMarshal { public static System.Span<T> AsSpan<T>(System.Collections.Generic.List<T>? list) { throw null; } public static ref TValue GetValueRefOrNullRef<TKey, TValue>(System.Collections.Generic.Dictionary<TKey, TValue> dictionary, TKey key) where TKey : notnull { throw null; } public static ref TValue? GetValueRefOrAddDefault<TKey, TValue>(System.Collections.Generic.Dictionary<TKey, TValue> dictionary, TKey key, out bool exists) where TKey : notnull { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue, Inherited=false)] public sealed partial class ComAliasNameAttribute : System.Attribute { public ComAliasNameAttribute(string alias) { } public string Value { get { throw null; } } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class ComAwareEventInfo : System.Reflection.EventInfo { public ComAwareEventInfo([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)] System.Type type, string eventName) { } public override System.Reflection.EventAttributes Attributes { get { throw null; } } public override System.Type? DeclaringType { get { throw null; } } public override int MetadataToken { get { throw null; } } public override System.Reflection.Module Module { get { throw null; } } public override string Name { get { throw null; } } public override System.Type? ReflectedType { get { throw null; } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public override void AddEventHandler(object target, System.Delegate handler) { } public override System.Reflection.MethodInfo? GetAddMethod(bool nonPublic) { throw null; } public override object[] GetCustomAttributes(bool inherit) { throw null; } public override object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; } public override System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData() { throw null; } public override System.Reflection.MethodInfo[] GetOtherMethods(bool nonPublic) { throw null; } public override System.Reflection.MethodInfo? GetRaiseMethod(bool nonPublic) { throw null; } public override System.Reflection.MethodInfo? GetRemoveMethod(bool nonPublic) { throw null; } public override bool IsDefined(System.Type attributeType, bool inherit) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public override void RemoveEventHandler(object target, System.Delegate handler) { } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)] public sealed partial class ComCompatibleVersionAttribute : System.Attribute { public ComCompatibleVersionAttribute(int major, int minor, int build, int revision) { } public int BuildNumber { get { throw null; } } public int MajorVersion { get { throw null; } } public int MinorVersion { get { throw null; } } public int RevisionNumber { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false)] public sealed partial class ComConversionLossAttribute : System.Attribute { public ComConversionLossAttribute() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=false)] public sealed partial class ComDefaultInterfaceAttribute : System.Attribute { public ComDefaultInterfaceAttribute(System.Type defaultInterface) { } public System.Type Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited=false)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class ComEventInterfaceAttribute : System.Attribute { public ComEventInterfaceAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] System.Type SourceInterface, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] System.Type EventProvider) { } [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] public System.Type EventProvider { get { throw null; } } [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] public System.Type SourceInterface { get { throw null; } } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static partial class ComEventsHelper { public static void Combine(object rcw, System.Guid iid, int dispid, System.Delegate d) { } public static System.Delegate? Remove(object rcw, System.Guid iid, int dispid, System.Delegate d) { throw null; } } public partial class COMException : System.Runtime.InteropServices.ExternalException { public COMException() { } protected COMException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public COMException(string? message) { } public COMException(string? message, System.Exception? inner) { } public COMException(string? message, int errorCode) { } public override string ToString() { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Interface, Inherited=false)] public sealed partial class ComImportAttribute : System.Attribute { public ComImportAttribute() { } } public enum ComInterfaceType { InterfaceIsDual = 0, InterfaceIsIUnknown = 1, InterfaceIsIDispatch = 2, InterfaceIsIInspectable = 3, } public enum ComMemberType { Method = 0, PropGet = 1, PropSet = 2, } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class ComRegisterFunctionAttribute : System.Attribute { public ComRegisterFunctionAttribute() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=true)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class ComSourceInterfacesAttribute : System.Attribute { public ComSourceInterfacesAttribute(string sourceInterfaces) { } public ComSourceInterfacesAttribute(System.Type sourceInterface) { } public ComSourceInterfacesAttribute(System.Type sourceInterface1, System.Type sourceInterface2) { } public ComSourceInterfacesAttribute(System.Type sourceInterface1, System.Type sourceInterface2, System.Type sourceInterface3) { } public ComSourceInterfacesAttribute(System.Type sourceInterface1, System.Type sourceInterface2, System.Type sourceInterface3, System.Type sourceInterface4) { } public string Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class ComUnregisterFunctionAttribute : System.Attribute { public ComUnregisterFunctionAttribute() { } } [System.CLSCompliantAttribute(false)] public readonly partial struct CULong : System.IEquatable<System.Runtime.InteropServices.CULong> { private readonly int _dummyPrimitive; public CULong(uint value) { throw null; } public CULong(nuint value) { throw null; } public nuint Value { get { throw null; } } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; } public bool Equals(System.Runtime.InteropServices.CULong other) { throw null; } public override int GetHashCode() { throw null; } public override string ToString() { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("CurrencyWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.")] public sealed partial class CurrencyWrapper { public CurrencyWrapper(decimal obj) { } public CurrencyWrapper(object obj) { } public decimal WrappedObject { get { throw null; } } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum CustomQueryInterfaceMode { Ignore = 0, Allow = 1, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum CustomQueryInterfaceResult { Handled = 0, NotHandled = 1, Failed = 2, } [System.AttributeUsageAttribute(System.AttributeTargets.Module, Inherited=false)] public sealed partial class DefaultCharSetAttribute : System.Attribute { public DefaultCharSetAttribute(System.Runtime.InteropServices.CharSet charSet) { } public System.Runtime.InteropServices.CharSet CharSet { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Method, AllowMultiple=false)] public sealed partial class DefaultDllImportSearchPathsAttribute : System.Attribute { public DefaultDllImportSearchPathsAttribute(System.Runtime.InteropServices.DllImportSearchPath paths) { } public System.Runtime.InteropServices.DllImportSearchPath Paths { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Parameter)] public sealed partial class DefaultParameterValueAttribute : System.Attribute { public DefaultParameterValueAttribute(object? value) { } public object? Value { get { throw null; } } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class DispatchWrapper { public DispatchWrapper(object? obj) { } public object? WrappedObject { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)] public sealed partial class DispIdAttribute : System.Attribute { public DispIdAttribute(int dispId) { } public int Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class DllImportAttribute : System.Attribute { public bool BestFitMapping; public System.Runtime.InteropServices.CallingConvention CallingConvention; public System.Runtime.InteropServices.CharSet CharSet; public string? EntryPoint; public bool ExactSpelling; public bool PreserveSig; public bool SetLastError; public bool ThrowOnUnmappableChar; public DllImportAttribute(string dllName) { } public string Value { get { throw null; } } } public delegate System.IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportSearchPath? searchPath); [System.FlagsAttribute] public enum DllImportSearchPath { LegacyBehavior = 0, AssemblyDirectory = 2, UseDllDirectoryForDependencies = 256, ApplicationDirectory = 512, UserDirectories = 1024, System32 = 2048, SafeDirectories = 4096, } [System.AttributeUsageAttribute(System.AttributeTargets.Interface, AllowMultiple=false, Inherited=false)] public sealed class DynamicInterfaceCastableImplementationAttribute : Attribute { public DynamicInterfaceCastableImplementationAttribute() { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class ErrorWrapper { public ErrorWrapper(System.Exception e) { } public ErrorWrapper(int errorCode) { } public ErrorWrapper(object errorCode) { } public int ErrorCode { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, Inherited=false)] public sealed partial class GuidAttribute : System.Attribute { public GuidAttribute(string guid) { } public string Value { get { throw null; } } } public sealed partial class HandleCollector { public HandleCollector(string? name, int initialThreshold) { } public HandleCollector(string? name, int initialThreshold, int maximumThreshold) { } public int Count { get { throw null; } } public int InitialThreshold { get { throw null; } } public int MaximumThreshold { get { throw null; } } public string Name { get { throw null; } } public void Add() { } public void Remove() { } } public readonly partial struct HandleRef { private readonly object _dummy; private readonly int _dummyPrimitive; public HandleRef(object? wrapper, System.IntPtr handle) { throw null; } public System.IntPtr Handle { get { throw null; } } public object? Wrapper { get { throw null; } } public static explicit operator System.IntPtr (System.Runtime.InteropServices.HandleRef value) { throw null; } public static System.IntPtr ToIntPtr(System.Runtime.InteropServices.HandleRef value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial interface ICustomAdapter { object GetUnderlyingObject(); } public partial interface ICustomFactory { System.MarshalByRefObject CreateInstance(System.Type serverType); } public partial interface ICustomMarshaler { void CleanUpManagedData(object ManagedObj); void CleanUpNativeData(System.IntPtr pNativeData); int GetNativeDataSize(); System.IntPtr MarshalManagedToNative(object ManagedObj); object MarshalNativeToManaged(System.IntPtr pNativeData); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial interface ICustomQueryInterface { System.Runtime.InteropServices.CustomQueryInterfaceResult GetInterface(ref System.Guid iid, out System.IntPtr ppv); } public partial interface IDynamicInterfaceCastable { bool IsInterfaceImplemented(System.RuntimeTypeHandle interfaceType, bool throwIfNotImplemented); System.RuntimeTypeHandle GetInterfaceImplementation(System.RuntimeTypeHandle interfaceType); } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)] public sealed partial class ImportedFromTypeLibAttribute : System.Attribute { public ImportedFromTypeLibAttribute(string tlbFile) { } public string Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited=false)] public sealed partial class InterfaceTypeAttribute : System.Attribute { public InterfaceTypeAttribute(short interfaceType) { } public InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType interfaceType) { } public System.Runtime.InteropServices.ComInterfaceType Value { get { throw null; } } } public partial class InvalidComObjectException : System.SystemException { public InvalidComObjectException() { } protected InvalidComObjectException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public InvalidComObjectException(string? message) { } public InvalidComObjectException(string? message, System.Exception? inner) { } } public partial class InvalidOleVariantTypeException : System.SystemException { public InvalidOleVariantTypeException() { } protected InvalidOleVariantTypeException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public InvalidOleVariantTypeException(string? message) { } public InvalidOleVariantTypeException(string? message, System.Exception? inner) { } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class LCIDConversionAttribute : System.Attribute { public LCIDConversionAttribute(int lcid) { } public int Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)] public sealed partial class ManagedToNativeComInteropStubAttribute : System.Attribute { public ManagedToNativeComInteropStubAttribute(System.Type classType, string methodName) { } public System.Type ClassType { get { throw null; } } public string MethodName { get { throw null; } } } public static partial class Marshal { public static readonly int SystemDefaultCharSize; public static readonly int SystemMaxDBCSCharSize; public static int AddRef(System.IntPtr pUnk) { throw null; } public static System.IntPtr AllocCoTaskMem(int cb) { throw null; } public static System.IntPtr AllocHGlobal(int cb) { throw null; } public static System.IntPtr AllocHGlobal(System.IntPtr cb) { throw null; } public static bool AreComObjectsAvailableForCleanup() { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object BindToMoniker(string monikerName) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void ChangeWrapperHandleStrength(object otp, bool fIsWeak) { } public static void CleanupUnusedObjectsInCurrentContext() { } public static void Copy(byte[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(char[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(double[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(short[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(int[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(long[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(System.IntPtr source, byte[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, char[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, double[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, short[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, int[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, long[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, System.IntPtr[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, float[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(float[] source, int startIndex, System.IntPtr destination, int length) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr CreateAggregatedObject(System.IntPtr pOuter, object o) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static System.IntPtr CreateAggregatedObject<T>(System.IntPtr pOuter, T o) where T : notnull { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("o")] public static object? CreateWrapperOfType(object? o, System.Type t) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static TWrapper CreateWrapperOfType<T, TWrapper>(T? o) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available. Use the DestroyStructure<T> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void DestroyStructure(System.IntPtr ptr, System.Type structuretype) { } public static void DestroyStructure<T>(System.IntPtr ptr) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static int FinalReleaseComObject(object o) { throw null; } public static void FreeBSTR(System.IntPtr ptr) { } public static void FreeCoTaskMem(System.IntPtr ptr) { } public static void FreeHGlobal(System.IntPtr hglobal) { } public static System.Guid GenerateGuidForType(System.Type type) { throw null; } public static string? GenerateProgIdForType(System.Type type) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr GetComInterfaceForObject(object o, System.Type T) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr GetComInterfaceForObject(object o, System.Type T, System.Runtime.InteropServices.CustomQueryInterfaceMode mode) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static System.IntPtr GetComInterfaceForObject<T, TInterface>([System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T o) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object? GetComObjectData(object obj, object key) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the delegate might not be available. Use the GetDelegateForFunctionPointer<TDelegate> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.Delegate GetDelegateForFunctionPointer(System.IntPtr ptr, System.Type t) { throw null; } public static TDelegate GetDelegateForFunctionPointer<TDelegate>(System.IntPtr ptr) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static int GetEndComSlot(System.Type t) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("GetExceptionCode() may be unavailable in future releases.")] public static int GetExceptionCode() { throw null; } public static System.Exception? GetExceptionForHR(int errorCode) { throw null; } public static System.Exception? GetExceptionForHR(int errorCode, System.IntPtr errorInfo) { throw null; } public static System.IntPtr GetExceptionPointers() { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the delegate might not be available. Use the GetFunctionPointerForDelegate<TDelegate> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr GetFunctionPointerForDelegate(System.Delegate d) { throw null; } public static System.IntPtr GetFunctionPointerForDelegate<TDelegate>(TDelegate d) where TDelegate : notnull { throw null; } public static System.IntPtr GetHINSTANCE(System.Reflection.Module m) { throw null; } public static int GetHRForException(System.Exception? e) { throw null; } public static int GetHRForLastWin32Error() { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static System.IntPtr GetIDispatchForObject(object o) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static System.IntPtr GetIUnknownForObject(object o) { throw null; } public static int GetLastPInvokeError() { throw null; } public static int GetLastSystemError() { throw null; } public static int GetLastWin32Error() { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void GetNativeVariantForObject(object? obj, System.IntPtr pDstNativeVariant) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void GetNativeVariantForObject<T>(T? obj, System.IntPtr pDstNativeVariant) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object GetObjectForIUnknown(System.IntPtr pUnk) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static object? GetObjectForNativeVariant(System.IntPtr pSrcNativeVariant) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static T? GetObjectForNativeVariant<T>(System.IntPtr pSrcNativeVariant) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static object?[] GetObjectsForNativeVariants(System.IntPtr aSrcNativeVariant, int cVars) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static T[] GetObjectsForNativeVariants<T>(System.IntPtr aSrcNativeVariant, int cVars) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static int GetStartComSlot(System.Type t) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object GetTypedObjectForIUnknown(System.IntPtr pUnk, System.Type t) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static System.Type? GetTypeFromCLSID(System.Guid clsid) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static string GetTypeInfoName(System.Runtime.InteropServices.ComTypes.ITypeInfo typeInfo) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object GetUniqueObjectForIUnknown(System.IntPtr unknown) { throw null; } public static void InitHandle(SafeHandle safeHandle, IntPtr handle) { } public static bool IsComObject(object o) { throw null; } public static bool IsTypeVisibleFromCom(System.Type t) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr OffsetOf(System.Type t, string fieldName) { throw null; } public static System.IntPtr OffsetOf<T>(string fieldName) { throw null; } public static void Prelink(System.Reflection.MethodInfo m) { } public static void PrelinkAll(System.Type c) { } public static string? PtrToStringAnsi(System.IntPtr ptr) { throw null; } public static string PtrToStringAnsi(System.IntPtr ptr, int len) { throw null; } public static string? PtrToStringAuto(System.IntPtr ptr) { throw null; } public static string? PtrToStringAuto(System.IntPtr ptr, int len) { throw null; } public static string PtrToStringBSTR(System.IntPtr ptr) { throw null; } public static string? PtrToStringUni(System.IntPtr ptr) { throw null; } public static string PtrToStringUni(System.IntPtr ptr, int len) { throw null; } public static string? PtrToStringUTF8(System.IntPtr ptr) { throw null; } public static string PtrToStringUTF8(System.IntPtr ptr, int byteLen) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void PtrToStructure(System.IntPtr ptr, object structure) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static object? PtrToStructure(System.IntPtr ptr, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors| System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type structureType) { throw null; } public static T? PtrToStructure<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]T>(System.IntPtr ptr) { throw null; } public static void PtrToStructure<T>(System.IntPtr ptr, [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T structure) { } public static int QueryInterface(System.IntPtr pUnk, ref System.Guid iid, out System.IntPtr ppv) { throw null; } public static byte ReadByte(System.IntPtr ptr) { throw null; } public static byte ReadByte(System.IntPtr ptr, int ofs) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("ReadByte(Object, Int32) may be unavailable in future releases.")] public static byte ReadByte(object ptr, int ofs) { throw null; } public static short ReadInt16(System.IntPtr ptr) { throw null; } public static short ReadInt16(System.IntPtr ptr, int ofs) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("ReadInt16(Object, Int32) may be unavailable in future releases.")] public static short ReadInt16(object ptr, int ofs) { throw null; } public static int ReadInt32(System.IntPtr ptr) { throw null; } public static int ReadInt32(System.IntPtr ptr, int ofs) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("ReadInt32(Object, Int32) may be unavailable in future releases.")] public static int ReadInt32(object ptr, int ofs) { throw null; } public static long ReadInt64(System.IntPtr ptr) { throw null; } public static long ReadInt64(System.IntPtr ptr, int ofs) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("ReadInt64(Object, Int32) may be unavailable in future releases.")] public static long ReadInt64(object ptr, int ofs) { throw null; } public static System.IntPtr ReadIntPtr(System.IntPtr ptr) { throw null; } public static System.IntPtr ReadIntPtr(System.IntPtr ptr, int ofs) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("ReadIntPtr(Object, Int32) may be unavailable in future releases.")] public static System.IntPtr ReadIntPtr(object ptr, int ofs) { throw null; } public static System.IntPtr ReAllocCoTaskMem(System.IntPtr pv, int cb) { throw null; } public static System.IntPtr ReAllocHGlobal(System.IntPtr pv, System.IntPtr cb) { throw null; } public static int Release(System.IntPtr pUnk) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static int ReleaseComObject(object o) { throw null; } public static System.IntPtr SecureStringToBSTR(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToCoTaskMemAnsi(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToCoTaskMemUnicode(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToGlobalAllocAnsi(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToGlobalAllocUnicode(System.Security.SecureString s) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static bool SetComObjectData(object obj, object key, object? data) { throw null; } public static void SetLastPInvokeError(int error) { throw null; } public static void SetLastSystemError(int error) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available. Use the SizeOf<T> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static int SizeOf(object structure) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available. Use the SizeOf<T> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static int SizeOf(System.Type t) { throw null; } public static int SizeOf<T>() { throw null; } public static int SizeOf<T>(T structure) { throw null; } public static System.IntPtr StringToBSTR(string? s) { throw null; } public static System.IntPtr StringToCoTaskMemAnsi(string? s) { throw null; } public static System.IntPtr StringToCoTaskMemAuto(string? s) { throw null; } public static System.IntPtr StringToCoTaskMemUni(string? s) { throw null; } public static System.IntPtr StringToCoTaskMemUTF8(string? s) { throw null; } public static System.IntPtr StringToHGlobalAnsi(string? s) { throw null; } public static System.IntPtr StringToHGlobalAuto(string? s) { throw null; } public static System.IntPtr StringToHGlobalUni(string? s) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available. Use the StructureToPtr<T> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void StructureToPtr(object structure, System.IntPtr ptr, bool fDeleteOld) { } public static void StructureToPtr<T>([System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T structure, System.IntPtr ptr, bool fDeleteOld) { } public static void ThrowExceptionForHR(int errorCode) { } public static void ThrowExceptionForHR(int errorCode, System.IntPtr errorInfo) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr UnsafeAddrOfPinnedArrayElement(System.Array arr, int index) { throw null; } public static System.IntPtr UnsafeAddrOfPinnedArrayElement<T>(T[] arr, int index) { throw null; } public static void WriteByte(System.IntPtr ptr, byte val) { } public static void WriteByte(System.IntPtr ptr, int ofs, byte val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteByte(Object, Int32, Byte) may be unavailable in future releases.")] public static void WriteByte(object ptr, int ofs, byte val) { } public static void WriteInt16(System.IntPtr ptr, char val) { } public static void WriteInt16(System.IntPtr ptr, short val) { } public static void WriteInt16(System.IntPtr ptr, int ofs, char val) { } public static void WriteInt16(System.IntPtr ptr, int ofs, short val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteInt16(Object, Int32, Char) may be unavailable in future releases.")] public static void WriteInt16(object ptr, int ofs, char val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteInt16(Object, Int32, Int16) may be unavailable in future releases.")] public static void WriteInt16(object ptr, int ofs, short val) { } public static void WriteInt32(System.IntPtr ptr, int val) { } public static void WriteInt32(System.IntPtr ptr, int ofs, int val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteInt32(Object, Int32, Int32) may be unavailable in future releases.")] public static void WriteInt32(object ptr, int ofs, int val) { } public static void WriteInt64(System.IntPtr ptr, int ofs, long val) { } public static void WriteInt64(System.IntPtr ptr, long val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteInt64(Object, Int32, Int64) may be unavailable in future releases.")] public static void WriteInt64(object ptr, int ofs, long val) { } public static void WriteIntPtr(System.IntPtr ptr, int ofs, System.IntPtr val) { } public static void WriteIntPtr(System.IntPtr ptr, System.IntPtr val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteIntPtr(Object, Int32, IntPtr) may be unavailable in future releases.")] public static void WriteIntPtr(object ptr, int ofs, System.IntPtr val) { } public static void ZeroFreeBSTR(System.IntPtr s) { } public static void ZeroFreeCoTaskMemAnsi(System.IntPtr s) { } public static void ZeroFreeCoTaskMemUnicode(System.IntPtr s) { } public static void ZeroFreeCoTaskMemUTF8(System.IntPtr s) { } public static void ZeroFreeGlobalAllocAnsi(System.IntPtr s) { } public static void ZeroFreeGlobalAllocUnicode(System.IntPtr s) { } } [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue, Inherited=false)] public sealed partial class MarshalAsAttribute : System.Attribute { public System.Runtime.InteropServices.UnmanagedType ArraySubType; public int IidParameterIndex; public string? MarshalCookie; public string? MarshalType; public System.Type? MarshalTypeRef; public System.Runtime.InteropServices.VarEnum SafeArraySubType; public System.Type? SafeArrayUserDefinedSubType; public int SizeConst; public short SizeParamIndex; public MarshalAsAttribute(short unmanagedType) { } public MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType unmanagedType) { } public System.Runtime.InteropServices.UnmanagedType Value { get { throw null; } } } public partial class MarshalDirectiveException : System.SystemException { public MarshalDirectiveException() { } protected MarshalDirectiveException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public MarshalDirectiveException(string? message) { } public MarshalDirectiveException(string? message, System.Exception? inner) { } } public static partial class NativeLibrary { public static void Free(System.IntPtr handle) { } public static System.IntPtr GetExport(System.IntPtr handle, string name) { throw null; } public static System.IntPtr Load(string libraryPath) { throw null; } public static System.IntPtr Load(string libraryName, System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportSearchPath? searchPath) { throw null; } public static void SetDllImportResolver(System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportResolver resolver) { } public static bool TryGetExport(System.IntPtr handle, string name, out System.IntPtr address) { throw null; } public static bool TryLoad(string libraryPath, out System.IntPtr handle) { throw null; } public static bool TryLoad(string libraryName, System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportSearchPath? searchPath, out System.IntPtr handle) { throw null; } } public static unsafe partial class NativeMemory { [System.CLSCompliantAttribute(false)] public static void* AlignedAlloc(nuint byteCount, nuint alignment) { throw null; } [System.CLSCompliantAttribute(false)] public static void AlignedFree(void* ptr) { } [System.CLSCompliantAttribute(false)] public static void* AlignedRealloc(void* ptr, nuint byteCount, nuint alignment) { throw null; } [System.CLSCompliantAttribute(false)] public static void* Alloc(nuint byteCount) { throw null; } [System.CLSCompliantAttribute(false)] public static void* Alloc(nuint elementCount, nuint elementSize) { throw null; } [System.CLSCompliantAttribute(false)] public static void* AllocZeroed(nuint byteCount) { throw null; } [System.CLSCompliantAttribute(false)] public static void* AllocZeroed(nuint elementCount, nuint elementSize) { throw null; } [System.CLSCompliantAttribute(false)] public static void Free(void* ptr) { } [System.CLSCompliantAttribute(false)] public static void* Realloc(void* ptr, nuint byteCount) { throw null; } } public readonly partial struct NFloat : System.IComparable, System.IComparable<System.Runtime.InteropServices.NFloat>, System.IEquatable<System.Runtime.InteropServices.NFloat>, System.IFormattable, System.ISpanFormattable { private readonly int _dummyPrimitive; public NFloat(double value) { throw null; } public NFloat(float value) { throw null; } public static System.Runtime.InteropServices.NFloat Epsilon { get { throw null; } } public static System.Runtime.InteropServices.NFloat MaxValue { get { throw null; } } public static System.Runtime.InteropServices.NFloat MinValue { get { throw null; } } public static System.Runtime.InteropServices.NFloat NaN { get { throw null; } } public static System.Runtime.InteropServices.NFloat NegativeInfinity { get { throw null; } } public static System.Runtime.InteropServices.NFloat PositiveInfinity { get { throw null; } } public static int Size { get { throw null; } } public double Value { get { throw null; } } public int CompareTo(object? obj) { throw null; } public int CompareTo(System.Runtime.InteropServices.NFloat other) { throw null; } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public bool Equals(System.Runtime.InteropServices.NFloat other) { throw null; } public override int GetHashCode() { throw null; } public static bool IsFinite(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsInfinity(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsNaN(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsNegative(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsNegativeInfinity(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsNormal(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsPositiveInfinity(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsSubnormal(System.Runtime.InteropServices.NFloat value) { throw null; } public static System.Runtime.InteropServices.NFloat operator +(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static System.Runtime.InteropServices.NFloat operator --(System.Runtime.InteropServices.NFloat value) { throw null; } public static System.Runtime.InteropServices.NFloat operator /(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static bool operator ==(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static explicit operator System.Runtime.InteropServices.NFloat (decimal value) { throw null; } public static explicit operator System.Runtime.InteropServices.NFloat (double value) { throw null; } public static explicit operator byte (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator char (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator decimal (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator short (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator int (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator long (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator nint (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static explicit operator sbyte (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator float (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static explicit operator ushort (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static explicit operator uint (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static explicit operator ulong (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static explicit operator nuint (System.Runtime.InteropServices.NFloat value) { throw null; } public static bool operator >(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static bool operator >=(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (byte value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (char value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (short value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (int value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (long value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (nint value) { throw null; } public static implicit operator double (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static implicit operator System.Runtime.InteropServices.NFloat (sbyte value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (float value) { throw null; } [System.CLSCompliantAttribute(false)] public static implicit operator System.Runtime.InteropServices.NFloat (ushort value) { throw null; } [System.CLSCompliantAttribute(false)] public static implicit operator System.Runtime.InteropServices.NFloat (uint value) { throw null; } [System.CLSCompliantAttribute(false)] public static implicit operator System.Runtime.InteropServices.NFloat (ulong value) { throw null; } [System.CLSCompliantAttribute(false)] public static implicit operator System.Runtime.InteropServices.NFloat (nuint value) { throw null; } public static System.Runtime.InteropServices.NFloat operator ++(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool operator !=(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static bool operator <(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static bool operator <=(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static System.Runtime.InteropServices.NFloat operator %(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static System.Runtime.InteropServices.NFloat operator *(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static System.Runtime.InteropServices.NFloat operator -(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static System.Runtime.InteropServices.NFloat operator -(System.Runtime.InteropServices.NFloat value) { throw null; } public static System.Runtime.InteropServices.NFloat operator +(System.Runtime.InteropServices.NFloat value) { throw null; } public static System.Runtime.InteropServices.NFloat Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; } public static System.Runtime.InteropServices.NFloat Parse(string s) { throw null; } public static System.Runtime.InteropServices.NFloat Parse(string s, System.Globalization.NumberStyles style) { throw null; } public static System.Runtime.InteropServices.NFloat Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; } public static System.Runtime.InteropServices.NFloat Parse(string s, System.IFormatProvider? provider) { throw null; } public override string ToString() { throw null; } public string ToString(System.IFormatProvider? provider) { throw null; } public string ToString(string? format) { throw null; } public string ToString(string? format, System.IFormatProvider? provider) { throw null; } public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; } public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result) { throw null; } public static bool TryParse(System.ReadOnlySpan<char> s, out System.Runtime.InteropServices.NFloat result) { throw null; } public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result) { throw null; } public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Runtime.InteropServices.NFloat result) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)] public sealed partial class OptionalAttribute : System.Attribute { public OptionalAttribute() { } } public enum PosixSignal { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGTSTP = -10, [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGTTOU = -9, [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGTTIN = -8, [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGWINCH = -7, [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGCONT = -6, [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGCHLD = -5, SIGTERM = -4, SIGQUIT = -3, SIGINT = -2, SIGHUP = -1, } public sealed partial class PosixSignalContext { public PosixSignalContext(System.Runtime.InteropServices.PosixSignal signal) { } public bool Cancel { get { throw null; } set { } } public System.Runtime.InteropServices.PosixSignal Signal { get { throw null; } } } public sealed partial class PosixSignalRegistration : System.IDisposable { internal PosixSignalRegistration() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static System.Runtime.InteropServices.PosixSignalRegistration Create(System.Runtime.InteropServices.PosixSignal signal, System.Action<System.Runtime.InteropServices.PosixSignalContext> handler) { throw null; } public void Dispose() { } ~PosixSignalRegistration() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class PreserveSigAttribute : System.Attribute { public PreserveSigAttribute() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false, AllowMultiple=true)] public sealed partial class PrimaryInteropAssemblyAttribute : System.Attribute { public PrimaryInteropAssemblyAttribute(int major, int minor) { } public int MajorVersion { get { throw null; } } public int MinorVersion { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=false)] public sealed partial class ProgIdAttribute : System.Attribute { public ProgIdAttribute(string progId) { } public string Value { get { throw null; } } } public static partial class RuntimeEnvironment { [System.ObsoleteAttribute("RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.", DiagnosticId = "SYSLIB0019", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public static string SystemConfigurationFile { get { throw null; } } public static bool FromGlobalAccessCache(System.Reflection.Assembly a) { throw null; } public static string GetRuntimeDirectory() { throw null; } [System.ObsoleteAttribute("RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.", DiagnosticId = "SYSLIB0019", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public static System.IntPtr GetRuntimeInterfaceAsIntPtr(System.Guid clsid, System.Guid riid) { throw null; } [System.ObsoleteAttribute("RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.", DiagnosticId = "SYSLIB0019", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public static object GetRuntimeInterfaceAsObject(System.Guid clsid, System.Guid riid) { throw null; } public static string GetSystemVersion() { throw null; } } public partial class SafeArrayRankMismatchException : System.SystemException { public SafeArrayRankMismatchException() { } protected SafeArrayRankMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public SafeArrayRankMismatchException(string? message) { } public SafeArrayRankMismatchException(string? message, System.Exception? inner) { } } public partial class SafeArrayTypeMismatchException : System.SystemException { public SafeArrayTypeMismatchException() { } protected SafeArrayTypeMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public SafeArrayTypeMismatchException(string? message) { } public SafeArrayTypeMismatchException(string? message, System.Exception? inner) { } } public partial class SEHException : System.Runtime.InteropServices.ExternalException { public SEHException() { } protected SEHException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public SEHException(string? message) { } public SEHException(string? message, System.Exception? inner) { } public virtual bool CanResume() { throw null; } } public partial class StandardOleMarshalObject : System.MarshalByRefObject { protected StandardOleMarshalObject() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)] public sealed partial class TypeIdentifierAttribute : System.Attribute { public TypeIdentifierAttribute() { } public TypeIdentifierAttribute(string? scope, string? identifier) { } public string? Identifier { get { throw null; } } public string? Scope { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class TypeLibFuncAttribute : System.Attribute { public TypeLibFuncAttribute(short flags) { } public TypeLibFuncAttribute(System.Runtime.InteropServices.TypeLibFuncFlags flags) { } public System.Runtime.InteropServices.TypeLibFuncFlags Value { get { throw null; } } } [System.FlagsAttribute] public enum TypeLibFuncFlags { FRestricted = 1, FSource = 2, FBindable = 4, FRequestEdit = 8, FDisplayBind = 16, FDefaultBind = 32, FHidden = 64, FUsesGetLastError = 128, FDefaultCollelem = 256, FUiDefault = 512, FNonBrowsable = 1024, FReplaceable = 2048, FImmediateBind = 4096, } [System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited=false)] public sealed partial class TypeLibImportClassAttribute : System.Attribute { public TypeLibImportClassAttribute(System.Type importClass) { } public string Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, Inherited=false)] public sealed partial class TypeLibTypeAttribute : System.Attribute { public TypeLibTypeAttribute(short flags) { } public TypeLibTypeAttribute(System.Runtime.InteropServices.TypeLibTypeFlags flags) { } public System.Runtime.InteropServices.TypeLibTypeFlags Value { get { throw null; } } } [System.FlagsAttribute] public enum TypeLibTypeFlags { FAppObject = 1, FCanCreate = 2, FLicensed = 4, FPreDeclId = 8, FHidden = 16, FControl = 32, FDual = 64, FNonExtensible = 128, FOleAutomation = 256, FRestricted = 512, FAggregatable = 1024, FReplaceable = 2048, FDispatchable = 4096, FReverseBind = 8192, } [System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)] public sealed partial class TypeLibVarAttribute : System.Attribute { public TypeLibVarAttribute(short flags) { } public TypeLibVarAttribute(System.Runtime.InteropServices.TypeLibVarFlags flags) { } public System.Runtime.InteropServices.TypeLibVarFlags Value { get { throw null; } } } [System.FlagsAttribute] public enum TypeLibVarFlags { FReadOnly = 1, FSource = 2, FBindable = 4, FRequestEdit = 8, FDisplayBind = 16, FDefaultBind = 32, FHidden = 64, FRestricted = 128, FDefaultCollelem = 256, FUiDefault = 512, FNonBrowsable = 1024, FReplaceable = 2048, FImmediateBind = 4096, } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)] public sealed partial class TypeLibVersionAttribute : System.Attribute { public TypeLibVersionAttribute(int major, int minor) { } public int MajorVersion { get { throw null; } } public int MinorVersion { get { throw null; } } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class UnknownWrapper { public UnknownWrapper(object? obj) { } public object? WrappedObject { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Delegate, AllowMultiple=false, Inherited=false)] public sealed partial class UnmanagedFunctionPointerAttribute : System.Attribute { public bool BestFitMapping; public System.Runtime.InteropServices.CharSet CharSet; public bool SetLastError; public bool ThrowOnUnmappableChar; public UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention callingConvention) { } public System.Runtime.InteropServices.CallingConvention CallingConvention { get { throw null; } } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum VarEnum { VT_EMPTY = 0, VT_NULL = 1, VT_I2 = 2, VT_I4 = 3, VT_R4 = 4, VT_R8 = 5, VT_CY = 6, VT_DATE = 7, VT_BSTR = 8, VT_DISPATCH = 9, VT_ERROR = 10, VT_BOOL = 11, VT_VARIANT = 12, VT_UNKNOWN = 13, VT_DECIMAL = 14, VT_I1 = 16, VT_UI1 = 17, VT_UI2 = 18, VT_UI4 = 19, VT_I8 = 20, VT_UI8 = 21, VT_INT = 22, VT_UINT = 23, VT_VOID = 24, VT_HRESULT = 25, VT_PTR = 26, VT_SAFEARRAY = 27, VT_CARRAY = 28, VT_USERDEFINED = 29, VT_LPSTR = 30, VT_LPWSTR = 31, VT_RECORD = 36, VT_FILETIME = 64, VT_BLOB = 65, VT_STREAM = 66, VT_STORAGE = 67, VT_STREAMED_OBJECT = 68, VT_STORED_OBJECT = 69, VT_BLOB_OBJECT = 70, VT_CF = 71, VT_CLSID = 72, VT_VECTOR = 4096, VT_ARRAY = 8192, VT_BYREF = 16384, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class VariantWrapper { public VariantWrapper(object? obj) { } public object? WrappedObject { get { throw null; } } } [System.FlagsAttribute] public enum CreateComInterfaceFlags { None = 0, CallerDefinedIUnknown = 1, TrackerSupport = 2, } [System.FlagsAttribute] public enum CreateObjectFlags { None = 0, TrackerObject = 1, UniqueInstance = 2, Aggregation = 4, Unwrap = 8, } [System.Runtime.Versioning.UnsupportedOSPlatform("android")] [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] [System.Runtime.Versioning.UnsupportedOSPlatform("ios")] [System.Runtime.Versioning.UnsupportedOSPlatform("tvos")] [System.CLSCompliantAttribute(false)] public abstract class ComWrappers { public struct ComInterfaceEntry { public System.Guid IID; public System.IntPtr Vtable; } public struct ComInterfaceDispatch { public System.IntPtr Vtable; public unsafe static T GetInstance<T>(ComInterfaceDispatch* dispatchPtr) where T : class { throw null; } } public System.IntPtr GetOrCreateComInterfaceForObject(object instance, CreateComInterfaceFlags flags) { throw null; } protected unsafe abstract ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count); public object GetOrCreateObjectForComInstance(System.IntPtr externalComObject, CreateObjectFlags flags) { throw null; } protected abstract object? CreateObject(System.IntPtr externalComObject, CreateObjectFlags flags); public object GetOrRegisterObjectForComInstance(System.IntPtr externalComObject, CreateObjectFlags flags, object wrapper) { throw null; } public object GetOrRegisterObjectForComInstance(System.IntPtr externalComObject, CreateObjectFlags flags, object wrapper, System.IntPtr inner) { throw null; } protected abstract void ReleaseObjects(System.Collections.IEnumerable objects); public static void RegisterForTrackerSupport(ComWrappers instance) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void RegisterForMarshalling(ComWrappers instance) { } protected static void GetIUnknownImpl(out System.IntPtr fpQueryInterface, out System.IntPtr fpAddRef, out System.IntPtr fpRelease) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] public sealed class UnmanagedCallConvAttribute : System.Attribute { public UnmanagedCallConvAttribute() { } public System.Type[]? CallConvs; } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited = false)] public sealed class UnmanagedCallersOnlyAttribute : System.Attribute { public UnmanagedCallersOnlyAttribute() { } public System.Type[]? CallConvs; public string? EntryPoint; } } namespace System.Runtime.InteropServices.ComTypes { [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum ADVF { ADVF_NODATA = 1, ADVF_PRIMEFIRST = 2, ADVF_ONLYONCE = 4, ADVFCACHE_NOHANDLER = 8, ADVFCACHE_FORCEBUILTIN = 16, ADVFCACHE_ONSAVE = 32, ADVF_DATAONSTOP = 64, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)] public partial struct BINDPTR { [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.IntPtr lpfuncdesc; [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.IntPtr lptcomp; [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.IntPtr lpvardesc; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct BIND_OPTS { public int cbStruct; public int dwTickCountDeadline; public int grfFlags; public int grfMode; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum CALLCONV { CC_CDECL = 1, CC_MSCPASCAL = 2, CC_PASCAL = 2, CC_MACPASCAL = 3, CC_STDCALL = 4, CC_RESERVED = 5, CC_SYSCALL = 6, CC_MPWCDECL = 7, CC_MPWPASCAL = 8, CC_MAX = 9, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct CONNECTDATA { public int dwCookie; public object pUnk; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum DATADIR { DATADIR_GET = 1, DATADIR_SET = 2, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum DESCKIND { DESCKIND_NONE = 0, DESCKIND_FUNCDESC = 1, DESCKIND_VARDESC = 2, DESCKIND_TYPECOMP = 3, DESCKIND_IMPLICITAPPOBJ = 4, DESCKIND_MAX = 5, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct DISPPARAMS { public int cArgs; public int cNamedArgs; public System.IntPtr rgdispidNamedArgs; public System.IntPtr rgvarg; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum DVASPECT { DVASPECT_CONTENT = 1, DVASPECT_THUMBNAIL = 2, DVASPECT_ICON = 4, DVASPECT_DOCPRINT = 8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct ELEMDESC { public System.Runtime.InteropServices.ComTypes.ELEMDESC.DESCUNION desc; public System.Runtime.InteropServices.ComTypes.TYPEDESC tdesc; [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)] public partial struct DESCUNION { [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.Runtime.InteropServices.ComTypes.IDLDESC idldesc; [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.Runtime.InteropServices.ComTypes.PARAMDESC paramdesc; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct EXCEPINFO { public string bstrDescription; public string bstrHelpFile; public string bstrSource; public int dwHelpContext; public System.IntPtr pfnDeferredFillIn; public System.IntPtr pvReserved; public int scode; public short wCode; public short wReserved; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct FILETIME { public int dwHighDateTime; public int dwLowDateTime; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct FORMATETC { public short cfFormat; public System.Runtime.InteropServices.ComTypes.DVASPECT dwAspect; public int lindex; public System.IntPtr ptd; public System.Runtime.InteropServices.ComTypes.TYMED tymed; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct FUNCDESC { public System.Runtime.InteropServices.ComTypes.CALLCONV callconv; public short cParams; public short cParamsOpt; public short cScodes; public System.Runtime.InteropServices.ComTypes.ELEMDESC elemdescFunc; public System.Runtime.InteropServices.ComTypes.FUNCKIND funckind; public System.Runtime.InteropServices.ComTypes.INVOKEKIND invkind; public System.IntPtr lprgelemdescParam; public System.IntPtr lprgscode; public int memid; public short oVft; public short wFuncFlags; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum FUNCFLAGS : short { FUNCFLAG_FRESTRICTED = (short)1, FUNCFLAG_FSOURCE = (short)2, FUNCFLAG_FBINDABLE = (short)4, FUNCFLAG_FREQUESTEDIT = (short)8, FUNCFLAG_FDISPLAYBIND = (short)16, FUNCFLAG_FDEFAULTBIND = (short)32, FUNCFLAG_FHIDDEN = (short)64, FUNCFLAG_FUSESGETLASTERROR = (short)128, FUNCFLAG_FDEFAULTCOLLELEM = (short)256, FUNCFLAG_FUIDEFAULT = (short)512, FUNCFLAG_FNONBROWSABLE = (short)1024, FUNCFLAG_FREPLACEABLE = (short)2048, FUNCFLAG_FIMMEDIATEBIND = (short)4096, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum FUNCKIND { FUNC_VIRTUAL = 0, FUNC_PUREVIRTUAL = 1, FUNC_NONVIRTUAL = 2, FUNC_STATIC = 3, FUNC_DISPATCH = 4, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IAdviseSink { void OnClose(); void OnDataChange(ref System.Runtime.InteropServices.ComTypes.FORMATETC format, ref System.Runtime.InteropServices.ComTypes.STGMEDIUM stgmedium); void OnRename(System.Runtime.InteropServices.ComTypes.IMoniker moniker); void OnSave(); void OnViewChange(int aspect, int index); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IBindCtx { void EnumObjectParam(out System.Runtime.InteropServices.ComTypes.IEnumString? ppenum); void GetBindOptions(ref System.Runtime.InteropServices.ComTypes.BIND_OPTS pbindopts); void GetObjectParam(string pszKey, out object? ppunk); void GetRunningObjectTable(out System.Runtime.InteropServices.ComTypes.IRunningObjectTable? pprot); void RegisterObjectBound(object punk); void RegisterObjectParam(string pszKey, object punk); void ReleaseBoundObjects(); void RevokeObjectBound(object punk); int RevokeObjectParam(string pszKey); void SetBindOptions(ref System.Runtime.InteropServices.ComTypes.BIND_OPTS pbindopts); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IConnectionPoint { void Advise(object pUnkSink, out int pdwCookie); void EnumConnections(out System.Runtime.InteropServices.ComTypes.IEnumConnections ppEnum); void GetConnectionInterface(out System.Guid pIID); void GetConnectionPointContainer(out System.Runtime.InteropServices.ComTypes.IConnectionPointContainer ppCPC); void Unadvise(int dwCookie); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IConnectionPointContainer { void EnumConnectionPoints(out System.Runtime.InteropServices.ComTypes.IEnumConnectionPoints ppEnum); void FindConnectionPoint(ref System.Guid riid, out System.Runtime.InteropServices.ComTypes.IConnectionPoint? ppCP); } [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IDataObject { int DAdvise(ref System.Runtime.InteropServices.ComTypes.FORMATETC pFormatetc, System.Runtime.InteropServices.ComTypes.ADVF advf, System.Runtime.InteropServices.ComTypes.IAdviseSink adviseSink, out int connection); void DUnadvise(int connection); int EnumDAdvise(out System.Runtime.InteropServices.ComTypes.IEnumSTATDATA? enumAdvise); System.Runtime.InteropServices.ComTypes.IEnumFORMATETC EnumFormatEtc(System.Runtime.InteropServices.ComTypes.DATADIR direction); int GetCanonicalFormatEtc(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatIn, out System.Runtime.InteropServices.ComTypes.FORMATETC formatOut); void GetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC format, out System.Runtime.InteropServices.ComTypes.STGMEDIUM medium); void GetDataHere(ref System.Runtime.InteropServices.ComTypes.FORMATETC format, ref System.Runtime.InteropServices.ComTypes.STGMEDIUM medium); int QueryGetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC format); void SetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatIn, ref System.Runtime.InteropServices.ComTypes.STGMEDIUM medium, bool release); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct IDLDESC { public System.IntPtr dwReserved; public System.Runtime.InteropServices.ComTypes.IDLFLAG wIDLFlags; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum IDLFLAG : short { IDLFLAG_NONE = (short)0, IDLFLAG_FIN = (short)1, IDLFLAG_FOUT = (short)2, IDLFLAG_FLCID = (short)4, IDLFLAG_FRETVAL = (short)8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumConnectionPoints { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumConnectionPoints ppenum); int Next(int celt, System.Runtime.InteropServices.ComTypes.IConnectionPoint[] rgelt, System.IntPtr pceltFetched); void Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumConnections { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumConnections ppenum); int Next(int celt, System.Runtime.InteropServices.ComTypes.CONNECTDATA[] rgelt, System.IntPtr pceltFetched); void Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumFORMATETC { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumFORMATETC newEnum); int Next(int celt, System.Runtime.InteropServices.ComTypes.FORMATETC[] rgelt, int[] pceltFetched); int Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumMoniker { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumMoniker ppenum); int Next(int celt, System.Runtime.InteropServices.ComTypes.IMoniker[] rgelt, System.IntPtr pceltFetched); void Reset(); int Skip(int celt); } [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumSTATDATA { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumSTATDATA newEnum); int Next(int celt, System.Runtime.InteropServices.ComTypes.STATDATA[] rgelt, int[] pceltFetched); int Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumString { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumString ppenum); int Next(int celt, string[] rgelt, System.IntPtr pceltFetched); void Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumVARIANT { System.Runtime.InteropServices.ComTypes.IEnumVARIANT Clone(); int Next(int celt, object?[] rgVar, System.IntPtr pceltFetched); int Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IMoniker { void BindToObject(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker? pmkToLeft, ref System.Guid riidResult, out object ppvResult); void BindToStorage(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker? pmkToLeft, ref System.Guid riid, out object ppvObj); void CommonPrefixWith(System.Runtime.InteropServices.ComTypes.IMoniker pmkOther, out System.Runtime.InteropServices.ComTypes.IMoniker? ppmkPrefix); void ComposeWith(System.Runtime.InteropServices.ComTypes.IMoniker pmkRight, bool fOnlyIfNotGeneric, out System.Runtime.InteropServices.ComTypes.IMoniker? ppmkComposite); void Enum(bool fForward, out System.Runtime.InteropServices.ComTypes.IEnumMoniker? ppenumMoniker); void GetClassID(out System.Guid pClassID); void GetDisplayName(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker? pmkToLeft, out string ppszDisplayName); void GetSizeMax(out long pcbSize); void GetTimeOfLastChange(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker? pmkToLeft, out System.Runtime.InteropServices.ComTypes.FILETIME pFileTime); void Hash(out int pdwHash); void Inverse(out System.Runtime.InteropServices.ComTypes.IMoniker ppmk); int IsDirty(); int IsEqual(System.Runtime.InteropServices.ComTypes.IMoniker pmkOtherMoniker); int IsRunning(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker? pmkToLeft, System.Runtime.InteropServices.ComTypes.IMoniker? pmkNewlyRunning); int IsSystemMoniker(out int pdwMksys); void Load(System.Runtime.InteropServices.ComTypes.IStream pStm); void ParseDisplayName(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker pmkToLeft, string pszDisplayName, out int pchEaten, out System.Runtime.InteropServices.ComTypes.IMoniker ppmkOut); void Reduce(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, int dwReduceHowFar, ref System.Runtime.InteropServices.ComTypes.IMoniker? ppmkToLeft, out System.Runtime.InteropServices.ComTypes.IMoniker? ppmkReduced); void RelativePathTo(System.Runtime.InteropServices.ComTypes.IMoniker pmkOther, out System.Runtime.InteropServices.ComTypes.IMoniker? ppmkRelPath); void Save(System.Runtime.InteropServices.ComTypes.IStream pStm, bool fClearDirty); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum IMPLTYPEFLAGS { IMPLTYPEFLAG_FDEFAULT = 1, IMPLTYPEFLAG_FSOURCE = 2, IMPLTYPEFLAG_FRESTRICTED = 4, IMPLTYPEFLAG_FDEFAULTVTABLE = 8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum INVOKEKIND { INVOKE_FUNC = 1, INVOKE_PROPERTYGET = 2, INVOKE_PROPERTYPUT = 4, INVOKE_PROPERTYPUTREF = 8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IPersistFile { void GetClassID(out System.Guid pClassID); void GetCurFile(out string ppszFileName); int IsDirty(); void Load(string pszFileName, int dwMode); void Save(string? pszFileName, bool fRemember); void SaveCompleted(string pszFileName); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IRunningObjectTable { void EnumRunning(out System.Runtime.InteropServices.ComTypes.IEnumMoniker ppenumMoniker); int GetObject(System.Runtime.InteropServices.ComTypes.IMoniker pmkObjectName, out object ppunkObject); int GetTimeOfLastChange(System.Runtime.InteropServices.ComTypes.IMoniker pmkObjectName, out System.Runtime.InteropServices.ComTypes.FILETIME pfiletime); int IsRunning(System.Runtime.InteropServices.ComTypes.IMoniker pmkObjectName); void NoteChangeTime(int dwRegister, ref System.Runtime.InteropServices.ComTypes.FILETIME pfiletime); int Register(int grfFlags, object punkObject, System.Runtime.InteropServices.ComTypes.IMoniker pmkObjectName); void Revoke(int dwRegister); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IStream { void Clone(out System.Runtime.InteropServices.ComTypes.IStream ppstm); void Commit(int grfCommitFlags); void CopyTo(System.Runtime.InteropServices.ComTypes.IStream pstm, long cb, System.IntPtr pcbRead, System.IntPtr pcbWritten); void LockRegion(long libOffset, long cb, int dwLockType); void Read(byte[] pv, int cb, System.IntPtr pcbRead); void Revert(); void Seek(long dlibMove, int dwOrigin, System.IntPtr plibNewPosition); void SetSize(long libNewSize); void Stat(out System.Runtime.InteropServices.ComTypes.STATSTG pstatstg, int grfStatFlag); void UnlockRegion(long libOffset, long cb, int dwLockType); void Write(byte[] pv, int cb, System.IntPtr pcbWritten); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface ITypeComp { void Bind(string szName, int lHashVal, short wFlags, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTInfo, out System.Runtime.InteropServices.ComTypes.DESCKIND pDescKind, out System.Runtime.InteropServices.ComTypes.BINDPTR pBindPtr); void BindType(string szName, int lHashVal, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTInfo, out System.Runtime.InteropServices.ComTypes.ITypeComp ppTComp); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface ITypeInfo { void AddressOfMember(int memid, System.Runtime.InteropServices.ComTypes.INVOKEKIND invKind, out System.IntPtr ppv); void CreateInstance(object? pUnkOuter, ref System.Guid riid, out object ppvObj); void GetContainingTypeLib(out System.Runtime.InteropServices.ComTypes.ITypeLib ppTLB, out int pIndex); void GetDllEntry(int memid, System.Runtime.InteropServices.ComTypes.INVOKEKIND invKind, System.IntPtr pBstrDllName, System.IntPtr pBstrName, System.IntPtr pwOrdinal); void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); void GetFuncDesc(int index, out System.IntPtr ppFuncDesc); void GetIDsOfNames(string[] rgszNames, int cNames, int[] pMemId); void GetImplTypeFlags(int index, out System.Runtime.InteropServices.ComTypes.IMPLTYPEFLAGS pImplTypeFlags); void GetMops(int memid, out string? pBstrMops); void GetNames(int memid, string[] rgBstrNames, int cMaxNames, out int pcNames); void GetRefTypeInfo(int hRef, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTI); void GetRefTypeOfImplType(int index, out int href); void GetTypeAttr(out System.IntPtr ppTypeAttr); void GetTypeComp(out System.Runtime.InteropServices.ComTypes.ITypeComp ppTComp); void GetVarDesc(int index, out System.IntPtr ppVarDesc); void Invoke(object pvInstance, int memid, short wFlags, ref System.Runtime.InteropServices.ComTypes.DISPPARAMS pDispParams, System.IntPtr pVarResult, System.IntPtr pExcepInfo, out int puArgErr); void ReleaseFuncDesc(System.IntPtr pFuncDesc); void ReleaseTypeAttr(System.IntPtr pTypeAttr); void ReleaseVarDesc(System.IntPtr pVarDesc); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface ITypeInfo2 : System.Runtime.InteropServices.ComTypes.ITypeInfo { new void AddressOfMember(int memid, System.Runtime.InteropServices.ComTypes.INVOKEKIND invKind, out System.IntPtr ppv); new void CreateInstance(object? pUnkOuter, ref System.Guid riid, out object ppvObj); void GetAllCustData(System.IntPtr pCustData); void GetAllFuncCustData(int index, System.IntPtr pCustData); void GetAllImplTypeCustData(int index, System.IntPtr pCustData); void GetAllParamCustData(int indexFunc, int indexParam, System.IntPtr pCustData); void GetAllVarCustData(int index, System.IntPtr pCustData); new void GetContainingTypeLib(out System.Runtime.InteropServices.ComTypes.ITypeLib ppTLB, out int pIndex); void GetCustData(ref System.Guid guid, out object pVarVal); new void GetDllEntry(int memid, System.Runtime.InteropServices.ComTypes.INVOKEKIND invKind, System.IntPtr pBstrDllName, System.IntPtr pBstrName, System.IntPtr pwOrdinal); new void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); void GetDocumentation2(int memid, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll); void GetFuncCustData(int index, ref System.Guid guid, out object pVarVal); new void GetFuncDesc(int index, out System.IntPtr ppFuncDesc); void GetFuncIndexOfMemId(int memid, System.Runtime.InteropServices.ComTypes.INVOKEKIND invKind, out int pFuncIndex); new void GetIDsOfNames(string[] rgszNames, int cNames, int[] pMemId); void GetImplTypeCustData(int index, ref System.Guid guid, out object pVarVal); new void GetImplTypeFlags(int index, out System.Runtime.InteropServices.ComTypes.IMPLTYPEFLAGS pImplTypeFlags); new void GetMops(int memid, out string? pBstrMops); new void GetNames(int memid, string[] rgBstrNames, int cMaxNames, out int pcNames); void GetParamCustData(int indexFunc, int indexParam, ref System.Guid guid, out object pVarVal); new void GetRefTypeInfo(int hRef, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTI); new void GetRefTypeOfImplType(int index, out int href); new void GetTypeAttr(out System.IntPtr ppTypeAttr); new void GetTypeComp(out System.Runtime.InteropServices.ComTypes.ITypeComp ppTComp); void GetTypeFlags(out int pTypeFlags); void GetTypeKind(out System.Runtime.InteropServices.ComTypes.TYPEKIND pTypeKind); void GetVarCustData(int index, ref System.Guid guid, out object pVarVal); new void GetVarDesc(int index, out System.IntPtr ppVarDesc); void GetVarIndexOfMemId(int memid, out int pVarIndex); new void Invoke(object pvInstance, int memid, short wFlags, ref System.Runtime.InteropServices.ComTypes.DISPPARAMS pDispParams, System.IntPtr pVarResult, System.IntPtr pExcepInfo, out int puArgErr); new void ReleaseFuncDesc(System.IntPtr pFuncDesc); new void ReleaseTypeAttr(System.IntPtr pTypeAttr); new void ReleaseVarDesc(System.IntPtr pVarDesc); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface ITypeLib { void FindName(string szNameBuf, int lHashVal, System.Runtime.InteropServices.ComTypes.ITypeInfo[] ppTInfo, int[] rgMemId, ref short pcFound); void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); void GetLibAttr(out System.IntPtr ppTLibAttr); void GetTypeComp(out System.Runtime.InteropServices.ComTypes.ITypeComp ppTComp); void GetTypeInfo(int index, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTI); int GetTypeInfoCount(); void GetTypeInfoOfGuid(ref System.Guid guid, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTInfo); void GetTypeInfoType(int index, out System.Runtime.InteropServices.ComTypes.TYPEKIND pTKind); bool IsName(string szNameBuf, int lHashVal); void ReleaseTLibAttr(System.IntPtr pTLibAttr); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface ITypeLib2 : System.Runtime.InteropServices.ComTypes.ITypeLib { new void FindName(string szNameBuf, int lHashVal, System.Runtime.InteropServices.ComTypes.ITypeInfo[] ppTInfo, int[] rgMemId, ref short pcFound); void GetAllCustData(System.IntPtr pCustData); void GetCustData(ref System.Guid guid, out object pVarVal); new void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); void GetDocumentation2(int index, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll); new void GetLibAttr(out System.IntPtr ppTLibAttr); void GetLibStatistics(System.IntPtr pcUniqueNames, out int pcchUniqueNames); new void GetTypeComp(out System.Runtime.InteropServices.ComTypes.ITypeComp ppTComp); new void GetTypeInfo(int index, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTI); new int GetTypeInfoCount(); new void GetTypeInfoOfGuid(ref System.Guid guid, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTInfo); new void GetTypeInfoType(int index, out System.Runtime.InteropServices.ComTypes.TYPEKIND pTKind); new bool IsName(string szNameBuf, int lHashVal); new void ReleaseTLibAttr(System.IntPtr pTLibAttr); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum LIBFLAGS : short { LIBFLAG_FRESTRICTED = (short)1, LIBFLAG_FCONTROL = (short)2, LIBFLAG_FHIDDEN = (short)4, LIBFLAG_FHASDISKIMAGE = (short)8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct PARAMDESC { public System.IntPtr lpVarValue; public System.Runtime.InteropServices.ComTypes.PARAMFLAG wParamFlags; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum PARAMFLAG : short { PARAMFLAG_NONE = (short)0, PARAMFLAG_FIN = (short)1, PARAMFLAG_FOUT = (short)2, PARAMFLAG_FLCID = (short)4, PARAMFLAG_FRETVAL = (short)8, PARAMFLAG_FOPT = (short)16, PARAMFLAG_FHASDEFAULT = (short)32, PARAMFLAG_FHASCUSTDATA = (short)64, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct STATDATA { public System.Runtime.InteropServices.ComTypes.ADVF advf; public System.Runtime.InteropServices.ComTypes.IAdviseSink advSink; public int connection; public System.Runtime.InteropServices.ComTypes.FORMATETC formatetc; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct STATSTG { public System.Runtime.InteropServices.ComTypes.FILETIME atime; public long cbSize; public System.Guid clsid; public System.Runtime.InteropServices.ComTypes.FILETIME ctime; public int grfLocksSupported; public int grfMode; public int grfStateBits; public System.Runtime.InteropServices.ComTypes.FILETIME mtime; public string pwcsName; public int reserved; public int type; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct STGMEDIUM { public object? pUnkForRelease; public System.Runtime.InteropServices.ComTypes.TYMED tymed; public System.IntPtr unionmember; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum SYSKIND { SYS_WIN16 = 0, SYS_WIN32 = 1, SYS_MAC = 2, SYS_WIN64 = 3, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum TYMED { TYMED_NULL = 0, TYMED_HGLOBAL = 1, TYMED_FILE = 2, TYMED_ISTREAM = 4, TYMED_ISTORAGE = 8, TYMED_GDI = 16, TYMED_MFPICT = 32, TYMED_ENHMF = 64, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct TYPEATTR { public short cbAlignment; public int cbSizeInstance; public short cbSizeVft; public short cFuncs; public short cImplTypes; public short cVars; public int dwReserved; public System.Guid guid; public System.Runtime.InteropServices.ComTypes.IDLDESC idldescType; public int lcid; public System.IntPtr lpstrSchema; public const int MEMBER_ID_NIL = -1; public int memidConstructor; public int memidDestructor; public System.Runtime.InteropServices.ComTypes.TYPEDESC tdescAlias; public System.Runtime.InteropServices.ComTypes.TYPEKIND typekind; public short wMajorVerNum; public short wMinorVerNum; public System.Runtime.InteropServices.ComTypes.TYPEFLAGS wTypeFlags; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct TYPEDESC { public System.IntPtr lpValue; public short vt; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum TYPEFLAGS : short { TYPEFLAG_FAPPOBJECT = (short)1, TYPEFLAG_FCANCREATE = (short)2, TYPEFLAG_FLICENSED = (short)4, TYPEFLAG_FPREDECLID = (short)8, TYPEFLAG_FHIDDEN = (short)16, TYPEFLAG_FCONTROL = (short)32, TYPEFLAG_FDUAL = (short)64, TYPEFLAG_FNONEXTENSIBLE = (short)128, TYPEFLAG_FOLEAUTOMATION = (short)256, TYPEFLAG_FRESTRICTED = (short)512, TYPEFLAG_FAGGREGATABLE = (short)1024, TYPEFLAG_FREPLACEABLE = (short)2048, TYPEFLAG_FDISPATCHABLE = (short)4096, TYPEFLAG_FREVERSEBIND = (short)8192, TYPEFLAG_FPROXY = (short)16384, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum TYPEKIND { TKIND_ENUM = 0, TKIND_RECORD = 1, TKIND_MODULE = 2, TKIND_INTERFACE = 3, TKIND_DISPATCH = 4, TKIND_COCLASS = 5, TKIND_ALIAS = 6, TKIND_UNION = 7, TKIND_MAX = 8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct TYPELIBATTR { public System.Guid guid; public int lcid; public System.Runtime.InteropServices.ComTypes.SYSKIND syskind; public System.Runtime.InteropServices.ComTypes.LIBFLAGS wLibFlags; public short wMajorVerNum; public short wMinorVerNum; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct VARDESC { public System.Runtime.InteropServices.ComTypes.VARDESC.DESCUNION desc; public System.Runtime.InteropServices.ComTypes.ELEMDESC elemdescVar; public string lpstrSchema; public int memid; public System.Runtime.InteropServices.ComTypes.VARKIND varkind; public short wVarFlags; [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)] public partial struct DESCUNION { [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.IntPtr lpvarValue; [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public int oInst; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum VARFLAGS : short { VARFLAG_FREADONLY = (short)1, VARFLAG_FSOURCE = (short)2, VARFLAG_FBINDABLE = (short)4, VARFLAG_FREQUESTEDIT = (short)8, VARFLAG_FDISPLAYBIND = (short)16, VARFLAG_FDEFAULTBIND = (short)32, VARFLAG_FHIDDEN = (short)64, VARFLAG_FRESTRICTED = (short)128, VARFLAG_FDEFAULTCOLLELEM = (short)256, VARFLAG_FUIDEFAULT = (short)512, VARFLAG_FNONBROWSABLE = (short)1024, VARFLAG_FREPLACEABLE = (short)2048, VARFLAG_FIMMEDIATEBIND = (short)4096, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum VARKIND { VAR_PERINSTANCE = 0, VAR_STATIC = 1, VAR_CONST = 2, VAR_DISPATCH = 3, } } namespace System.Runtime.InteropServices.ObjectiveC { [System.Runtime.Versioning.SupportedOSPlatformAttribute("macos")] [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] public sealed class ObjectiveCTrackedTypeAttribute : System.Attribute { public ObjectiveCTrackedTypeAttribute() { } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("macos")] [System.CLSCompliantAttribute(false)] public static class ObjectiveCMarshal { public unsafe delegate delegate* unmanaged<System.IntPtr, void> UnhandledExceptionPropagationHandler( System.Exception exception, System.RuntimeMethodHandle lastMethod, out System.IntPtr context); public static unsafe void Initialize( delegate* unmanaged<void> beginEndCallback, delegate* unmanaged<System.IntPtr, int> isReferencedCallback, delegate* unmanaged<System.IntPtr, void> trackedObjectEnteredFinalization, UnhandledExceptionPropagationHandler unhandledExceptionPropagationHandler) => throw null; public static GCHandle CreateReferenceTrackingHandle( object obj, out System.Span<System.IntPtr> taggedMemory) => throw null; public enum MessageSendFunction { MsgSend, MsgSendFpret, MsgSendStret, MsgSendSuper, MsgSendSuperStret, } public static void SetMessageSendCallback(MessageSendFunction msgSendFunction, System.IntPtr func) => throw null; public static void SetMessageSendPendingException(Exception? exception) => throw null; } } namespace System.Security { public sealed partial class SecureString : System.IDisposable { public SecureString() { } [System.CLSCompliantAttribute(false)] public unsafe SecureString(char* value, int length) { } public int Length { get { throw null; } } public void AppendChar(char c) { } public void Clear() { } public System.Security.SecureString Copy() { throw null; } public void Dispose() { } public void InsertAt(int index, char c) { } public bool IsReadOnly() { throw null; } public void MakeReadOnly() { } public void RemoveAt(int index) { } public void SetAt(int index, char c) { } } public static partial class SecureStringMarshal { public static System.IntPtr SecureStringToCoTaskMemAnsi(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToCoTaskMemUnicode(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToGlobalAllocAnsi(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToGlobalAllocUnicode(System.Security.SecureString s) { throw null; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // ------------------------------------------------------------------------------ // Changes to this file must follow the https://aka.ms/api-review process. // ------------------------------------------------------------------------------ namespace System { public sealed partial class DataMisalignedException : System.SystemException { public DataMisalignedException() { } public DataMisalignedException(string? message) { } public DataMisalignedException(string? message, System.Exception? innerException) { } } public partial class DllNotFoundException : System.TypeLoadException { public DllNotFoundException() { } protected DllNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public DllNotFoundException(string? message) { } public DllNotFoundException(string? message, System.Exception? inner) { } } } namespace System.IO { public partial class UnmanagedMemoryAccessor : System.IDisposable { protected UnmanagedMemoryAccessor() { } public UnmanagedMemoryAccessor(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long capacity) { } public UnmanagedMemoryAccessor(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long capacity, System.IO.FileAccess access) { } public bool CanRead { get { throw null; } } public bool CanWrite { get { throw null; } } public long Capacity { get { throw null; } } protected bool IsOpen { get { throw null; } } public void Dispose() { } protected virtual void Dispose(bool disposing) { } protected void Initialize(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long capacity, System.IO.FileAccess access) { } public int ReadArray<T>(long position, T[] array, int offset, int count) where T : struct { throw null; } public bool ReadBoolean(long position) { throw null; } public byte ReadByte(long position) { throw null; } public char ReadChar(long position) { throw null; } public decimal ReadDecimal(long position) { throw null; } public double ReadDouble(long position) { throw null; } public short ReadInt16(long position) { throw null; } public int ReadInt32(long position) { throw null; } public long ReadInt64(long position) { throw null; } [System.CLSCompliantAttribute(false)] public sbyte ReadSByte(long position) { throw null; } public float ReadSingle(long position) { throw null; } [System.CLSCompliantAttribute(false)] public ushort ReadUInt16(long position) { throw null; } [System.CLSCompliantAttribute(false)] public uint ReadUInt32(long position) { throw null; } [System.CLSCompliantAttribute(false)] public ulong ReadUInt64(long position) { throw null; } public void Read<T>(long position, out T structure) where T : struct { throw null; } public void Write(long position, bool value) { } public void Write(long position, byte value) { } public void Write(long position, char value) { } public void Write(long position, decimal value) { } public void Write(long position, double value) { } public void Write(long position, short value) { } public void Write(long position, int value) { } public void Write(long position, long value) { } [System.CLSCompliantAttribute(false)] public void Write(long position, sbyte value) { } public void Write(long position, float value) { } [System.CLSCompliantAttribute(false)] public void Write(long position, ushort value) { } [System.CLSCompliantAttribute(false)] public void Write(long position, uint value) { } [System.CLSCompliantAttribute(false)] public void Write(long position, ulong value) { } public void WriteArray<T>(long position, T[] array, int offset, int count) where T : struct { } public void Write<T>(long position, ref T structure) where T : struct { } } } namespace System.Runtime.CompilerServices { [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)] public sealed partial class IDispatchConstantAttribute : System.Runtime.CompilerServices.CustomConstantAttribute { public IDispatchConstantAttribute() { } public override object Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)] public sealed partial class IUnknownConstantAttribute : System.Runtime.CompilerServices.CustomConstantAttribute { public IUnknownConstantAttribute() { } public override object Value { get { throw null; } } } } namespace System.Runtime.InteropServices { [System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] [System.AttributeUsageAttribute(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)] public sealed partial class AllowReversePInvokeCallsAttribute : System.Attribute { public AllowReversePInvokeCallsAttribute() { } } public readonly partial struct ArrayWithOffset : System.IEquatable<System.Runtime.InteropServices.ArrayWithOffset> { private readonly object _dummy; private readonly int _dummyPrimitive; public ArrayWithOffset(object? array, int offset) { throw null; } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public bool Equals(System.Runtime.InteropServices.ArrayWithOffset obj) { throw null; } public object? GetArray() { throw null; } public override int GetHashCode() { throw null; } public int GetOffset() { throw null; } public static bool operator ==(System.Runtime.InteropServices.ArrayWithOffset a, System.Runtime.InteropServices.ArrayWithOffset b) { throw null; } public static bool operator !=(System.Runtime.InteropServices.ArrayWithOffset a, System.Runtime.InteropServices.ArrayWithOffset b) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Interface, Inherited=false)] public sealed partial class AutomationProxyAttribute : System.Attribute { public AutomationProxyAttribute(bool val) { } public bool Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.Struct, Inherited=false)] public sealed partial class BestFitMappingAttribute : System.Attribute { public bool ThrowOnUnmappableChar; public BestFitMappingAttribute(bool BestFitMapping) { } public bool BestFitMapping { get { throw null; } } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class BStrWrapper { public BStrWrapper(object? value) { } public BStrWrapper(string? value) { } public string? WrappedObject { get { throw null; } } } public enum CallingConvention { Winapi = 1, Cdecl = 2, StdCall = 3, ThisCall = 4, FastCall = 5, } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class, Inherited=false)] public sealed partial class ClassInterfaceAttribute : System.Attribute { public ClassInterfaceAttribute(short classInterfaceType) { } public ClassInterfaceAttribute(System.Runtime.InteropServices.ClassInterfaceType classInterfaceType) { } public System.Runtime.InteropServices.ClassInterfaceType Value { get { throw null; } } } public enum ClassInterfaceType { None = 0, [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("Support for IDispatch may be unavailable in future releases.")] AutoDispatch = 1, [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("Support for IDispatch may be unavailable in future releases.")] AutoDual = 2, } [System.CLSCompliantAttribute(false)] public readonly partial struct CLong : System.IEquatable<System.Runtime.InteropServices.CLong> { private readonly int _dummyPrimitive; public CLong(int value) { throw null; } public CLong(nint value) { throw null; } public nint Value { get { throw null; } } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; } public bool Equals(System.Runtime.InteropServices.CLong other) { throw null; } public override int GetHashCode() { throw null; } public override string ToString() { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited=false)] public sealed partial class CoClassAttribute : System.Attribute { public CoClassAttribute(System.Type coClass) { } public System.Type CoClass { get { throw null; } } } public static partial class CollectionsMarshal { public static System.Span<T> AsSpan<T>(System.Collections.Generic.List<T>? list) { throw null; } public static ref TValue GetValueRefOrNullRef<TKey, TValue>(System.Collections.Generic.Dictionary<TKey, TValue> dictionary, TKey key) where TKey : notnull { throw null; } public static ref TValue? GetValueRefOrAddDefault<TKey, TValue>(System.Collections.Generic.Dictionary<TKey, TValue> dictionary, TKey key, out bool exists) where TKey : notnull { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue, Inherited=false)] public sealed partial class ComAliasNameAttribute : System.Attribute { public ComAliasNameAttribute(string alias) { } public string Value { get { throw null; } } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial class ComAwareEventInfo : System.Reflection.EventInfo { public ComAwareEventInfo([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)] System.Type type, string eventName) { } public override System.Reflection.EventAttributes Attributes { get { throw null; } } public override System.Type? DeclaringType { get { throw null; } } public override int MetadataToken { get { throw null; } } public override System.Reflection.Module Module { get { throw null; } } public override string Name { get { throw null; } } public override System.Type? ReflectedType { get { throw null; } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public override void AddEventHandler(object target, System.Delegate handler) { } public override System.Reflection.MethodInfo? GetAddMethod(bool nonPublic) { throw null; } public override object[] GetCustomAttributes(bool inherit) { throw null; } public override object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; } public override System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData() { throw null; } public override System.Reflection.MethodInfo[] GetOtherMethods(bool nonPublic) { throw null; } public override System.Reflection.MethodInfo? GetRaiseMethod(bool nonPublic) { throw null; } public override System.Reflection.MethodInfo? GetRemoveMethod(bool nonPublic) { throw null; } public override bool IsDefined(System.Type attributeType, bool inherit) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public override void RemoveEventHandler(object target, System.Delegate handler) { } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)] public sealed partial class ComCompatibleVersionAttribute : System.Attribute { public ComCompatibleVersionAttribute(int major, int minor, int build, int revision) { } public int BuildNumber { get { throw null; } } public int MajorVersion { get { throw null; } } public int MinorVersion { get { throw null; } } public int RevisionNumber { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false)] public sealed partial class ComConversionLossAttribute : System.Attribute { public ComConversionLossAttribute() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=false)] public sealed partial class ComDefaultInterfaceAttribute : System.Attribute { public ComDefaultInterfaceAttribute(System.Type defaultInterface) { } public System.Type Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited=false)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class ComEventInterfaceAttribute : System.Attribute { public ComEventInterfaceAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] System.Type SourceInterface, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] System.Type EventProvider) { } [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] public System.Type EventProvider { get { throw null; } } [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] public System.Type SourceInterface { get { throw null; } } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static partial class ComEventsHelper { public static void Combine(object rcw, System.Guid iid, int dispid, System.Delegate d) { } public static System.Delegate? Remove(object rcw, System.Guid iid, int dispid, System.Delegate d) { throw null; } } public partial class COMException : System.Runtime.InteropServices.ExternalException { public COMException() { } protected COMException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public COMException(string? message) { } public COMException(string? message, System.Exception? inner) { } public COMException(string? message, int errorCode) { } public override string ToString() { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Interface, Inherited=false)] public sealed partial class ComImportAttribute : System.Attribute { public ComImportAttribute() { } } public enum ComInterfaceType { InterfaceIsDual = 0, InterfaceIsIUnknown = 1, InterfaceIsIDispatch = 2, InterfaceIsIInspectable = 3, } public enum ComMemberType { Method = 0, PropGet = 1, PropSet = 2, } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class ComRegisterFunctionAttribute : System.Attribute { public ComRegisterFunctionAttribute() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=true)] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class ComSourceInterfacesAttribute : System.Attribute { public ComSourceInterfacesAttribute(string sourceInterfaces) { } public ComSourceInterfacesAttribute(System.Type sourceInterface) { } public ComSourceInterfacesAttribute(System.Type sourceInterface1, System.Type sourceInterface2) { } public ComSourceInterfacesAttribute(System.Type sourceInterface1, System.Type sourceInterface2, System.Type sourceInterface3) { } public ComSourceInterfacesAttribute(System.Type sourceInterface1, System.Type sourceInterface2, System.Type sourceInterface3, System.Type sourceInterface4) { } public string Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class ComUnregisterFunctionAttribute : System.Attribute { public ComUnregisterFunctionAttribute() { } } [System.CLSCompliantAttribute(false)] public readonly partial struct CULong : System.IEquatable<System.Runtime.InteropServices.CULong> { private readonly int _dummyPrimitive; public CULong(uint value) { throw null; } public CULong(nuint value) { throw null; } public nuint Value { get { throw null; } } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; } public bool Equals(System.Runtime.InteropServices.CULong other) { throw null; } public override int GetHashCode() { throw null; } public override string ToString() { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("CurrencyWrapper and support for marshalling to the VARIANT type may be unavailable in future releases.")] public sealed partial class CurrencyWrapper { public CurrencyWrapper(decimal obj) { } public CurrencyWrapper(object obj) { } public decimal WrappedObject { get { throw null; } } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum CustomQueryInterfaceMode { Ignore = 0, Allow = 1, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum CustomQueryInterfaceResult { Handled = 0, NotHandled = 1, Failed = 2, } [System.AttributeUsageAttribute(System.AttributeTargets.Module, Inherited=false)] public sealed partial class DefaultCharSetAttribute : System.Attribute { public DefaultCharSetAttribute(System.Runtime.InteropServices.CharSet charSet) { } public System.Runtime.InteropServices.CharSet CharSet { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Method, AllowMultiple=false)] public sealed partial class DefaultDllImportSearchPathsAttribute : System.Attribute { public DefaultDllImportSearchPathsAttribute(System.Runtime.InteropServices.DllImportSearchPath paths) { } public System.Runtime.InteropServices.DllImportSearchPath Paths { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Parameter)] public sealed partial class DefaultParameterValueAttribute : System.Attribute { public DefaultParameterValueAttribute(object? value) { } public object? Value { get { throw null; } } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class DispatchWrapper { public DispatchWrapper(object? obj) { } public object? WrappedObject { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)] public sealed partial class DispIdAttribute : System.Attribute { public DispIdAttribute(int dispId) { } public int Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class DllImportAttribute : System.Attribute { public bool BestFitMapping; public System.Runtime.InteropServices.CallingConvention CallingConvention; public System.Runtime.InteropServices.CharSet CharSet; public string? EntryPoint; public bool ExactSpelling; public bool PreserveSig; public bool SetLastError; public bool ThrowOnUnmappableChar; public DllImportAttribute(string dllName) { } public string Value { get { throw null; } } } public delegate System.IntPtr DllImportResolver(string libraryName, System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportSearchPath? searchPath); [System.FlagsAttribute] public enum DllImportSearchPath { LegacyBehavior = 0, AssemblyDirectory = 2, UseDllDirectoryForDependencies = 256, ApplicationDirectory = 512, UserDirectories = 1024, System32 = 2048, SafeDirectories = 4096, } [System.AttributeUsageAttribute(System.AttributeTargets.Interface, AllowMultiple=false, Inherited=false)] public sealed class DynamicInterfaceCastableImplementationAttribute : Attribute { public DynamicInterfaceCastableImplementationAttribute() { } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class ErrorWrapper { public ErrorWrapper(System.Exception e) { } public ErrorWrapper(int errorCode) { } public ErrorWrapper(object errorCode) { } public int ErrorCode { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, Inherited=false)] public sealed partial class GuidAttribute : System.Attribute { public GuidAttribute(string guid) { } public string Value { get { throw null; } } } public sealed partial class HandleCollector { public HandleCollector(string? name, int initialThreshold) { } public HandleCollector(string? name, int initialThreshold, int maximumThreshold) { } public int Count { get { throw null; } } public int InitialThreshold { get { throw null; } } public int MaximumThreshold { get { throw null; } } public string Name { get { throw null; } } public void Add() { } public void Remove() { } } public readonly partial struct HandleRef { private readonly object _dummy; private readonly int _dummyPrimitive; public HandleRef(object? wrapper, System.IntPtr handle) { throw null; } public System.IntPtr Handle { get { throw null; } } public object? Wrapper { get { throw null; } } public static explicit operator System.IntPtr (System.Runtime.InteropServices.HandleRef value) { throw null; } public static System.IntPtr ToIntPtr(System.Runtime.InteropServices.HandleRef value) { throw null; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial interface ICustomAdapter { object GetUnderlyingObject(); } public partial interface ICustomFactory { System.MarshalByRefObject CreateInstance(System.Type serverType); } public partial interface ICustomMarshaler { void CleanUpManagedData(object ManagedObj); void CleanUpNativeData(System.IntPtr pNativeData); int GetNativeDataSize(); System.IntPtr MarshalManagedToNative(object ManagedObj); object MarshalNativeToManaged(System.IntPtr pNativeData); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public partial interface ICustomQueryInterface { System.Runtime.InteropServices.CustomQueryInterfaceResult GetInterface(ref System.Guid iid, out System.IntPtr ppv); } public partial interface IDynamicInterfaceCastable { bool IsInterfaceImplemented(System.RuntimeTypeHandle interfaceType, bool throwIfNotImplemented); System.RuntimeTypeHandle GetInterfaceImplementation(System.RuntimeTypeHandle interfaceType); } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)] public sealed partial class ImportedFromTypeLibAttribute : System.Attribute { public ImportedFromTypeLibAttribute(string tlbFile) { } public string Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited=false)] public sealed partial class InterfaceTypeAttribute : System.Attribute { public InterfaceTypeAttribute(short interfaceType) { } public InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType interfaceType) { } public System.Runtime.InteropServices.ComInterfaceType Value { get { throw null; } } } public partial class InvalidComObjectException : System.SystemException { public InvalidComObjectException() { } protected InvalidComObjectException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public InvalidComObjectException(string? message) { } public InvalidComObjectException(string? message, System.Exception? inner) { } } public partial class InvalidOleVariantTypeException : System.SystemException { public InvalidOleVariantTypeException() { } protected InvalidOleVariantTypeException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public InvalidOleVariantTypeException(string? message) { } public InvalidOleVariantTypeException(string? message, System.Exception? inner) { } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class LCIDConversionAttribute : System.Attribute { public LCIDConversionAttribute(int lcid) { } public int Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)] public sealed partial class ManagedToNativeComInteropStubAttribute : System.Attribute { public ManagedToNativeComInteropStubAttribute(System.Type classType, string methodName) { } public System.Type ClassType { get { throw null; } } public string MethodName { get { throw null; } } } public static partial class Marshal { public static readonly int SystemDefaultCharSize; public static readonly int SystemMaxDBCSCharSize; public static int AddRef(System.IntPtr pUnk) { throw null; } public static System.IntPtr AllocCoTaskMem(int cb) { throw null; } public static System.IntPtr AllocHGlobal(int cb) { throw null; } public static System.IntPtr AllocHGlobal(System.IntPtr cb) { throw null; } public static bool AreComObjectsAvailableForCleanup() { throw null; } [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")] [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object BindToMoniker(string monikerName) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void ChangeWrapperHandleStrength(object otp, bool fIsWeak) { } public static void CleanupUnusedObjectsInCurrentContext() { } public static void Copy(byte[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(char[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(double[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(short[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(int[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(long[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(System.IntPtr source, byte[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, char[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, double[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, short[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, int[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, long[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, System.IntPtr[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr source, float[] destination, int startIndex, int length) { } public static void Copy(System.IntPtr[] source, int startIndex, System.IntPtr destination, int length) { } public static void Copy(float[] source, int startIndex, System.IntPtr destination, int length) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr CreateAggregatedObject(System.IntPtr pOuter, object o) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static System.IntPtr CreateAggregatedObject<T>(System.IntPtr pOuter, T o) where T : notnull { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("o")] public static object? CreateWrapperOfType(object? o, System.Type t) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static TWrapper CreateWrapperOfType<T, TWrapper>(T? o) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available. Use the DestroyStructure<T> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void DestroyStructure(System.IntPtr ptr, System.Type structuretype) { } public static void DestroyStructure<T>(System.IntPtr ptr) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static int FinalReleaseComObject(object o) { throw null; } public static void FreeBSTR(System.IntPtr ptr) { } public static void FreeCoTaskMem(System.IntPtr ptr) { } public static void FreeHGlobal(System.IntPtr hglobal) { } public static System.Guid GenerateGuidForType(System.Type type) { throw null; } public static string? GenerateProgIdForType(System.Type type) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr GetComInterfaceForObject(object o, System.Type T) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr GetComInterfaceForObject(object o, System.Type T, System.Runtime.InteropServices.CustomQueryInterfaceMode mode) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static System.IntPtr GetComInterfaceForObject<T, TInterface>([System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T o) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object? GetComObjectData(object obj, object key) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the delegate might not be available. Use the GetDelegateForFunctionPointer<TDelegate> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.Delegate GetDelegateForFunctionPointer(System.IntPtr ptr, System.Type t) { throw null; } public static TDelegate GetDelegateForFunctionPointer<TDelegate>(System.IntPtr ptr) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static int GetEndComSlot(System.Type t) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("GetExceptionCode() may be unavailable in future releases.")] public static int GetExceptionCode() { throw null; } public static System.Exception? GetExceptionForHR(int errorCode) { throw null; } public static System.Exception? GetExceptionForHR(int errorCode, System.IntPtr errorInfo) { throw null; } public static System.IntPtr GetExceptionPointers() { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the delegate might not be available. Use the GetFunctionPointerForDelegate<TDelegate> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr GetFunctionPointerForDelegate(System.Delegate d) { throw null; } public static System.IntPtr GetFunctionPointerForDelegate<TDelegate>(TDelegate d) where TDelegate : notnull { throw null; } public static System.IntPtr GetHINSTANCE(System.Reflection.Module m) { throw null; } public static int GetHRForException(System.Exception? e) { throw null; } public static int GetHRForLastWin32Error() { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static System.IntPtr GetIDispatchForObject(object o) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static System.IntPtr GetIUnknownForObject(object o) { throw null; } public static int GetLastPInvokeError() { throw null; } public static int GetLastSystemError() { throw null; } public static int GetLastWin32Error() { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void GetNativeVariantForObject(object? obj, System.IntPtr pDstNativeVariant) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void GetNativeVariantForObject<T>(T? obj, System.IntPtr pDstNativeVariant) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object GetObjectForIUnknown(System.IntPtr pUnk) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static object? GetObjectForNativeVariant(System.IntPtr pSrcNativeVariant) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static T? GetObjectForNativeVariant<T>(System.IntPtr pSrcNativeVariant) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static object?[] GetObjectsForNativeVariants(System.IntPtr aSrcNativeVariant, int cVars) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static T[] GetObjectsForNativeVariants<T>(System.IntPtr aSrcNativeVariant, int cVars) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static int GetStartComSlot(System.Type t) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object GetTypedObjectForIUnknown(System.IntPtr pUnk, System.Type t) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static System.Type? GetTypeFromCLSID(System.Guid clsid) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static string GetTypeInfoName(System.Runtime.InteropServices.ComTypes.ITypeInfo typeInfo) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object GetUniqueObjectForIUnknown(System.IntPtr unknown) { throw null; } public static void InitHandle(SafeHandle safeHandle, IntPtr handle) { } public static bool IsComObject(object o) { throw null; } public static bool IsTypeVisibleFromCom(System.Type t) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr OffsetOf(System.Type t, string fieldName) { throw null; } public static System.IntPtr OffsetOf<T>(string fieldName) { throw null; } public static void Prelink(System.Reflection.MethodInfo m) { } public static void PrelinkAll(System.Type c) { } public static string? PtrToStringAnsi(System.IntPtr ptr) { throw null; } public static string PtrToStringAnsi(System.IntPtr ptr, int len) { throw null; } public static string? PtrToStringAuto(System.IntPtr ptr) { throw null; } public static string? PtrToStringAuto(System.IntPtr ptr, int len) { throw null; } public static string PtrToStringBSTR(System.IntPtr ptr) { throw null; } public static string? PtrToStringUni(System.IntPtr ptr) { throw null; } public static string PtrToStringUni(System.IntPtr ptr, int len) { throw null; } public static string? PtrToStringUTF8(System.IntPtr ptr) { throw null; } public static string PtrToStringUTF8(System.IntPtr ptr, int byteLen) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void PtrToStructure(System.IntPtr ptr, object structure) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static object? PtrToStructure(System.IntPtr ptr, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors| System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type structureType) { throw null; } public static T? PtrToStructure<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]T>(System.IntPtr ptr) { throw null; } public static void PtrToStructure<T>(System.IntPtr ptr, [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T structure) { } public static int QueryInterface(System.IntPtr pUnk, ref System.Guid iid, out System.IntPtr ppv) { throw null; } public static byte ReadByte(System.IntPtr ptr) { throw null; } public static byte ReadByte(System.IntPtr ptr, int ofs) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("ReadByte(Object, Int32) may be unavailable in future releases.")] public static byte ReadByte(object ptr, int ofs) { throw null; } public static short ReadInt16(System.IntPtr ptr) { throw null; } public static short ReadInt16(System.IntPtr ptr, int ofs) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("ReadInt16(Object, Int32) may be unavailable in future releases.")] public static short ReadInt16(object ptr, int ofs) { throw null; } public static int ReadInt32(System.IntPtr ptr) { throw null; } public static int ReadInt32(System.IntPtr ptr, int ofs) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("ReadInt32(Object, Int32) may be unavailable in future releases.")] public static int ReadInt32(object ptr, int ofs) { throw null; } public static long ReadInt64(System.IntPtr ptr) { throw null; } public static long ReadInt64(System.IntPtr ptr, int ofs) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("ReadInt64(Object, Int32) may be unavailable in future releases.")] public static long ReadInt64(object ptr, int ofs) { throw null; } public static System.IntPtr ReadIntPtr(System.IntPtr ptr) { throw null; } public static System.IntPtr ReadIntPtr(System.IntPtr ptr, int ofs) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("ReadIntPtr(Object, Int32) may be unavailable in future releases.")] public static System.IntPtr ReadIntPtr(object ptr, int ofs) { throw null; } public static System.IntPtr ReAllocCoTaskMem(System.IntPtr pv, int cb) { throw null; } public static System.IntPtr ReAllocHGlobal(System.IntPtr pv, System.IntPtr cb) { throw null; } public static int Release(System.IntPtr pUnk) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static int ReleaseComObject(object o) { throw null; } public static System.IntPtr SecureStringToBSTR(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToCoTaskMemAnsi(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToCoTaskMemUnicode(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToGlobalAllocAnsi(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToGlobalAllocUnicode(System.Security.SecureString s) { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static bool SetComObjectData(object obj, object key, object? data) { throw null; } public static void SetLastPInvokeError(int error) { throw null; } public static void SetLastSystemError(int error) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available. Use the SizeOf<T> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static int SizeOf(object structure) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available. Use the SizeOf<T> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static int SizeOf(System.Type t) { throw null; } public static int SizeOf<T>() { throw null; } public static int SizeOf<T>(T structure) { throw null; } public static System.IntPtr StringToBSTR(string? s) { throw null; } public static System.IntPtr StringToCoTaskMemAnsi(string? s) { throw null; } public static System.IntPtr StringToCoTaskMemAuto(string? s) { throw null; } public static System.IntPtr StringToCoTaskMemUni(string? s) { throw null; } public static System.IntPtr StringToCoTaskMemUTF8(string? s) { throw null; } public static System.IntPtr StringToHGlobalAnsi(string? s) { throw null; } public static System.IntPtr StringToHGlobalAuto(string? s) { throw null; } public static System.IntPtr StringToHGlobalUni(string? s) { throw null; } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available. Use the StructureToPtr<T> overload instead.")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void StructureToPtr(object structure, System.IntPtr ptr, bool fDeleteOld) { } public static void StructureToPtr<T>([System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T structure, System.IntPtr ptr, bool fDeleteOld) { } public static void ThrowExceptionForHR(int errorCode) { } public static void ThrowExceptionForHR(int errorCode, System.IntPtr errorInfo) { } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static System.IntPtr UnsafeAddrOfPinnedArrayElement(System.Array arr, int index) { throw null; } public static System.IntPtr UnsafeAddrOfPinnedArrayElement<T>(T[] arr, int index) { throw null; } public static void WriteByte(System.IntPtr ptr, byte val) { } public static void WriteByte(System.IntPtr ptr, int ofs, byte val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteByte(Object, Int32, Byte) may be unavailable in future releases.")] public static void WriteByte(object ptr, int ofs, byte val) { } public static void WriteInt16(System.IntPtr ptr, char val) { } public static void WriteInt16(System.IntPtr ptr, short val) { } public static void WriteInt16(System.IntPtr ptr, int ofs, char val) { } public static void WriteInt16(System.IntPtr ptr, int ofs, short val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteInt16(Object, Int32, Char) may be unavailable in future releases.")] public static void WriteInt16(object ptr, int ofs, char val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteInt16(Object, Int32, Int16) may be unavailable in future releases.")] public static void WriteInt16(object ptr, int ofs, short val) { } public static void WriteInt32(System.IntPtr ptr, int val) { } public static void WriteInt32(System.IntPtr ptr, int ofs, int val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteInt32(Object, Int32, Int32) may be unavailable in future releases.")] public static void WriteInt32(object ptr, int ofs, int val) { } public static void WriteInt64(System.IntPtr ptr, int ofs, long val) { } public static void WriteInt64(System.IntPtr ptr, long val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteInt64(Object, Int32, Int64) may be unavailable in future releases.")] public static void WriteInt64(object ptr, int ofs, long val) { } public static void WriteIntPtr(System.IntPtr ptr, int ofs, System.IntPtr val) { } public static void WriteIntPtr(System.IntPtr ptr, System.IntPtr val) { } [System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Marshalling code for the object might not be available")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.ObsoleteAttribute("WriteIntPtr(Object, Int32, IntPtr) may be unavailable in future releases.")] public static void WriteIntPtr(object ptr, int ofs, System.IntPtr val) { } public static void ZeroFreeBSTR(System.IntPtr s) { } public static void ZeroFreeCoTaskMemAnsi(System.IntPtr s) { } public static void ZeroFreeCoTaskMemUnicode(System.IntPtr s) { } public static void ZeroFreeCoTaskMemUTF8(System.IntPtr s) { } public static void ZeroFreeGlobalAllocAnsi(System.IntPtr s) { } public static void ZeroFreeGlobalAllocUnicode(System.IntPtr s) { } } [System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue, Inherited=false)] public sealed partial class MarshalAsAttribute : System.Attribute { public System.Runtime.InteropServices.UnmanagedType ArraySubType; public int IidParameterIndex; public string? MarshalCookie; public string? MarshalType; public System.Type? MarshalTypeRef; public System.Runtime.InteropServices.VarEnum SafeArraySubType; public System.Type? SafeArrayUserDefinedSubType; public int SizeConst; public short SizeParamIndex; public MarshalAsAttribute(short unmanagedType) { } public MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType unmanagedType) { } public System.Runtime.InteropServices.UnmanagedType Value { get { throw null; } } } public partial class MarshalDirectiveException : System.SystemException { public MarshalDirectiveException() { } protected MarshalDirectiveException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public MarshalDirectiveException(string? message) { } public MarshalDirectiveException(string? message, System.Exception? inner) { } } public static partial class NativeLibrary { public static void Free(System.IntPtr handle) { } public static System.IntPtr GetExport(System.IntPtr handle, string name) { throw null; } public static System.IntPtr Load(string libraryPath) { throw null; } public static System.IntPtr Load(string libraryName, System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportSearchPath? searchPath) { throw null; } public static void SetDllImportResolver(System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportResolver resolver) { } public static bool TryGetExport(System.IntPtr handle, string name, out System.IntPtr address) { throw null; } public static bool TryLoad(string libraryPath, out System.IntPtr handle) { throw null; } public static bool TryLoad(string libraryName, System.Reflection.Assembly assembly, System.Runtime.InteropServices.DllImportSearchPath? searchPath, out System.IntPtr handle) { throw null; } } public static unsafe partial class NativeMemory { [System.CLSCompliantAttribute(false)] public static void* AlignedAlloc(nuint byteCount, nuint alignment) { throw null; } [System.CLSCompliantAttribute(false)] public static void AlignedFree(void* ptr) { } [System.CLSCompliantAttribute(false)] public static void* AlignedRealloc(void* ptr, nuint byteCount, nuint alignment) { throw null; } [System.CLSCompliantAttribute(false)] public static void* Alloc(nuint byteCount) { throw null; } [System.CLSCompliantAttribute(false)] public static void* Alloc(nuint elementCount, nuint elementSize) { throw null; } [System.CLSCompliantAttribute(false)] public static void* AllocZeroed(nuint byteCount) { throw null; } [System.CLSCompliantAttribute(false)] public static void* AllocZeroed(nuint elementCount, nuint elementSize) { throw null; } [System.CLSCompliantAttribute(false)] public static void Free(void* ptr) { } [System.CLSCompliantAttribute(false)] public static void* Realloc(void* ptr, nuint byteCount) { throw null; } } public readonly partial struct NFloat : System.IComparable, System.IComparable<System.Runtime.InteropServices.NFloat>, System.IEquatable<System.Runtime.InteropServices.NFloat>, System.IFormattable, System.ISpanFormattable { private readonly int _dummyPrimitive; public NFloat(double value) { throw null; } public NFloat(float value) { throw null; } public static System.Runtime.InteropServices.NFloat Epsilon { get { throw null; } } public static System.Runtime.InteropServices.NFloat MaxValue { get { throw null; } } public static System.Runtime.InteropServices.NFloat MinValue { get { throw null; } } public static System.Runtime.InteropServices.NFloat NaN { get { throw null; } } public static System.Runtime.InteropServices.NFloat NegativeInfinity { get { throw null; } } public static System.Runtime.InteropServices.NFloat PositiveInfinity { get { throw null; } } public static int Size { get { throw null; } } public double Value { get { throw null; } } public int CompareTo(object? obj) { throw null; } public int CompareTo(System.Runtime.InteropServices.NFloat other) { throw null; } public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; } public bool Equals(System.Runtime.InteropServices.NFloat other) { throw null; } public override int GetHashCode() { throw null; } public static bool IsFinite(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsInfinity(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsNaN(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsNegative(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsNegativeInfinity(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsNormal(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsPositiveInfinity(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool IsSubnormal(System.Runtime.InteropServices.NFloat value) { throw null; } public static System.Runtime.InteropServices.NFloat operator +(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static System.Runtime.InteropServices.NFloat operator --(System.Runtime.InteropServices.NFloat value) { throw null; } public static System.Runtime.InteropServices.NFloat operator /(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static bool operator ==(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static explicit operator System.Runtime.InteropServices.NFloat (decimal value) { throw null; } public static explicit operator System.Runtime.InteropServices.NFloat (double value) { throw null; } public static explicit operator byte (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator char (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator decimal (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator short (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator int (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator long (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator nint (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static explicit operator sbyte (System.Runtime.InteropServices.NFloat value) { throw null; } public static explicit operator float (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static explicit operator ushort (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static explicit operator uint (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static explicit operator ulong (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static explicit operator nuint (System.Runtime.InteropServices.NFloat value) { throw null; } public static bool operator >(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static bool operator >=(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (byte value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (char value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (short value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (int value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (long value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (nint value) { throw null; } public static implicit operator double (System.Runtime.InteropServices.NFloat value) { throw null; } [System.CLSCompliantAttribute(false)] public static implicit operator System.Runtime.InteropServices.NFloat (sbyte value) { throw null; } public static implicit operator System.Runtime.InteropServices.NFloat (float value) { throw null; } [System.CLSCompliantAttribute(false)] public static implicit operator System.Runtime.InteropServices.NFloat (ushort value) { throw null; } [System.CLSCompliantAttribute(false)] public static implicit operator System.Runtime.InteropServices.NFloat (uint value) { throw null; } [System.CLSCompliantAttribute(false)] public static implicit operator System.Runtime.InteropServices.NFloat (ulong value) { throw null; } [System.CLSCompliantAttribute(false)] public static implicit operator System.Runtime.InteropServices.NFloat (nuint value) { throw null; } public static System.Runtime.InteropServices.NFloat operator ++(System.Runtime.InteropServices.NFloat value) { throw null; } public static bool operator !=(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static bool operator <(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static bool operator <=(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static System.Runtime.InteropServices.NFloat operator %(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static System.Runtime.InteropServices.NFloat operator *(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static System.Runtime.InteropServices.NFloat operator -(System.Runtime.InteropServices.NFloat left, System.Runtime.InteropServices.NFloat right) { throw null; } public static System.Runtime.InteropServices.NFloat operator -(System.Runtime.InteropServices.NFloat value) { throw null; } public static System.Runtime.InteropServices.NFloat operator +(System.Runtime.InteropServices.NFloat value) { throw null; } public static System.Runtime.InteropServices.NFloat Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; } public static System.Runtime.InteropServices.NFloat Parse(string s) { throw null; } public static System.Runtime.InteropServices.NFloat Parse(string s, System.Globalization.NumberStyles style) { throw null; } public static System.Runtime.InteropServices.NFloat Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; } public static System.Runtime.InteropServices.NFloat Parse(string s, System.IFormatProvider? provider) { throw null; } public override string ToString() { throw null; } public string ToString(System.IFormatProvider? provider) { throw null; } public string ToString(string? format) { throw null; } public string ToString(string? format, System.IFormatProvider? provider) { throw null; } public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; } public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result) { throw null; } public static bool TryParse(System.ReadOnlySpan<char> s, out System.Runtime.InteropServices.NFloat result) { throw null; } public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Runtime.InteropServices.NFloat result) { throw null; } public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Runtime.InteropServices.NFloat result) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)] public sealed partial class OptionalAttribute : System.Attribute { public OptionalAttribute() { } } public enum PosixSignal { [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGTSTP = -10, [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGTTOU = -9, [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGTTIN = -8, [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGWINCH = -7, [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGCONT = -6, [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("windows")] SIGCHLD = -5, SIGTERM = -4, SIGQUIT = -3, SIGINT = -2, SIGHUP = -1, } public sealed partial class PosixSignalContext { public PosixSignalContext(System.Runtime.InteropServices.PosixSignal signal) { } public bool Cancel { get { throw null; } set { } } public System.Runtime.InteropServices.PosixSignal Signal { get { throw null; } } } public sealed partial class PosixSignalRegistration : System.IDisposable { internal PosixSignalRegistration() { } [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("android")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")] [System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")] public static System.Runtime.InteropServices.PosixSignalRegistration Create(System.Runtime.InteropServices.PosixSignal signal, System.Action<System.Runtime.InteropServices.PosixSignalContext> handler) { throw null; } public void Dispose() { } ~PosixSignalRegistration() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class PreserveSigAttribute : System.Attribute { public PreserveSigAttribute() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false, AllowMultiple=true)] public sealed partial class PrimaryInteropAssemblyAttribute : System.Attribute { public PrimaryInteropAssemblyAttribute(int major, int minor) { } public int MajorVersion { get { throw null; } } public int MinorVersion { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=false)] public sealed partial class ProgIdAttribute : System.Attribute { public ProgIdAttribute(string progId) { } public string Value { get { throw null; } } } public static partial class RuntimeEnvironment { [System.ObsoleteAttribute("RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.", DiagnosticId = "SYSLIB0019", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public static string SystemConfigurationFile { get { throw null; } } public static bool FromGlobalAccessCache(System.Reflection.Assembly a) { throw null; } public static string GetRuntimeDirectory() { throw null; } [System.ObsoleteAttribute("RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.", DiagnosticId = "SYSLIB0019", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public static System.IntPtr GetRuntimeInterfaceAsIntPtr(System.Guid clsid, System.Guid riid) { throw null; } [System.ObsoleteAttribute("RuntimeEnvironment members SystemConfigurationFile, GetRuntimeInterfaceAsIntPtr, and GetRuntimeInterfaceAsObject are not supported and throw PlatformNotSupportedException.", DiagnosticId = "SYSLIB0019", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")] public static object GetRuntimeInterfaceAsObject(System.Guid clsid, System.Guid riid) { throw null; } public static string GetSystemVersion() { throw null; } } public partial class SafeArrayRankMismatchException : System.SystemException { public SafeArrayRankMismatchException() { } protected SafeArrayRankMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public SafeArrayRankMismatchException(string? message) { } public SafeArrayRankMismatchException(string? message, System.Exception? inner) { } } public partial class SafeArrayTypeMismatchException : System.SystemException { public SafeArrayTypeMismatchException() { } protected SafeArrayTypeMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public SafeArrayTypeMismatchException(string? message) { } public SafeArrayTypeMismatchException(string? message, System.Exception? inner) { } } public partial class SEHException : System.Runtime.InteropServices.ExternalException { public SEHException() { } protected SEHException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public SEHException(string? message) { } public SEHException(string? message, System.Exception? inner) { } public virtual bool CanResume() { throw null; } } public partial class StandardOleMarshalObject : System.MarshalByRefObject { protected StandardOleMarshalObject() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)] public sealed partial class TypeIdentifierAttribute : System.Attribute { public TypeIdentifierAttribute() { } public TypeIdentifierAttribute(string? scope, string? identifier) { } public string? Identifier { get { throw null; } } public string? Scope { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)] public sealed partial class TypeLibFuncAttribute : System.Attribute { public TypeLibFuncAttribute(short flags) { } public TypeLibFuncAttribute(System.Runtime.InteropServices.TypeLibFuncFlags flags) { } public System.Runtime.InteropServices.TypeLibFuncFlags Value { get { throw null; } } } [System.FlagsAttribute] public enum TypeLibFuncFlags { FRestricted = 1, FSource = 2, FBindable = 4, FRequestEdit = 8, FDisplayBind = 16, FDefaultBind = 32, FHidden = 64, FUsesGetLastError = 128, FDefaultCollelem = 256, FUiDefault = 512, FNonBrowsable = 1024, FReplaceable = 2048, FImmediateBind = 4096, } [System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited=false)] public sealed partial class TypeLibImportClassAttribute : System.Attribute { public TypeLibImportClassAttribute(System.Type importClass) { } public string Value { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, Inherited=false)] public sealed partial class TypeLibTypeAttribute : System.Attribute { public TypeLibTypeAttribute(short flags) { } public TypeLibTypeAttribute(System.Runtime.InteropServices.TypeLibTypeFlags flags) { } public System.Runtime.InteropServices.TypeLibTypeFlags Value { get { throw null; } } } [System.FlagsAttribute] public enum TypeLibTypeFlags { FAppObject = 1, FCanCreate = 2, FLicensed = 4, FPreDeclId = 8, FHidden = 16, FControl = 32, FDual = 64, FNonExtensible = 128, FOleAutomation = 256, FRestricted = 512, FAggregatable = 1024, FReplaceable = 2048, FDispatchable = 4096, FReverseBind = 8192, } [System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)] public sealed partial class TypeLibVarAttribute : System.Attribute { public TypeLibVarAttribute(short flags) { } public TypeLibVarAttribute(System.Runtime.InteropServices.TypeLibVarFlags flags) { } public System.Runtime.InteropServices.TypeLibVarFlags Value { get { throw null; } } } [System.FlagsAttribute] public enum TypeLibVarFlags { FReadOnly = 1, FSource = 2, FBindable = 4, FRequestEdit = 8, FDisplayBind = 16, FDefaultBind = 32, FHidden = 64, FRestricted = 128, FDefaultCollelem = 256, FUiDefault = 512, FNonBrowsable = 1024, FReplaceable = 2048, FImmediateBind = 4096, } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)] public sealed partial class TypeLibVersionAttribute : System.Attribute { public TypeLibVersionAttribute(int major, int minor) { } public int MajorVersion { get { throw null; } } public int MinorVersion { get { throw null; } } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class UnknownWrapper { public UnknownWrapper(object? obj) { } public object? WrappedObject { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Delegate, AllowMultiple=false, Inherited=false)] public sealed partial class UnmanagedFunctionPointerAttribute : System.Attribute { public bool BestFitMapping; public System.Runtime.InteropServices.CharSet CharSet; public bool SetLastError; public bool ThrowOnUnmappableChar; public UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention callingConvention) { } public System.Runtime.InteropServices.CallingConvention CallingConvention { get { throw null; } } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum VarEnum { VT_EMPTY = 0, VT_NULL = 1, VT_I2 = 2, VT_I4 = 3, VT_R4 = 4, VT_R8 = 5, VT_CY = 6, VT_DATE = 7, VT_BSTR = 8, VT_DISPATCH = 9, VT_ERROR = 10, VT_BOOL = 11, VT_VARIANT = 12, VT_UNKNOWN = 13, VT_DECIMAL = 14, VT_I1 = 16, VT_UI1 = 17, VT_UI2 = 18, VT_UI4 = 19, VT_I8 = 20, VT_UI8 = 21, VT_INT = 22, VT_UINT = 23, VT_VOID = 24, VT_HRESULT = 25, VT_PTR = 26, VT_SAFEARRAY = 27, VT_CARRAY = 28, VT_USERDEFINED = 29, VT_LPSTR = 30, VT_LPWSTR = 31, VT_RECORD = 36, VT_FILETIME = 64, VT_BLOB = 65, VT_STREAM = 66, VT_STORAGE = 67, VT_STREAMED_OBJECT = 68, VT_STORED_OBJECT = 69, VT_BLOB_OBJECT = 70, VT_CF = 71, VT_CLSID = 72, VT_VECTOR = 4096, VT_ARRAY = 8192, VT_BYREF = 16384, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class VariantWrapper { public VariantWrapper(object? obj) { } public object? WrappedObject { get { throw null; } } } [System.FlagsAttribute] public enum CreateComInterfaceFlags { None = 0, CallerDefinedIUnknown = 1, TrackerSupport = 2, } [System.FlagsAttribute] public enum CreateObjectFlags { None = 0, TrackerObject = 1, UniqueInstance = 2, Aggregation = 4, Unwrap = 8, } [System.Runtime.Versioning.UnsupportedOSPlatform("android")] [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] [System.Runtime.Versioning.UnsupportedOSPlatform("ios")] [System.Runtime.Versioning.UnsupportedOSPlatform("tvos")] [System.CLSCompliantAttribute(false)] public abstract class ComWrappers { public struct ComInterfaceEntry { public System.Guid IID; public System.IntPtr Vtable; } public struct ComInterfaceDispatch { public System.IntPtr Vtable; public unsafe static T GetInstance<T>(ComInterfaceDispatch* dispatchPtr) where T : class { throw null; } } public System.IntPtr GetOrCreateComInterfaceForObject(object instance, CreateComInterfaceFlags flags) { throw null; } protected unsafe abstract ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count); public object GetOrCreateObjectForComInstance(System.IntPtr externalComObject, CreateObjectFlags flags) { throw null; } protected abstract object? CreateObject(System.IntPtr externalComObject, CreateObjectFlags flags); public object GetOrRegisterObjectForComInstance(System.IntPtr externalComObject, CreateObjectFlags flags, object wrapper) { throw null; } public object GetOrRegisterObjectForComInstance(System.IntPtr externalComObject, CreateObjectFlags flags, object wrapper, System.IntPtr inner) { throw null; } protected abstract void ReleaseObjects(System.Collections.IEnumerable objects); public static void RegisterForTrackerSupport(ComWrappers instance) { } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void RegisterForMarshalling(ComWrappers instance) { } protected static void GetIUnknownImpl(out System.IntPtr fpQueryInterface, out System.IntPtr fpAddRef, out System.IntPtr fpRelease) { throw null; } } [System.AttributeUsageAttribute(System.AttributeTargets.Method, AllowMultiple = false, Inherited = false)] public sealed class UnmanagedCallConvAttribute : System.Attribute { public UnmanagedCallConvAttribute() { } public System.Type[]? CallConvs; } [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited = false)] public sealed class UnmanagedCallersOnlyAttribute : System.Attribute { public UnmanagedCallersOnlyAttribute() { } public System.Type[]? CallConvs; public string? EntryPoint; } } namespace System.Runtime.InteropServices.ComTypes { [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum ADVF { ADVF_NODATA = 1, ADVF_PRIMEFIRST = 2, ADVF_ONLYONCE = 4, ADVFCACHE_NOHANDLER = 8, ADVFCACHE_FORCEBUILTIN = 16, ADVFCACHE_ONSAVE = 32, ADVF_DATAONSTOP = 64, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)] public partial struct BINDPTR { [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.IntPtr lpfuncdesc; [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.IntPtr lptcomp; [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.IntPtr lpvardesc; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct BIND_OPTS { public int cbStruct; public int dwTickCountDeadline; public int grfFlags; public int grfMode; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum CALLCONV { CC_CDECL = 1, CC_MSCPASCAL = 2, CC_PASCAL = 2, CC_MACPASCAL = 3, CC_STDCALL = 4, CC_RESERVED = 5, CC_SYSCALL = 6, CC_MPWCDECL = 7, CC_MPWPASCAL = 8, CC_MAX = 9, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct CONNECTDATA { public int dwCookie; public object pUnk; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum DATADIR { DATADIR_GET = 1, DATADIR_SET = 2, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum DESCKIND { DESCKIND_NONE = 0, DESCKIND_FUNCDESC = 1, DESCKIND_VARDESC = 2, DESCKIND_TYPECOMP = 3, DESCKIND_IMPLICITAPPOBJ = 4, DESCKIND_MAX = 5, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct DISPPARAMS { public int cArgs; public int cNamedArgs; public System.IntPtr rgdispidNamedArgs; public System.IntPtr rgvarg; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum DVASPECT { DVASPECT_CONTENT = 1, DVASPECT_THUMBNAIL = 2, DVASPECT_ICON = 4, DVASPECT_DOCPRINT = 8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct ELEMDESC { public System.Runtime.InteropServices.ComTypes.ELEMDESC.DESCUNION desc; public System.Runtime.InteropServices.ComTypes.TYPEDESC tdesc; [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)] public partial struct DESCUNION { [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.Runtime.InteropServices.ComTypes.IDLDESC idldesc; [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.Runtime.InteropServices.ComTypes.PARAMDESC paramdesc; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct EXCEPINFO { public string bstrDescription; public string bstrHelpFile; public string bstrSource; public int dwHelpContext; public System.IntPtr pfnDeferredFillIn; public System.IntPtr pvReserved; public int scode; public short wCode; public short wReserved; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct FILETIME { public int dwHighDateTime; public int dwLowDateTime; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct FORMATETC { public short cfFormat; public System.Runtime.InteropServices.ComTypes.DVASPECT dwAspect; public int lindex; public System.IntPtr ptd; public System.Runtime.InteropServices.ComTypes.TYMED tymed; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct FUNCDESC { public System.Runtime.InteropServices.ComTypes.CALLCONV callconv; public short cParams; public short cParamsOpt; public short cScodes; public System.Runtime.InteropServices.ComTypes.ELEMDESC elemdescFunc; public System.Runtime.InteropServices.ComTypes.FUNCKIND funckind; public System.Runtime.InteropServices.ComTypes.INVOKEKIND invkind; public System.IntPtr lprgelemdescParam; public System.IntPtr lprgscode; public int memid; public short oVft; public short wFuncFlags; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum FUNCFLAGS : short { FUNCFLAG_FRESTRICTED = (short)1, FUNCFLAG_FSOURCE = (short)2, FUNCFLAG_FBINDABLE = (short)4, FUNCFLAG_FREQUESTEDIT = (short)8, FUNCFLAG_FDISPLAYBIND = (short)16, FUNCFLAG_FDEFAULTBIND = (short)32, FUNCFLAG_FHIDDEN = (short)64, FUNCFLAG_FUSESGETLASTERROR = (short)128, FUNCFLAG_FDEFAULTCOLLELEM = (short)256, FUNCFLAG_FUIDEFAULT = (short)512, FUNCFLAG_FNONBROWSABLE = (short)1024, FUNCFLAG_FREPLACEABLE = (short)2048, FUNCFLAG_FIMMEDIATEBIND = (short)4096, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum FUNCKIND { FUNC_VIRTUAL = 0, FUNC_PUREVIRTUAL = 1, FUNC_NONVIRTUAL = 2, FUNC_STATIC = 3, FUNC_DISPATCH = 4, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IAdviseSink { void OnClose(); void OnDataChange(ref System.Runtime.InteropServices.ComTypes.FORMATETC format, ref System.Runtime.InteropServices.ComTypes.STGMEDIUM stgmedium); void OnRename(System.Runtime.InteropServices.ComTypes.IMoniker moniker); void OnSave(); void OnViewChange(int aspect, int index); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IBindCtx { void EnumObjectParam(out System.Runtime.InteropServices.ComTypes.IEnumString? ppenum); void GetBindOptions(ref System.Runtime.InteropServices.ComTypes.BIND_OPTS pbindopts); void GetObjectParam(string pszKey, out object? ppunk); void GetRunningObjectTable(out System.Runtime.InteropServices.ComTypes.IRunningObjectTable? pprot); void RegisterObjectBound(object punk); void RegisterObjectParam(string pszKey, object punk); void ReleaseBoundObjects(); void RevokeObjectBound(object punk); int RevokeObjectParam(string pszKey); void SetBindOptions(ref System.Runtime.InteropServices.ComTypes.BIND_OPTS pbindopts); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IConnectionPoint { void Advise(object pUnkSink, out int pdwCookie); void EnumConnections(out System.Runtime.InteropServices.ComTypes.IEnumConnections ppEnum); void GetConnectionInterface(out System.Guid pIID); void GetConnectionPointContainer(out System.Runtime.InteropServices.ComTypes.IConnectionPointContainer ppCPC); void Unadvise(int dwCookie); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IConnectionPointContainer { void EnumConnectionPoints(out System.Runtime.InteropServices.ComTypes.IEnumConnectionPoints ppEnum); void FindConnectionPoint(ref System.Guid riid, out System.Runtime.InteropServices.ComTypes.IConnectionPoint? ppCP); } [System.CLSCompliantAttribute(false)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IDataObject { int DAdvise(ref System.Runtime.InteropServices.ComTypes.FORMATETC pFormatetc, System.Runtime.InteropServices.ComTypes.ADVF advf, System.Runtime.InteropServices.ComTypes.IAdviseSink adviseSink, out int connection); void DUnadvise(int connection); int EnumDAdvise(out System.Runtime.InteropServices.ComTypes.IEnumSTATDATA? enumAdvise); System.Runtime.InteropServices.ComTypes.IEnumFORMATETC EnumFormatEtc(System.Runtime.InteropServices.ComTypes.DATADIR direction); int GetCanonicalFormatEtc(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatIn, out System.Runtime.InteropServices.ComTypes.FORMATETC formatOut); void GetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC format, out System.Runtime.InteropServices.ComTypes.STGMEDIUM medium); void GetDataHere(ref System.Runtime.InteropServices.ComTypes.FORMATETC format, ref System.Runtime.InteropServices.ComTypes.STGMEDIUM medium); int QueryGetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC format); void SetData(ref System.Runtime.InteropServices.ComTypes.FORMATETC formatIn, ref System.Runtime.InteropServices.ComTypes.STGMEDIUM medium, bool release); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct IDLDESC { public System.IntPtr dwReserved; public System.Runtime.InteropServices.ComTypes.IDLFLAG wIDLFlags; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum IDLFLAG : short { IDLFLAG_NONE = (short)0, IDLFLAG_FIN = (short)1, IDLFLAG_FOUT = (short)2, IDLFLAG_FLCID = (short)4, IDLFLAG_FRETVAL = (short)8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumConnectionPoints { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumConnectionPoints ppenum); int Next(int celt, System.Runtime.InteropServices.ComTypes.IConnectionPoint[] rgelt, System.IntPtr pceltFetched); void Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumConnections { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumConnections ppenum); int Next(int celt, System.Runtime.InteropServices.ComTypes.CONNECTDATA[] rgelt, System.IntPtr pceltFetched); void Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumFORMATETC { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumFORMATETC newEnum); int Next(int celt, System.Runtime.InteropServices.ComTypes.FORMATETC[] rgelt, int[] pceltFetched); int Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumMoniker { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumMoniker ppenum); int Next(int celt, System.Runtime.InteropServices.ComTypes.IMoniker[] rgelt, System.IntPtr pceltFetched); void Reset(); int Skip(int celt); } [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumSTATDATA { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumSTATDATA newEnum); int Next(int celt, System.Runtime.InteropServices.ComTypes.STATDATA[] rgelt, int[] pceltFetched); int Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumString { void Clone(out System.Runtime.InteropServices.ComTypes.IEnumString ppenum); int Next(int celt, string[] rgelt, System.IntPtr pceltFetched); void Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IEnumVARIANT { System.Runtime.InteropServices.ComTypes.IEnumVARIANT Clone(); int Next(int celt, object?[] rgVar, System.IntPtr pceltFetched); int Reset(); int Skip(int celt); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IMoniker { void BindToObject(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker? pmkToLeft, ref System.Guid riidResult, out object ppvResult); void BindToStorage(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker? pmkToLeft, ref System.Guid riid, out object ppvObj); void CommonPrefixWith(System.Runtime.InteropServices.ComTypes.IMoniker pmkOther, out System.Runtime.InteropServices.ComTypes.IMoniker? ppmkPrefix); void ComposeWith(System.Runtime.InteropServices.ComTypes.IMoniker pmkRight, bool fOnlyIfNotGeneric, out System.Runtime.InteropServices.ComTypes.IMoniker? ppmkComposite); void Enum(bool fForward, out System.Runtime.InteropServices.ComTypes.IEnumMoniker? ppenumMoniker); void GetClassID(out System.Guid pClassID); void GetDisplayName(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker? pmkToLeft, out string ppszDisplayName); void GetSizeMax(out long pcbSize); void GetTimeOfLastChange(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker? pmkToLeft, out System.Runtime.InteropServices.ComTypes.FILETIME pFileTime); void Hash(out int pdwHash); void Inverse(out System.Runtime.InteropServices.ComTypes.IMoniker ppmk); int IsDirty(); int IsEqual(System.Runtime.InteropServices.ComTypes.IMoniker pmkOtherMoniker); int IsRunning(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker? pmkToLeft, System.Runtime.InteropServices.ComTypes.IMoniker? pmkNewlyRunning); int IsSystemMoniker(out int pdwMksys); void Load(System.Runtime.InteropServices.ComTypes.IStream pStm); void ParseDisplayName(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, System.Runtime.InteropServices.ComTypes.IMoniker pmkToLeft, string pszDisplayName, out int pchEaten, out System.Runtime.InteropServices.ComTypes.IMoniker ppmkOut); void Reduce(System.Runtime.InteropServices.ComTypes.IBindCtx pbc, int dwReduceHowFar, ref System.Runtime.InteropServices.ComTypes.IMoniker? ppmkToLeft, out System.Runtime.InteropServices.ComTypes.IMoniker? ppmkReduced); void RelativePathTo(System.Runtime.InteropServices.ComTypes.IMoniker pmkOther, out System.Runtime.InteropServices.ComTypes.IMoniker? ppmkRelPath); void Save(System.Runtime.InteropServices.ComTypes.IStream pStm, bool fClearDirty); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum IMPLTYPEFLAGS { IMPLTYPEFLAG_FDEFAULT = 1, IMPLTYPEFLAG_FSOURCE = 2, IMPLTYPEFLAG_FRESTRICTED = 4, IMPLTYPEFLAG_FDEFAULTVTABLE = 8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum INVOKEKIND { INVOKE_FUNC = 1, INVOKE_PROPERTYGET = 2, INVOKE_PROPERTYPUT = 4, INVOKE_PROPERTYPUTREF = 8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IPersistFile { void GetClassID(out System.Guid pClassID); void GetCurFile(out string ppszFileName); int IsDirty(); void Load(string pszFileName, int dwMode); void Save(string? pszFileName, bool fRemember); void SaveCompleted(string pszFileName); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IRunningObjectTable { void EnumRunning(out System.Runtime.InteropServices.ComTypes.IEnumMoniker ppenumMoniker); int GetObject(System.Runtime.InteropServices.ComTypes.IMoniker pmkObjectName, out object ppunkObject); int GetTimeOfLastChange(System.Runtime.InteropServices.ComTypes.IMoniker pmkObjectName, out System.Runtime.InteropServices.ComTypes.FILETIME pfiletime); int IsRunning(System.Runtime.InteropServices.ComTypes.IMoniker pmkObjectName); void NoteChangeTime(int dwRegister, ref System.Runtime.InteropServices.ComTypes.FILETIME pfiletime); int Register(int grfFlags, object punkObject, System.Runtime.InteropServices.ComTypes.IMoniker pmkObjectName); void Revoke(int dwRegister); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface IStream { void Clone(out System.Runtime.InteropServices.ComTypes.IStream ppstm); void Commit(int grfCommitFlags); void CopyTo(System.Runtime.InteropServices.ComTypes.IStream pstm, long cb, System.IntPtr pcbRead, System.IntPtr pcbWritten); void LockRegion(long libOffset, long cb, int dwLockType); void Read(byte[] pv, int cb, System.IntPtr pcbRead); void Revert(); void Seek(long dlibMove, int dwOrigin, System.IntPtr plibNewPosition); void SetSize(long libNewSize); void Stat(out System.Runtime.InteropServices.ComTypes.STATSTG pstatstg, int grfStatFlag); void UnlockRegion(long libOffset, long cb, int dwLockType); void Write(byte[] pv, int cb, System.IntPtr pcbWritten); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface ITypeComp { void Bind(string szName, int lHashVal, short wFlags, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTInfo, out System.Runtime.InteropServices.ComTypes.DESCKIND pDescKind, out System.Runtime.InteropServices.ComTypes.BINDPTR pBindPtr); void BindType(string szName, int lHashVal, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTInfo, out System.Runtime.InteropServices.ComTypes.ITypeComp ppTComp); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface ITypeInfo { void AddressOfMember(int memid, System.Runtime.InteropServices.ComTypes.INVOKEKIND invKind, out System.IntPtr ppv); void CreateInstance(object? pUnkOuter, ref System.Guid riid, out object ppvObj); void GetContainingTypeLib(out System.Runtime.InteropServices.ComTypes.ITypeLib ppTLB, out int pIndex); void GetDllEntry(int memid, System.Runtime.InteropServices.ComTypes.INVOKEKIND invKind, System.IntPtr pBstrDllName, System.IntPtr pBstrName, System.IntPtr pwOrdinal); void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); void GetFuncDesc(int index, out System.IntPtr ppFuncDesc); void GetIDsOfNames(string[] rgszNames, int cNames, int[] pMemId); void GetImplTypeFlags(int index, out System.Runtime.InteropServices.ComTypes.IMPLTYPEFLAGS pImplTypeFlags); void GetMops(int memid, out string? pBstrMops); void GetNames(int memid, string[] rgBstrNames, int cMaxNames, out int pcNames); void GetRefTypeInfo(int hRef, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTI); void GetRefTypeOfImplType(int index, out int href); void GetTypeAttr(out System.IntPtr ppTypeAttr); void GetTypeComp(out System.Runtime.InteropServices.ComTypes.ITypeComp ppTComp); void GetVarDesc(int index, out System.IntPtr ppVarDesc); void Invoke(object pvInstance, int memid, short wFlags, ref System.Runtime.InteropServices.ComTypes.DISPPARAMS pDispParams, System.IntPtr pVarResult, System.IntPtr pExcepInfo, out int puArgErr); void ReleaseFuncDesc(System.IntPtr pFuncDesc); void ReleaseTypeAttr(System.IntPtr pTypeAttr); void ReleaseVarDesc(System.IntPtr pVarDesc); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface ITypeInfo2 : System.Runtime.InteropServices.ComTypes.ITypeInfo { new void AddressOfMember(int memid, System.Runtime.InteropServices.ComTypes.INVOKEKIND invKind, out System.IntPtr ppv); new void CreateInstance(object? pUnkOuter, ref System.Guid riid, out object ppvObj); void GetAllCustData(System.IntPtr pCustData); void GetAllFuncCustData(int index, System.IntPtr pCustData); void GetAllImplTypeCustData(int index, System.IntPtr pCustData); void GetAllParamCustData(int indexFunc, int indexParam, System.IntPtr pCustData); void GetAllVarCustData(int index, System.IntPtr pCustData); new void GetContainingTypeLib(out System.Runtime.InteropServices.ComTypes.ITypeLib ppTLB, out int pIndex); void GetCustData(ref System.Guid guid, out object pVarVal); new void GetDllEntry(int memid, System.Runtime.InteropServices.ComTypes.INVOKEKIND invKind, System.IntPtr pBstrDllName, System.IntPtr pBstrName, System.IntPtr pwOrdinal); new void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); void GetDocumentation2(int memid, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll); void GetFuncCustData(int index, ref System.Guid guid, out object pVarVal); new void GetFuncDesc(int index, out System.IntPtr ppFuncDesc); void GetFuncIndexOfMemId(int memid, System.Runtime.InteropServices.ComTypes.INVOKEKIND invKind, out int pFuncIndex); new void GetIDsOfNames(string[] rgszNames, int cNames, int[] pMemId); void GetImplTypeCustData(int index, ref System.Guid guid, out object pVarVal); new void GetImplTypeFlags(int index, out System.Runtime.InteropServices.ComTypes.IMPLTYPEFLAGS pImplTypeFlags); new void GetMops(int memid, out string? pBstrMops); new void GetNames(int memid, string[] rgBstrNames, int cMaxNames, out int pcNames); void GetParamCustData(int indexFunc, int indexParam, ref System.Guid guid, out object pVarVal); new void GetRefTypeInfo(int hRef, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTI); new void GetRefTypeOfImplType(int index, out int href); new void GetTypeAttr(out System.IntPtr ppTypeAttr); new void GetTypeComp(out System.Runtime.InteropServices.ComTypes.ITypeComp ppTComp); void GetTypeFlags(out int pTypeFlags); void GetTypeKind(out System.Runtime.InteropServices.ComTypes.TYPEKIND pTypeKind); void GetVarCustData(int index, ref System.Guid guid, out object pVarVal); new void GetVarDesc(int index, out System.IntPtr ppVarDesc); void GetVarIndexOfMemId(int memid, out int pVarIndex); new void Invoke(object pvInstance, int memid, short wFlags, ref System.Runtime.InteropServices.ComTypes.DISPPARAMS pDispParams, System.IntPtr pVarResult, System.IntPtr pExcepInfo, out int puArgErr); new void ReleaseFuncDesc(System.IntPtr pFuncDesc); new void ReleaseTypeAttr(System.IntPtr pTypeAttr); new void ReleaseVarDesc(System.IntPtr pVarDesc); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface ITypeLib { void FindName(string szNameBuf, int lHashVal, System.Runtime.InteropServices.ComTypes.ITypeInfo[] ppTInfo, int[] rgMemId, ref short pcFound); void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); void GetLibAttr(out System.IntPtr ppTLibAttr); void GetTypeComp(out System.Runtime.InteropServices.ComTypes.ITypeComp ppTComp); void GetTypeInfo(int index, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTI); int GetTypeInfoCount(); void GetTypeInfoOfGuid(ref System.Guid guid, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTInfo); void GetTypeInfoType(int index, out System.Runtime.InteropServices.ComTypes.TYPEKIND pTKind); bool IsName(string szNameBuf, int lHashVal); void ReleaseTLibAttr(System.IntPtr pTLibAttr); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.InterfaceTypeAttribute(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)] public partial interface ITypeLib2 : System.Runtime.InteropServices.ComTypes.ITypeLib { new void FindName(string szNameBuf, int lHashVal, System.Runtime.InteropServices.ComTypes.ITypeInfo[] ppTInfo, int[] rgMemId, ref short pcFound); void GetAllCustData(System.IntPtr pCustData); void GetCustData(ref System.Guid guid, out object pVarVal); new void GetDocumentation(int index, out string strName, out string strDocString, out int dwHelpContext, out string strHelpFile); void GetDocumentation2(int index, out string pbstrHelpString, out int pdwHelpStringContext, out string pbstrHelpStringDll); new void GetLibAttr(out System.IntPtr ppTLibAttr); void GetLibStatistics(System.IntPtr pcUniqueNames, out int pcchUniqueNames); new void GetTypeComp(out System.Runtime.InteropServices.ComTypes.ITypeComp ppTComp); new void GetTypeInfo(int index, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTI); new int GetTypeInfoCount(); new void GetTypeInfoOfGuid(ref System.Guid guid, out System.Runtime.InteropServices.ComTypes.ITypeInfo ppTInfo); new void GetTypeInfoType(int index, out System.Runtime.InteropServices.ComTypes.TYPEKIND pTKind); new bool IsName(string szNameBuf, int lHashVal); new void ReleaseTLibAttr(System.IntPtr pTLibAttr); } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum LIBFLAGS : short { LIBFLAG_FRESTRICTED = (short)1, LIBFLAG_FCONTROL = (short)2, LIBFLAG_FHIDDEN = (short)4, LIBFLAG_FHASDISKIMAGE = (short)8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct PARAMDESC { public System.IntPtr lpVarValue; public System.Runtime.InteropServices.ComTypes.PARAMFLAG wParamFlags; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum PARAMFLAG : short { PARAMFLAG_NONE = (short)0, PARAMFLAG_FIN = (short)1, PARAMFLAG_FOUT = (short)2, PARAMFLAG_FLCID = (short)4, PARAMFLAG_FRETVAL = (short)8, PARAMFLAG_FOPT = (short)16, PARAMFLAG_FHASDEFAULT = (short)32, PARAMFLAG_FHASCUSTDATA = (short)64, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct STATDATA { public System.Runtime.InteropServices.ComTypes.ADVF advf; public System.Runtime.InteropServices.ComTypes.IAdviseSink advSink; public int connection; public System.Runtime.InteropServices.ComTypes.FORMATETC formatetc; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct STATSTG { public System.Runtime.InteropServices.ComTypes.FILETIME atime; public long cbSize; public System.Guid clsid; public System.Runtime.InteropServices.ComTypes.FILETIME ctime; public int grfLocksSupported; public int grfMode; public int grfStateBits; public System.Runtime.InteropServices.ComTypes.FILETIME mtime; public string pwcsName; public int reserved; public int type; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct STGMEDIUM { public object? pUnkForRelease; public System.Runtime.InteropServices.ComTypes.TYMED tymed; public System.IntPtr unionmember; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum SYSKIND { SYS_WIN16 = 0, SYS_WIN32 = 1, SYS_MAC = 2, SYS_WIN64 = 3, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum TYMED { TYMED_NULL = 0, TYMED_HGLOBAL = 1, TYMED_FILE = 2, TYMED_ISTREAM = 4, TYMED_ISTORAGE = 8, TYMED_GDI = 16, TYMED_MFPICT = 32, TYMED_ENHMF = 64, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct TYPEATTR { public short cbAlignment; public int cbSizeInstance; public short cbSizeVft; public short cFuncs; public short cImplTypes; public short cVars; public int dwReserved; public System.Guid guid; public System.Runtime.InteropServices.ComTypes.IDLDESC idldescType; public int lcid; public System.IntPtr lpstrSchema; public const int MEMBER_ID_NIL = -1; public int memidConstructor; public int memidDestructor; public System.Runtime.InteropServices.ComTypes.TYPEDESC tdescAlias; public System.Runtime.InteropServices.ComTypes.TYPEKIND typekind; public short wMajorVerNum; public short wMinorVerNum; public System.Runtime.InteropServices.ComTypes.TYPEFLAGS wTypeFlags; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct TYPEDESC { public System.IntPtr lpValue; public short vt; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum TYPEFLAGS : short { TYPEFLAG_FAPPOBJECT = (short)1, TYPEFLAG_FCANCREATE = (short)2, TYPEFLAG_FLICENSED = (short)4, TYPEFLAG_FPREDECLID = (short)8, TYPEFLAG_FHIDDEN = (short)16, TYPEFLAG_FCONTROL = (short)32, TYPEFLAG_FDUAL = (short)64, TYPEFLAG_FNONEXTENSIBLE = (short)128, TYPEFLAG_FOLEAUTOMATION = (short)256, TYPEFLAG_FRESTRICTED = (short)512, TYPEFLAG_FAGGREGATABLE = (short)1024, TYPEFLAG_FREPLACEABLE = (short)2048, TYPEFLAG_FDISPATCHABLE = (short)4096, TYPEFLAG_FREVERSEBIND = (short)8192, TYPEFLAG_FPROXY = (short)16384, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum TYPEKIND { TKIND_ENUM = 0, TKIND_RECORD = 1, TKIND_MODULE = 2, TKIND_INTERFACE = 3, TKIND_DISPATCH = 4, TKIND_COCLASS = 5, TKIND_ALIAS = 6, TKIND_UNION = 7, TKIND_MAX = 8, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct TYPELIBATTR { public System.Guid guid; public int lcid; public System.Runtime.InteropServices.ComTypes.SYSKIND syskind; public System.Runtime.InteropServices.ComTypes.LIBFLAGS wLibFlags; public short wMajorVerNum; public short wMinorVerNum; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public partial struct VARDESC { public System.Runtime.InteropServices.ComTypes.VARDESC.DESCUNION desc; public System.Runtime.InteropServices.ComTypes.ELEMDESC elemdescVar; public string lpstrSchema; public int memid; public System.Runtime.InteropServices.ComTypes.VARKIND varkind; public short wVarFlags; [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Explicit)] public partial struct DESCUNION { [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public System.IntPtr lpvarValue; [System.Runtime.InteropServices.FieldOffsetAttribute(0)] public int oInst; } } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] [System.FlagsAttribute] public enum VARFLAGS : short { VARFLAG_FREADONLY = (short)1, VARFLAG_FSOURCE = (short)2, VARFLAG_FBINDABLE = (short)4, VARFLAG_FREQUESTEDIT = (short)8, VARFLAG_FDISPLAYBIND = (short)16, VARFLAG_FDEFAULTBIND = (short)32, VARFLAG_FHIDDEN = (short)64, VARFLAG_FRESTRICTED = (short)128, VARFLAG_FDEFAULTCOLLELEM = (short)256, VARFLAG_FUIDEFAULT = (short)512, VARFLAG_FNONBROWSABLE = (short)1024, VARFLAG_FREPLACEABLE = (short)2048, VARFLAG_FIMMEDIATEBIND = (short)4096, } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public enum VARKIND { VAR_PERINSTANCE = 0, VAR_STATIC = 1, VAR_CONST = 2, VAR_DISPATCH = 3, } } namespace System.Runtime.InteropServices.ObjectiveC { [System.Runtime.Versioning.SupportedOSPlatformAttribute("macos")] [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] public sealed class ObjectiveCTrackedTypeAttribute : System.Attribute { public ObjectiveCTrackedTypeAttribute() { } } [System.Runtime.Versioning.SupportedOSPlatformAttribute("macos")] [System.CLSCompliantAttribute(false)] public static class ObjectiveCMarshal { public unsafe delegate delegate* unmanaged<System.IntPtr, void> UnhandledExceptionPropagationHandler( System.Exception exception, System.RuntimeMethodHandle lastMethod, out System.IntPtr context); public static unsafe void Initialize( delegate* unmanaged<void> beginEndCallback, delegate* unmanaged<System.IntPtr, int> isReferencedCallback, delegate* unmanaged<System.IntPtr, void> trackedObjectEnteredFinalization, UnhandledExceptionPropagationHandler unhandledExceptionPropagationHandler) => throw null; public static GCHandle CreateReferenceTrackingHandle( object obj, out System.Span<System.IntPtr> taggedMemory) => throw null; public enum MessageSendFunction { MsgSend, MsgSendFpret, MsgSendStret, MsgSendSuper, MsgSendSuperStret, } public static void SetMessageSendCallback(MessageSendFunction msgSendFunction, System.IntPtr func) => throw null; public static void SetMessageSendPendingException(Exception? exception) => throw null; } } namespace System.Security { public sealed partial class SecureString : System.IDisposable { public SecureString() { } [System.CLSCompliantAttribute(false)] public unsafe SecureString(char* value, int length) { } public int Length { get { throw null; } } public void AppendChar(char c) { } public void Clear() { } public System.Security.SecureString Copy() { throw null; } public void Dispose() { } public void InsertAt(int index, char c) { } public bool IsReadOnly() { throw null; } public void MakeReadOnly() { } public void RemoveAt(int index) { } public void SetAt(int index, char c) { } } public static partial class SecureStringMarshal { public static System.IntPtr SecureStringToCoTaskMemAnsi(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToCoTaskMemUnicode(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToGlobalAllocAnsi(System.Security.SecureString s) { throw null; } public static System.IntPtr SecureStringToGlobalAllocUnicode(System.Security.SecureString s) { throw null; } } }
1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/apicompat/ApiCompatBaselineExcludedAttributes.txt
// These attributes shouldn't be checked against baseline reference assemblies T:System.ComponentModel.EditorBrowsableAttribute T:System.ObsoleteAttribute
// These attributes shouldn't be checked against baseline reference assemblies T:System.CLSCompliantAttribute T:System.ComponentModel.EditorBrowsableAttribute T:System.ObsoleteAttribute
1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/coreclr/System.Private.CoreLib/src/System/Diagnostics/StackFrame.CoreCLR.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Text; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace System.Diagnostics { public partial class StackFrame { /// <summary> /// Called from the class "StackTrace" /// </summary> internal StackFrame(StackFrameHelper stackFrameHelper, int skipFrames, bool needFileInfo) { _method = stackFrameHelper.GetMethodBase(skipFrames); _nativeOffset = stackFrameHelper.GetOffset(skipFrames); _ilOffset = stackFrameHelper.GetILOffset(skipFrames); _isLastFrameFromForeignExceptionStackTrace = stackFrameHelper.IsLastFrameFromForeignExceptionStackTrace(skipFrames); if (needFileInfo) { _fileName = stackFrameHelper.GetFilename(skipFrames); _lineNumber = stackFrameHelper.GetLineNumber(skipFrames); _columnNumber = stackFrameHelper.GetColumnNumber(skipFrames); } } private void BuildStackFrame(int skipFrames, bool needFileInfo) { StackFrameHelper StackF = new StackFrameHelper(null); StackF.InitializeSourceInfo(0, needFileInfo, null); int iNumOfFrames = StackF.GetNumberOfFrames(); skipFrames += StackTrace.CalculateFramesToSkip(StackF, iNumOfFrames); if ((iNumOfFrames - skipFrames) > 0) { _method = StackF.GetMethodBase(skipFrames); _nativeOffset = StackF.GetOffset(skipFrames); _ilOffset = StackF.GetILOffset(skipFrames); if (needFileInfo) { _fileName = StackF.GetFilename(skipFrames); _lineNumber = StackF.GetLineNumber(skipFrames); _columnNumber = StackF.GetColumnNumber(skipFrames); } } } #pragma warning disable IDE0060 private static bool AppendStackFrameWithoutMethodBase(StringBuilder sb) => false; #pragma warning restore IDE0060 [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "StackFrame_GetMethodDescFromNativeIP")] private static partial RuntimeMethodHandleInternal GetMethodDescFromNativeIP(IntPtr ip); /// <summary> /// Returns the MethodBase instance for the managed code IP address. /// /// Warning: The implementation of this method has race for dynamic and collectible methods. /// </summary> /// <param name="ip">code address</param> /// <returns>MethodBase instance for the method or null if IP not found</returns> internal static MethodBase? GetMethodFromNativeIP(IntPtr ip) { RuntimeMethodHandleInternal method = GetMethodDescFromNativeIP(ip); if (method.Value == IntPtr.Zero) return null; return RuntimeType.GetMethodBase(null, method); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Text; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace System.Diagnostics { public partial class StackFrame { /// <summary> /// Called from the class "StackTrace" /// </summary> internal StackFrame(StackFrameHelper stackFrameHelper, int skipFrames, bool needFileInfo) { _method = stackFrameHelper.GetMethodBase(skipFrames); _nativeOffset = stackFrameHelper.GetOffset(skipFrames); _ilOffset = stackFrameHelper.GetILOffset(skipFrames); _isLastFrameFromForeignExceptionStackTrace = stackFrameHelper.IsLastFrameFromForeignExceptionStackTrace(skipFrames); if (needFileInfo) { _fileName = stackFrameHelper.GetFilename(skipFrames); _lineNumber = stackFrameHelper.GetLineNumber(skipFrames); _columnNumber = stackFrameHelper.GetColumnNumber(skipFrames); } } private void BuildStackFrame(int skipFrames, bool needFileInfo) { StackFrameHelper StackF = new StackFrameHelper(null); StackF.InitializeSourceInfo(0, needFileInfo, null); int iNumOfFrames = StackF.GetNumberOfFrames(); skipFrames += StackTrace.CalculateFramesToSkip(StackF, iNumOfFrames); if ((iNumOfFrames - skipFrames) > 0) { _method = StackF.GetMethodBase(skipFrames); _nativeOffset = StackF.GetOffset(skipFrames); _ilOffset = StackF.GetILOffset(skipFrames); if (needFileInfo) { _fileName = StackF.GetFilename(skipFrames); _lineNumber = StackF.GetLineNumber(skipFrames); _columnNumber = StackF.GetColumnNumber(skipFrames); } } } #pragma warning disable IDE0060 private static bool AppendStackFrameWithoutMethodBase(StringBuilder sb) => false; #pragma warning restore IDE0060 [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "StackFrame_GetMethodDescFromNativeIP")] private static partial RuntimeMethodHandleInternal GetMethodDescFromNativeIP(IntPtr ip); /// <summary> /// Returns the MethodBase instance for the managed code IP address. /// /// Warning: The implementation of this method has race for dynamic and collectible methods. /// </summary> /// <param name="ip">code address</param> /// <returns>MethodBase instance for the method or null if IP not found</returns> internal static MethodBase? GetMethodFromNativeIP(IntPtr ip) { RuntimeMethodHandleInternal method = GetMethodDescFromNativeIP(ip); if (method.Value == IntPtr.Zero) return null; return RuntimeType.GetMethodBase(null, method); } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/tests/JIT/HardwareIntrinsics/General/Vector64/BitwiseOr.UInt16.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; namespace JIT.HardwareIntrinsics.General { public static partial class Program { private static void BitwiseOrUInt16() { var test = new VectorBinaryOpTest__BitwiseOrUInt16(); // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); // Validates passing a static member works test.RunClsVarScenario(); // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); // Validates passing the field of a local class works test.RunClassLclFldScenario(); // Validates passing an instance member of a class works test.RunClassFldScenario(); // Validates passing the field of a local struct works test.RunStructLclFldScenario(); // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class VectorBinaryOpTest__BitwiseOrUInt16 { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; private ulong alignment; public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt16>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt16>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>(); if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt16, byte>(ref inArray2[0]), (uint)sizeOfinArray2); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector64<UInt16> _fld1; public Vector64<UInt16> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); return testStruct; } public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrUInt16 testClass) { var result = Vector64.BitwiseOr(_fld1, _fld2); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } private static readonly int LargestVectorSize = 8; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16); private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16); private static UInt16[] _data1 = new UInt16[Op1ElementCount]; private static UInt16[] _data2 = new UInt16[Op2ElementCount]; private static Vector64<UInt16> _clsVar1; private static Vector64<UInt16> _clsVar2; private Vector64<UInt16> _fld1; private Vector64<UInt16> _fld2; private DataTable _dataTable; static VectorBinaryOpTest__BitwiseOrUInt16() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _clsVar2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); } public VectorBinaryOpTest__BitwiseOrUInt16() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); } public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = Vector64.BitwiseOr( Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray2Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var method = typeof(Vector64).GetMethod(nameof(Vector64.BitwiseOr), new Type[] { typeof(Vector64<UInt16>), typeof(Vector64<UInt16>) }); if (method is null) { method = typeof(Vector64).GetMethod(nameof(Vector64.BitwiseOr), 1, new Type[] { typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) }); } if (method.IsGenericMethodDefinition) { method = method.MakeGenericMethod(typeof(UInt16)); } var result = method.Invoke(null, new object[] { Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray2Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt16>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = Vector64.BitwiseOr( _clsVar1, _clsVar2 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray2Ptr); var result = Vector64.BitwiseOr(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new VectorBinaryOpTest__BitwiseOrUInt16(); var result = Vector64.BitwiseOr(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = Vector64.BitwiseOr(_fld1, _fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = Vector64.BitwiseOr(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } private void ValidateResult(Vector64<UInt16> op1, Vector64<UInt16> op2, void* result, [CallerMemberName] string method = "") { UInt16[] inArray1 = new UInt16[Op1ElementCount]; UInt16[] inArray2 = new UInt16[Op2ElementCount]; UInt16[] outArray = new UInt16[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), op2); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") { UInt16[] inArray1 = new UInt16[Op1ElementCount]; UInt16[] inArray2 = new UInt16[Op2ElementCount]; UInt16[] outArray = new UInt16[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") { bool succeeded = true; if (result[0] != (ushort)(left[0] | right[0])) { succeeded = false; } else { for (var i = 1; i < RetElementCount; i++) { if (result[i] != (ushort)(left[i] | right[i])) { succeeded = false; break; } } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(Vector64)}.{nameof(Vector64.BitwiseOr)}<UInt16>(Vector64<UInt16>, Vector64<UInt16>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; namespace JIT.HardwareIntrinsics.General { public static partial class Program { private static void BitwiseOrUInt16() { var test = new VectorBinaryOpTest__BitwiseOrUInt16(); // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); // Validates passing a static member works test.RunClsVarScenario(); // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); // Validates passing the field of a local class works test.RunClassLclFldScenario(); // Validates passing an instance member of a class works test.RunClassFldScenario(); // Validates passing the field of a local struct works test.RunStructLclFldScenario(); // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class VectorBinaryOpTest__BitwiseOrUInt16 { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; private ulong alignment; public DataTable(UInt16[] inArray1, UInt16[] inArray2, UInt16[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt16>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt16>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt16>(); if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt16, byte>(ref inArray2[0]), (uint)sizeOfinArray2); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector64<UInt16> _fld1; public Vector64<UInt16> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); return testStruct; } public void RunStructFldScenario(VectorBinaryOpTest__BitwiseOrUInt16 testClass) { var result = Vector64.BitwiseOr(_fld1, _fld2); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } private static readonly int LargestVectorSize = 8; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16); private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<UInt16>>() / sizeof(UInt16); private static UInt16[] _data1 = new UInt16[Op1ElementCount]; private static UInt16[] _data2 = new UInt16[Op2ElementCount]; private static Vector64<UInt16> _clsVar1; private static Vector64<UInt16> _clsVar2; private Vector64<UInt16> _fld1; private Vector64<UInt16> _fld2; private DataTable _dataTable; static VectorBinaryOpTest__BitwiseOrUInt16() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _clsVar2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); } public VectorBinaryOpTest__BitwiseOrUInt16() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt16>, byte>(ref _fld2), ref Unsafe.As<UInt16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt16(); } _dataTable = new DataTable(_data1, _data2, new UInt16[RetElementCount], LargestVectorSize); } public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = Vector64.BitwiseOr( Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray2Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var method = typeof(Vector64).GetMethod(nameof(Vector64.BitwiseOr), new Type[] { typeof(Vector64<UInt16>), typeof(Vector64<UInt16>) }); if (method is null) { method = typeof(Vector64).GetMethod(nameof(Vector64.BitwiseOr), 1, new Type[] { typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0)), typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0)) }); } if (method.IsGenericMethodDefinition) { method = method.MakeGenericMethod(typeof(UInt16)); } var result = method.Invoke(null, new object[] { Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray2Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt16>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = Vector64.BitwiseOr( _clsVar1, _clsVar2 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector64<UInt16>>(_dataTable.inArray2Ptr); var result = Vector64.BitwiseOr(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new VectorBinaryOpTest__BitwiseOrUInt16(); var result = Vector64.BitwiseOr(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = Vector64.BitwiseOr(_fld1, _fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = Vector64.BitwiseOr(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } private void ValidateResult(Vector64<UInt16> op1, Vector64<UInt16> op2, void* result, [CallerMemberName] string method = "") { UInt16[] inArray1 = new UInt16[Op1ElementCount]; UInt16[] inArray2 = new UInt16[Op2ElementCount]; UInt16[] outArray = new UInt16[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), op2); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") { UInt16[] inArray1 = new UInt16[Op1ElementCount]; UInt16[] inArray2 = new UInt16[Op2ElementCount]; UInt16[] outArray = new UInt16[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt16>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(UInt16[] left, UInt16[] right, UInt16[] result, [CallerMemberName] string method = "") { bool succeeded = true; if (result[0] != (ushort)(left[0] | right[0])) { succeeded = false; } else { for (var i = 1; i < RetElementCount; i++) { if (result[i] != (ushort)(left[i] | right[i])) { succeeded = false; break; } } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(Vector64)}.{nameof(Vector64.BitwiseOr)}<UInt16>(Vector64<UInt16>, Vector64<UInt16>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Private.Xml/src/System/Xml/Dom/XmlDocument.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text; using System.Xml.Schema; using System.Xml.XPath; using System.Security; using System.Globalization; using System.Runtime.Versioning; using System.Diagnostics.CodeAnalysis; namespace System.Xml { // Represents an entire document. An XmlDocument contains XML data. public class XmlDocument : XmlNode { private const string DocumentName = "#document"; private const string DocumentFragmentName = "#document-fragment"; private const string CommentName = "#comment"; private const string TextName = "#text"; private const string CDataSectionName = "#cdata-section"; private const string EntityName = "#entity"; private const string ID = "id"; private const string Xmlns = "xmlns"; private const string Xml = "xml"; private const string Space = "space"; private const string Lang = "lang"; private const string NonSignificantWhitespaceName = "#whitespace"; private const string SignificantWhitespaceName = "#significant-whitespace"; // The seed index below requires that the constant strings above and the seed array below are // kept in the same order. private const int DocumentNameSeedIndex = 0; private const int DocumentFragmentNameSeedIndex = 1; private const int CommentNameSeedIndex = 2; private const int TextNameSeedIndex = 3; private const int CDataSectionNameSeedIndex = 4; private const int EntityNameSeedIndex = 5; private const int IDSeedIndex = 6; private const int XmlnsSeedIndex = 7; private const int XmlSeedIndex = 8; private const int SpaceSeedIndex = 9; private const int LangSeedIndex = 10; private const int NonSignificantWhitespaceNameSeedIndex = 11; private const int SignificantWhitespaceNameSeedIndex = 12; private const int NsXmlNsSeedIndex = 13; private const int NsXmlSeedIndex = 14; // If changing the array below ensure that the seed indexes before match private static readonly (string key, int hash)[] s_nameTableSeeds = new[] { (DocumentName, System.Xml.NameTable.ComputeHash32(DocumentName)), (DocumentFragmentName, System.Xml.NameTable.ComputeHash32(DocumentFragmentName)), (CommentName, System.Xml.NameTable.ComputeHash32(CommentName)), (TextName, System.Xml.NameTable.ComputeHash32(TextName)), (CDataSectionName, System.Xml.NameTable.ComputeHash32(CDataSectionName)), (EntityName, System.Xml.NameTable.ComputeHash32(EntityName)), (ID, System.Xml.NameTable.ComputeHash32(ID)), (Xmlns, System.Xml.NameTable.ComputeHash32(Xmlns)), (Xml, System.Xml.NameTable.ComputeHash32(Xml)), (Space, System.Xml.NameTable.ComputeHash32(Space)), (Lang, System.Xml.NameTable.ComputeHash32(Lang)), (NonSignificantWhitespaceName, System.Xml.NameTable.ComputeHash32(NonSignificantWhitespaceName)), (SignificantWhitespaceName, System.Xml.NameTable.ComputeHash32(SignificantWhitespaceName)), (XmlReservedNs.NsXmlNs, System.Xml.NameTable.ComputeHash32(XmlReservedNs.NsXmlNs)), (XmlReservedNs.NsXml, System.Xml.NameTable.ComputeHash32(XmlReservedNs.NsXml)) }; private readonly XmlImplementation _implementation; private readonly DomNameTable _domNameTable; // hash table of XmlName private XmlLinkedNode? _lastChild; private XmlNamedNodeMap? _entities; private Hashtable? _htElementIdMap; private Hashtable? _htElementIDAttrDecl; //key: id; object: the ArrayList of the elements that have the same id (connected or disconnected) private SchemaInfo? _schemaInfo; private XmlSchemaSet? _schemas; // schemas associated with the cache private bool _reportValidity; //This variable represents the actual loading status. Since, IsLoading will //be manipulated sometimes for adding content to EntityReference this variable //has been added which would always represent the loading status of document. private bool _actualLoadingStatus; private XmlNodeChangedEventHandler? _onNodeInsertingDelegate; private XmlNodeChangedEventHandler? _onNodeInsertedDelegate; private XmlNodeChangedEventHandler? _onNodeRemovingDelegate; private XmlNodeChangedEventHandler? _onNodeRemovedDelegate; private XmlNodeChangedEventHandler? _onNodeChangingDelegate; private XmlNodeChangedEventHandler? _onNodeChangedDelegate; // false if there are no ent-ref present, true if ent-ref nodes are or were present (i.e. if all ent-ref were removed, the doc will not clear this flag) internal bool fEntRefNodesPresent; internal bool fCDataNodesPresent; private bool _preserveWhitespace; private bool _isLoading; // special name strings for internal string strDocumentName; internal string strDocumentFragmentName; internal string strCommentName; internal string strTextName; internal string strCDataSectionName; internal string strEntityName; internal string strID; internal string strXmlns; internal string strXml; internal string strSpace; internal string strLang; internal string strNonSignificantWhitespaceName; internal string strSignificantWhitespaceName; internal string strReservedXmlns; internal string strReservedXml; internal string baseURI; private XmlResolver? _resolver; internal bool bSetResolver; internal object objLock; private XmlAttribute? _namespaceXml; internal static EmptyEnumerator EmptyEnumerator = new EmptyEnumerator(); internal static IXmlSchemaInfo NotKnownSchemaInfo = new XmlSchemaInfo(XmlSchemaValidity.NotKnown); internal static IXmlSchemaInfo ValidSchemaInfo = new XmlSchemaInfo(XmlSchemaValidity.Valid); internal static IXmlSchemaInfo InvalidSchemaInfo = new XmlSchemaInfo(XmlSchemaValidity.Invalid); // Initializes a new instance of the XmlDocument class. public XmlDocument() : this(new XmlImplementation()) { } // Initializes a new instance // of the XmlDocument class with the specified XmlNameTable. public XmlDocument(XmlNameTable nt) : this(new XmlImplementation(nt)) { } protected internal XmlDocument(XmlImplementation imp) : base() { _implementation = imp; _domNameTable = new DomNameTable(this); strXmlns = Xmlns; strXml = Xml; strReservedXmlns = XmlReservedNs.NsXmlNs; strReservedXml = XmlReservedNs.NsXml; baseURI = string.Empty; objLock = new object(); if (imp.NameTable.GetType() == typeof(NameTable)) { // When the name table being used is of type NameTable avoid re-calculating the hash codes. NameTable nt = (NameTable)imp.NameTable; strDocumentName = nt.GetOrAddEntry(s_nameTableSeeds[DocumentNameSeedIndex].key, s_nameTableSeeds[DocumentNameSeedIndex].hash); strDocumentFragmentName = nt.GetOrAddEntry(s_nameTableSeeds[DocumentFragmentNameSeedIndex].key, s_nameTableSeeds[DocumentFragmentNameSeedIndex].hash); strCommentName = nt.GetOrAddEntry(s_nameTableSeeds[CommentNameSeedIndex].key, s_nameTableSeeds[CommentNameSeedIndex].hash); strTextName = nt.GetOrAddEntry(s_nameTableSeeds[TextNameSeedIndex].key, s_nameTableSeeds[TextNameSeedIndex].hash); strCDataSectionName = nt.GetOrAddEntry(s_nameTableSeeds[CDataSectionNameSeedIndex].key, s_nameTableSeeds[CDataSectionNameSeedIndex].hash); strEntityName = nt.GetOrAddEntry(s_nameTableSeeds[EntityNameSeedIndex].key, s_nameTableSeeds[EntityNameSeedIndex].hash); strID = nt.GetOrAddEntry(s_nameTableSeeds[IDSeedIndex].key, s_nameTableSeeds[IDSeedIndex].hash); strNonSignificantWhitespaceName = nt.GetOrAddEntry(s_nameTableSeeds[NonSignificantWhitespaceNameSeedIndex].key, s_nameTableSeeds[NonSignificantWhitespaceNameSeedIndex].hash); strSignificantWhitespaceName = nt.GetOrAddEntry(s_nameTableSeeds[SignificantWhitespaceNameSeedIndex].key, s_nameTableSeeds[SignificantWhitespaceNameSeedIndex].hash); strXmlns = nt.GetOrAddEntry(s_nameTableSeeds[XmlnsSeedIndex].key, s_nameTableSeeds[XmlnsSeedIndex].hash); strXml = nt.GetOrAddEntry(s_nameTableSeeds[XmlSeedIndex].key, s_nameTableSeeds[XmlSeedIndex].hash); strSpace = nt.GetOrAddEntry(s_nameTableSeeds[SpaceSeedIndex].key, s_nameTableSeeds[SpaceSeedIndex].hash); strLang = nt.GetOrAddEntry(s_nameTableSeeds[LangSeedIndex].key, s_nameTableSeeds[LangSeedIndex].hash); strReservedXmlns = nt.GetOrAddEntry(s_nameTableSeeds[NsXmlNsSeedIndex].key, s_nameTableSeeds[NsXmlNsSeedIndex].hash); strReservedXml = nt.GetOrAddEntry(s_nameTableSeeds[NsXmlSeedIndex].key, s_nameTableSeeds[NsXmlSeedIndex].hash); } else { XmlNameTable customNameTable = imp.NameTable; strDocumentName = customNameTable.Add(DocumentName); strDocumentFragmentName = customNameTable.Add(DocumentFragmentName); strCommentName = customNameTable.Add(CommentName); strTextName = customNameTable.Add(TextName); strCDataSectionName = customNameTable.Add(CDataSectionName); strEntityName = customNameTable.Add(EntityName); strID = customNameTable.Add(ID); strNonSignificantWhitespaceName = customNameTable.Add(NonSignificantWhitespaceName); strSignificantWhitespaceName = customNameTable.Add(SignificantWhitespaceName); strXmlns = customNameTable.Add(Xmlns); strXml = customNameTable.Add(Xml); strSpace = customNameTable.Add(Space); strLang = customNameTable.Add(Lang); strReservedXmlns = customNameTable.Add(XmlReservedNs.NsXmlNs); strReservedXml = customNameTable.Add(XmlReservedNs.NsXml); } } internal SchemaInfo? DtdSchemaInfo { get { return _schemaInfo; } set { _schemaInfo = value; } } // NOTE: This does not correctly check start name char, but we cannot change it since it would be a breaking change. internal static void CheckName(string name) { int endPos = ValidateNames.ParseNmtoken(name, 0); if (endPos < name.Length) { throw new XmlException(SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(name, endPos)); } } internal XmlName AddXmlName(string? prefix, string localName, string? namespaceURI, IXmlSchemaInfo? schemaInfo) { XmlName n = _domNameTable.AddName(prefix, localName, namespaceURI, schemaInfo); Debug.Assert((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix)); Debug.Assert(n.LocalName == localName); Debug.Assert((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI)); return n; } internal XmlName? GetXmlName(string? prefix, string localName, string? namespaceURI, IXmlSchemaInfo? schemaInfo) { XmlName? n = _domNameTable.GetName(prefix, localName, namespaceURI, schemaInfo); Debug.Assert(n == null || ((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix))); Debug.Assert(n == null || n.LocalName == localName); Debug.Assert(n == null || ((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI))); return n; } internal XmlName AddAttrXmlName(string? prefix, string localName, string? namespaceURI, IXmlSchemaInfo? schemaInfo) { XmlName xmlName = AddXmlName(prefix, localName, namespaceURI, schemaInfo); Debug.Assert((prefix == null) ? (xmlName.Prefix.Length == 0) : (prefix == xmlName.Prefix)); Debug.Assert(xmlName.LocalName == localName); Debug.Assert((namespaceURI == null) ? (xmlName.NamespaceURI.Length == 0) : (xmlName.NamespaceURI == namespaceURI)); if (!this.IsLoading) { // Use atomized versions instead of prefix, localName and nsURI object oPrefix = xmlName.Prefix; object oNamespaceURI = xmlName.NamespaceURI; object oLocalName = xmlName.LocalName; if ((oPrefix == (object)strXmlns || (xmlName.Prefix.Length == 0 && oLocalName == (object)strXmlns)) ^ (oNamespaceURI == (object)strReservedXmlns)) throw new ArgumentException(SR.Format(SR.Xdom_Attr_Reserved_XmlNS, namespaceURI)); } return xmlName; } internal bool AddIdInfo(XmlName eleName, XmlName attrName) { //when XmlLoader call XmlDocument.AddInfo, the element.XmlName and attr.XmlName //have already been replaced with the ones that don't have namespace values (or just //string.Empty) because in DTD, the namespace is not supported if (_htElementIDAttrDecl == null || _htElementIDAttrDecl[eleName] == null) { if (_htElementIDAttrDecl == null) _htElementIDAttrDecl = new Hashtable(); _htElementIDAttrDecl.Add(eleName, attrName); return true; } return false; } private XmlName? GetIDInfoByElement_(XmlName eleName) { //When XmlDocument is getting the IDAttribute for a given element, //we need only compare the prefix and localname of element.XmlName with //the registered htElementIDAttrDecl. XmlName? newName = GetXmlName(eleName.Prefix, eleName.LocalName, string.Empty, null); if (newName != null) { return (XmlName?)(_htElementIDAttrDecl![newName]); } return null; } internal XmlName? GetIDInfoByElement(XmlName eleName) { if (_htElementIDAttrDecl == null) return null; else return GetIDInfoByElement_(eleName); } private WeakReference<XmlElement>? GetElement(ArrayList elementList, XmlElement elem) { ArrayList gcElemRefs = new ArrayList(); foreach (WeakReference<XmlElement> elemRef in elementList) { if (!elemRef.TryGetTarget(out XmlElement? target)) { //take notes on the garbage collected nodes gcElemRefs.Add(elemRef); } else { if (target == elem) return elemRef; } } //Clear out the gced elements foreach (WeakReference<XmlElement> elemRef in gcElemRefs) elementList.Remove(elemRef); return null; } internal void AddElementWithId(string id, XmlElement elem) { if (_htElementIdMap == null || !_htElementIdMap.Contains(id)) { if (_htElementIdMap == null) _htElementIdMap = new Hashtable(); ArrayList elementList = new ArrayList(); elementList.Add(new WeakReference<XmlElement>(elem)); _htElementIdMap.Add(id, elementList); } else { // there are other element(s) that has the same id ArrayList elementList = (ArrayList)(_htElementIdMap[id]!); if (GetElement(elementList, elem) == null) elementList.Add(new WeakReference<XmlElement>(elem)); } } internal void RemoveElementWithId(string id, XmlElement elem) { if (_htElementIdMap != null && _htElementIdMap.Contains(id)) { ArrayList elementList = (ArrayList)(_htElementIdMap[id]!); WeakReference<XmlElement>? elemRef = GetElement(elementList, elem); if (elemRef != null) { elementList.Remove(elemRef); if (elementList.Count == 0) _htElementIdMap.Remove(id); } } } // Creates a duplicate of this node. public override XmlNode CloneNode(bool deep) { XmlDocument clone = Implementation.CreateDocument(); clone.SetBaseURI(this.baseURI); if (deep) clone.ImportChildren(this, clone, deep); return clone; } // Gets the type of the current node. public override XmlNodeType NodeType { get { return XmlNodeType.Document; } } public override XmlNode? ParentNode { get { return null; } } // Gets the node for the DOCTYPE declaration. public virtual XmlDocumentType? DocumentType { get { return (XmlDocumentType?)FindChild(XmlNodeType.DocumentType); } } internal virtual XmlDeclaration? Declaration { get { if (HasChildNodes) { XmlDeclaration? dec = FirstChild as XmlDeclaration; return dec; } return null; } } // Gets the XmlImplementation object for this document. public XmlImplementation Implementation { get { return _implementation; } } // Gets the name of the node. public override string Name { get { return strDocumentName; } } // Gets the name of the current node without the namespace prefix. public override string LocalName { get { return strDocumentName; } } // Gets the root XmlElement for the document. public XmlElement? DocumentElement { get { return (XmlElement?)FindChild(XmlNodeType.Element); } } internal override bool IsContainer { get { return true; } } internal override XmlLinkedNode? LastNode { get { return _lastChild; } set { _lastChild = value; } } // Gets the XmlDocument that contains this node. public override XmlDocument? OwnerDocument { get { return null; } } public XmlSchemaSet Schemas { get { if (_schemas == null) { _schemas = new XmlSchemaSet(NameTable); } return _schemas; } set { _schemas = value; } } internal bool CanReportValidity { get { return _reportValidity; } } internal bool HasSetResolver { get { return bSetResolver; } } internal XmlResolver? GetResolver() { return _resolver; } public virtual XmlResolver? XmlResolver { set { _resolver = value; if (!bSetResolver) bSetResolver = true; XmlDocumentType? dtd = this.DocumentType; if (dtd != null) { dtd.DtdSchemaInfo = null; } } } internal override bool IsValidChildType(XmlNodeType type) { switch (type) { case XmlNodeType.ProcessingInstruction: case XmlNodeType.Comment: case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: return true; case XmlNodeType.DocumentType: if (DocumentType != null) throw new InvalidOperationException(SR.Xdom_DualDocumentTypeNode); return true; case XmlNodeType.Element: if (DocumentElement != null) throw new InvalidOperationException(SR.Xdom_DualDocumentElementNode); return true; case XmlNodeType.XmlDeclaration: if (Declaration != null) throw new InvalidOperationException(SR.Xdom_DualDeclarationNode); return true; default: return false; } } // the function examines all the siblings before the refNode // if any of the nodes has type equals to "nt", return true; otherwise, return false; private bool HasNodeTypeInPrevSiblings(XmlNodeType nt, XmlNode? refNode) { if (refNode == null) return false; XmlNode? node = null; if (refNode.ParentNode != null) node = refNode.ParentNode.FirstChild; while (node != null) { if (node.NodeType == nt) return true; if (node == refNode) break; node = node.NextSibling; } return false; } // the function examines all the siblings after the refNode // if any of the nodes has the type equals to "nt", return true; otherwise, return false; private bool HasNodeTypeInNextSiblings(XmlNodeType nt, XmlNode? refNode) { XmlNode? node = refNode; while (node != null) { if (node.NodeType == nt) return true; node = node.NextSibling; } return false; } internal override bool CanInsertBefore(XmlNode newChild, XmlNode? refChild) { if (refChild == null) refChild = FirstChild; if (refChild == null) return true; switch (newChild.NodeType) { case XmlNodeType.XmlDeclaration: return (refChild == FirstChild); case XmlNodeType.ProcessingInstruction: case XmlNodeType.Comment: return refChild.NodeType != XmlNodeType.XmlDeclaration; case XmlNodeType.DocumentType: { if (refChild.NodeType != XmlNodeType.XmlDeclaration) { //if refChild is not the XmlDeclaration node, only need to go through the sibling before and including refChild to // make sure no Element ( rootElem node ) before the current position return !HasNodeTypeInPrevSiblings(XmlNodeType.Element, refChild.PreviousSibling); } } break; case XmlNodeType.Element: { if (refChild.NodeType != XmlNodeType.XmlDeclaration) { //if refChild is not the XmlDeclaration node, only need to go through the siblings after and including the refChild to // make sure no DocType node and XmlDeclaration node after the current position. return !HasNodeTypeInNextSiblings(XmlNodeType.DocumentType, refChild); } } break; } return false; } internal override bool CanInsertAfter(XmlNode newChild, XmlNode? refChild) { if (refChild == null) refChild = LastChild; if (refChild == null) return true; switch (newChild.NodeType) { case XmlNodeType.ProcessingInstruction: case XmlNodeType.Comment: case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: return true; case XmlNodeType.DocumentType: { //we will have to go through all the siblings before the refChild just to make sure no Element node ( rootElem ) // before the current position return !HasNodeTypeInPrevSiblings(XmlNodeType.Element, refChild); } case XmlNodeType.Element: { return !HasNodeTypeInNextSiblings(XmlNodeType.DocumentType, refChild.NextSibling); } } return false; } // Creates an XmlAttribute with the specified name. public XmlAttribute CreateAttribute(string name) { string prefix; string localName; string namespaceURI = string.Empty; SplitName(name, out prefix, out localName); SetDefaultNamespace(prefix, localName, ref namespaceURI); return CreateAttribute(prefix, localName, namespaceURI); } internal void SetDefaultNamespace(string prefix, string localName, ref string namespaceURI) { if (prefix == strXmlns || (prefix.Length == 0 && localName == strXmlns)) { namespaceURI = strReservedXmlns; } else if (prefix == strXml) { namespaceURI = strReservedXml; } } // Creates a XmlCDataSection containing the specified data. public virtual XmlCDataSection CreateCDataSection(string? data) { fCDataNodesPresent = true; return new XmlCDataSection(data, this); } // Creates an XmlComment containing the specified data. public virtual XmlComment CreateComment(string? data) { return new XmlComment(data, this); } // Returns a new XmlDocumentType object. public virtual XmlDocumentType CreateDocumentType(string name, string? publicId, string? systemId, string? internalSubset) { return new XmlDocumentType(name, publicId, systemId, internalSubset, this); } // Creates an XmlDocumentFragment. public virtual XmlDocumentFragment CreateDocumentFragment() { return new XmlDocumentFragment(this); } // Creates an element with the specified name. public XmlElement CreateElement(string name) { string prefix; string localName; SplitName(name, out prefix, out localName); return CreateElement(prefix, localName, string.Empty); } internal void AddDefaultAttributes(XmlElement elem) { SchemaInfo? schInfo = DtdSchemaInfo; SchemaElementDecl? ed = GetSchemaElementDecl(elem); if (ed != null && ed.AttDefs != null) { foreach (KeyValuePair<XmlQualifiedName, SchemaAttDef> attrDefs in ed.AttDefs) { SchemaAttDef attdef = attrDefs.Value; if (attdef.Presence == SchemaDeclBase.Use.Default || attdef.Presence == SchemaDeclBase.Use.Fixed) { //build a default attribute and return string attrPrefix; string attrLocalname = attdef.Name.Name; string attrNamespaceURI = string.Empty; if (schInfo!.SchemaType == SchemaType.DTD) { attrPrefix = attdef.Name.Namespace; } else { attrPrefix = attdef.Prefix; attrNamespaceURI = attdef.Name.Namespace; } XmlAttribute defattr = PrepareDefaultAttribute(attdef, attrPrefix, attrLocalname, attrNamespaceURI); elem.SetAttributeNode(defattr); } } } } private SchemaElementDecl? GetSchemaElementDecl(XmlElement elem) { SchemaInfo? schInfo = DtdSchemaInfo; if (schInfo != null) { //build XmlQualifiedName used to identify the element schema declaration XmlQualifiedName qname = new XmlQualifiedName(elem.LocalName, schInfo.SchemaType == SchemaType.DTD ? elem.Prefix : elem.NamespaceURI); //get the schema info for the element SchemaElementDecl? elemDecl; if (schInfo.ElementDecls.TryGetValue(qname, out elemDecl)) { return elemDecl; } } return null; } //Will be used by AddDeafulatAttributes() and GetDefaultAttribute() methods private XmlAttribute PrepareDefaultAttribute(SchemaAttDef attdef, string attrPrefix, string attrLocalname, string attrNamespaceURI) { SetDefaultNamespace(attrPrefix, attrLocalname, ref attrNamespaceURI); XmlAttribute defattr = CreateDefaultAttribute(attrPrefix, attrLocalname, attrNamespaceURI); //parsing the default value for the default attribute defattr.InnerXml = attdef.DefaultValueRaw; //during the expansion of the tree, the flag could be set to true, we need to set it back. XmlUnspecifiedAttribute? unspAttr = defattr as XmlUnspecifiedAttribute; if (unspAttr != null) { unspAttr.SetSpecified(false); } return defattr; } // Creates an XmlEntityReference with the specified name. public virtual XmlEntityReference CreateEntityReference(string name) { return new XmlEntityReference(name, this); } // Creates a XmlProcessingInstruction with the specified name // and data strings. public virtual XmlProcessingInstruction CreateProcessingInstruction(string target, string data) { return new XmlProcessingInstruction(target, data, this); } // Creates a XmlDeclaration node with the specified values. public virtual XmlDeclaration CreateXmlDeclaration(string version, string? encoding, string? standalone) { return new XmlDeclaration(version, encoding, standalone, this); } // Creates an XmlText with the specified text. public virtual XmlText CreateTextNode(string? text) { return new XmlText(text, this); } // Creates a XmlSignificantWhitespace node. public virtual XmlSignificantWhitespace CreateSignificantWhitespace(string? text) { return new XmlSignificantWhitespace(text, this); } public override XPathNavigator? CreateNavigator() { return CreateNavigator(this); } protected internal virtual XPathNavigator? CreateNavigator(XmlNode node) { XmlNodeType nodeType = node.NodeType; XmlNode? parent; XmlNodeType parentType; switch (nodeType) { case XmlNodeType.EntityReference: case XmlNodeType.Entity: case XmlNodeType.DocumentType: case XmlNodeType.Notation: case XmlNodeType.XmlDeclaration: return null; case XmlNodeType.Text: case XmlNodeType.CDATA: case XmlNodeType.SignificantWhitespace: parent = node.ParentNode; if (parent != null) { do { parentType = parent.NodeType; if (parentType == XmlNodeType.Attribute) { return null; } else if (parentType == XmlNodeType.EntityReference) { parent = parent.ParentNode; } else { break; } } while (parent != null); } node = NormalizeText(node)!; break; case XmlNodeType.Whitespace: parent = node.ParentNode; if (parent != null) { do { parentType = parent.NodeType; if (parentType == XmlNodeType.Document || parentType == XmlNodeType.Attribute) { return null; } else if (parentType == XmlNodeType.EntityReference) { parent = parent.ParentNode; } else { break; } } while (parent != null); } node = NormalizeText(node)!; break; default: break; } return new DocumentXPathNavigator(this, node); } internal static bool IsTextNode(XmlNodeType nt) { switch (nt) { case XmlNodeType.Text: case XmlNodeType.CDATA: case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: return true; default: return false; } } private XmlNode? NormalizeText(XmlNode node) { XmlNode? retnode = null; XmlNode? n = node; while (IsTextNode(n.NodeType)) { retnode = n; n = n.PreviousSibling; if (n == null) { XmlNode intnode = retnode; while (true) { if (intnode.ParentNode != null && intnode.ParentNode.NodeType == XmlNodeType.EntityReference) { if (intnode.ParentNode.PreviousSibling != null) { n = intnode.ParentNode.PreviousSibling; break; } else { intnode = intnode.ParentNode; if (intnode == null) break; } } else break; } } if (n == null) break; while (n.NodeType == XmlNodeType.EntityReference) { n = n.LastChild!; } } return retnode; } // Creates a XmlWhitespace node. public virtual XmlWhitespace CreateWhitespace(string? text) { return new XmlWhitespace(text, this); } // Returns an XmlNodeList containing // a list of all descendant elements that match the specified name. public virtual XmlNodeList GetElementsByTagName(string name) { return new XmlElementList(this, name); } // DOM Level 2 // Creates an XmlAttribute with the specified LocalName // and NamespaceURI. public XmlAttribute CreateAttribute(string qualifiedName, string? namespaceURI) { string prefix; string localName; SplitName(qualifiedName, out prefix, out localName); return CreateAttribute(prefix, localName, namespaceURI); } // Creates an XmlElement with the specified LocalName and // NamespaceURI. public XmlElement CreateElement(string qualifiedName, string? namespaceURI) { string prefix; string localName; SplitName(qualifiedName, out prefix, out localName); return CreateElement(prefix, localName, namespaceURI); } // Returns a XmlNodeList containing // a list of all descendant elements that match the specified name. public virtual XmlNodeList GetElementsByTagName(string localName, string namespaceURI) { return new XmlElementList(this, localName, namespaceURI); } // Returns the XmlElement with the specified ID. public virtual XmlElement? GetElementById(string elementId) { if (_htElementIdMap != null) { ArrayList? elementList = (ArrayList?)(_htElementIdMap[elementId]); if (elementList != null) { foreach (WeakReference<XmlElement> elemRef in elementList) { if (elemRef.TryGetTarget(out XmlElement? elem) && elem.IsConnected()) return elem; } } } return null; } // Imports a node from another document to this document. public virtual XmlNode ImportNode(XmlNode node, bool deep) { return ImportNodeInternal(node, deep); } private XmlNode ImportNodeInternal(XmlNode node, bool deep) { if (node == null) { throw new InvalidOperationException(SR.Xdom_Import_NullNode); } else { XmlNode newNode; switch (node.NodeType) { case XmlNodeType.Element: newNode = CreateElement(node.Prefix, node.LocalName, node.NamespaceURI); ImportAttributes(node, newNode); if (deep) ImportChildren(node, newNode, deep); break; case XmlNodeType.Attribute: Debug.Assert(((XmlAttribute)node).Specified); newNode = CreateAttribute(node.Prefix, node.LocalName, node.NamespaceURI); ImportChildren(node, newNode, true); break; case XmlNodeType.Text: newNode = CreateTextNode(node.Value); break; case XmlNodeType.Comment: newNode = CreateComment(node.Value); break; case XmlNodeType.ProcessingInstruction: newNode = CreateProcessingInstruction(node.Name, node.Value!); break; case XmlNodeType.XmlDeclaration: XmlDeclaration decl = (XmlDeclaration)node; newNode = CreateXmlDeclaration(decl.Version, decl.Encoding, decl.Standalone); break; case XmlNodeType.CDATA: newNode = CreateCDataSection(node.Value); break; case XmlNodeType.DocumentType: XmlDocumentType docType = (XmlDocumentType)node; newNode = CreateDocumentType(docType.Name, docType.PublicId, docType.SystemId, docType.InternalSubset); break; case XmlNodeType.DocumentFragment: newNode = CreateDocumentFragment(); if (deep) ImportChildren(node, newNode, deep); break; case XmlNodeType.EntityReference: newNode = CreateEntityReference(node.Name); // we don't import the children of entity reference because they might result in different // children nodes given different namespace context in the new document. break; case XmlNodeType.Whitespace: newNode = CreateWhitespace(node.Value); break; case XmlNodeType.SignificantWhitespace: newNode = CreateSignificantWhitespace(node.Value); break; default: throw new InvalidOperationException(SR.Format(CultureInfo.InvariantCulture, SR.Xdom_Import, node.NodeType)); } return newNode; } } private void ImportAttributes(XmlNode fromElem, XmlNode toElem) { int cAttr = fromElem.Attributes!.Count; for (int iAttr = 0; iAttr < cAttr; iAttr++) { if (fromElem.Attributes[iAttr].Specified) toElem.Attributes!.SetNamedItem(ImportNodeInternal(fromElem.Attributes[iAttr], true)); } } private void ImportChildren(XmlNode fromNode, XmlNode toNode, bool deep) { Debug.Assert(toNode.NodeType != XmlNodeType.EntityReference); for (XmlNode? n = fromNode.FirstChild; n != null; n = n.NextSibling) { toNode.AppendChild(ImportNodeInternal(n, deep)); } } // Microsoft extensions // Gets the XmlNameTable associated with this // implementation. public XmlNameTable NameTable { get { return _implementation.NameTable; } } // Creates a XmlAttribute with the specified Prefix, LocalName, // and NamespaceURI. public virtual XmlAttribute CreateAttribute(string? prefix, string localName, string? namespaceURI) { return new XmlAttribute(AddAttrXmlName(prefix, localName, namespaceURI, null), this); } protected internal virtual XmlAttribute CreateDefaultAttribute(string? prefix, string localName, string? namespaceURI) { return new XmlUnspecifiedAttribute(prefix, localName, namespaceURI, this); } public virtual XmlElement CreateElement(string? prefix, string localName, string? namespaceURI) { XmlElement elem = new XmlElement(AddXmlName(prefix, localName, namespaceURI, null), true, this); if (!IsLoading) AddDefaultAttributes(elem); return elem; } // Gets or sets a value indicating whether to preserve whitespace. public bool PreserveWhitespace { get { return _preserveWhitespace; } set { _preserveWhitespace = value; } } // Gets a value indicating whether the node is read-only. public override bool IsReadOnly { get { return false; } } internal XmlNamedNodeMap Entities { get { if (_entities == null) _entities = new XmlNamedNodeMap(this); return _entities; } set { _entities = value; } } internal bool IsLoading { get { return _isLoading; } set { _isLoading = value; } } internal bool ActualLoadingStatus { get { return _actualLoadingStatus; } set { _actualLoadingStatus = value; } } // Creates a XmlNode with the specified XmlNodeType, Prefix, Name, and NamespaceURI. public virtual XmlNode CreateNode(XmlNodeType type, string? prefix, string name, string? namespaceURI) { switch (type) { case XmlNodeType.Element: if (prefix != null) return CreateElement(prefix, name, namespaceURI); else return CreateElement(name, namespaceURI); case XmlNodeType.Attribute: if (prefix != null) return CreateAttribute(prefix, name, namespaceURI); else return CreateAttribute(name, namespaceURI); case XmlNodeType.Text: return CreateTextNode(string.Empty); case XmlNodeType.CDATA: return CreateCDataSection(string.Empty); case XmlNodeType.EntityReference: return CreateEntityReference(name); case XmlNodeType.ProcessingInstruction: return CreateProcessingInstruction(name, string.Empty); case XmlNodeType.XmlDeclaration: return CreateXmlDeclaration("1.0", null, null); case XmlNodeType.Comment: return CreateComment(string.Empty); case XmlNodeType.DocumentFragment: return CreateDocumentFragment(); case XmlNodeType.DocumentType: return CreateDocumentType(name, string.Empty, string.Empty, string.Empty); case XmlNodeType.Document: return new XmlDocument(); case XmlNodeType.SignificantWhitespace: return CreateSignificantWhitespace(string.Empty); case XmlNodeType.Whitespace: return CreateWhitespace(string.Empty); default: throw new ArgumentException(SR.Format(SR.Arg_CannotCreateNode, type)); } } // Creates an XmlNode with the specified node type, Name, and // NamespaceURI. public virtual XmlNode CreateNode(string nodeTypeString, string name, string? namespaceURI) { return CreateNode(ConvertToNodeType(nodeTypeString), name, namespaceURI); } // Creates an XmlNode with the specified XmlNodeType, Name, and // NamespaceURI. public virtual XmlNode CreateNode(XmlNodeType type, string name, string? namespaceURI) { return CreateNode(type, null, name, namespaceURI); } // Creates an XmlNode object based on the information in the XmlReader. // The reader must be positioned on a node or attribute. public virtual XmlNode? ReadNode(XmlReader reader) { XmlNode? node = null; try { IsLoading = true; XmlLoader loader = new XmlLoader(); node = loader.ReadCurrentNode(this, reader); } finally { IsLoading = false; } return node; } internal XmlNodeType ConvertToNodeType(string nodeTypeString) { if (nodeTypeString == "element") { return XmlNodeType.Element; } else if (nodeTypeString == "attribute") { return XmlNodeType.Attribute; } else if (nodeTypeString == "text") { return XmlNodeType.Text; } else if (nodeTypeString == "cdatasection") { return XmlNodeType.CDATA; } else if (nodeTypeString == "entityreference") { return XmlNodeType.EntityReference; } else if (nodeTypeString == "entity") { return XmlNodeType.Entity; } else if (nodeTypeString == "processinginstruction") { return XmlNodeType.ProcessingInstruction; } else if (nodeTypeString == "comment") { return XmlNodeType.Comment; } else if (nodeTypeString == "document") { return XmlNodeType.Document; } else if (nodeTypeString == "documenttype") { return XmlNodeType.DocumentType; } else if (nodeTypeString == "documentfragment") { return XmlNodeType.DocumentFragment; } else if (nodeTypeString == "notation") { return XmlNodeType.Notation; } else if (nodeTypeString == "significantwhitespace") { return XmlNodeType.SignificantWhitespace; } else if (nodeTypeString == "whitespace") { return XmlNodeType.Whitespace; } throw new ArgumentException(SR.Format(SR.Xdom_Invalid_NT_String, nodeTypeString)); } private XmlTextReader SetupReader(XmlTextReader tr) { tr.XmlValidatingReaderCompatibilityMode = true; tr.EntityHandling = EntityHandling.ExpandCharEntities; if (this.HasSetResolver) tr.XmlResolver = GetResolver(); return tr; } // Loads the XML document from the specified URL. public virtual void Load(string filename) { XmlTextReader reader = SetupReader(new XmlTextReader(filename, NameTable)); try { Load(reader); } finally { reader.Close(); } } public virtual void Load(Stream inStream) { XmlTextReader reader = SetupReader(new XmlTextReader(inStream, NameTable)); try { Load(reader); } finally { reader.Impl.Close(false); } } // Loads the XML document from the specified TextReader. public virtual void Load(TextReader txtReader) { XmlTextReader reader = SetupReader(new XmlTextReader(txtReader, NameTable)); try { Load(reader); } finally { reader.Impl.Close(false); } } // Loads the XML document from the specified XmlReader. public virtual void Load(XmlReader reader) { try { IsLoading = true; _actualLoadingStatus = true; RemoveAll(); fEntRefNodesPresent = false; fCDataNodesPresent = false; _reportValidity = true; XmlLoader loader = new XmlLoader(); loader.Load(this, reader, _preserveWhitespace); } finally { IsLoading = false; _actualLoadingStatus = false; // Ensure the bit is still on after loading a dtd _reportValidity = true; } } // Loads the XML document from the specified string. public virtual void LoadXml(string xml) { XmlTextReader reader = SetupReader(new XmlTextReader(new StringReader(xml), NameTable)); try { Load(reader); } finally { reader.Close(); } } //TextEncoding is the one from XmlDeclaration if there is any internal Encoding? TextEncoding { get { if (Declaration != null) { string value = Declaration.Encoding; if (value.Length > 0) { return System.Text.Encoding.GetEncoding(value); } } return null; } } [AllowNull] public override string InnerText { set { throw new InvalidOperationException(SR.Xdom_Document_Innertext); } } public override string InnerXml { get { return base.InnerXml; } set { LoadXml(value); } } // Saves the XML document to the specified file. //Saves out the to the file with exact content in the XmlDocument. public virtual void Save(string filename) { if (DocumentElement == null) throw new XmlException(SR.Xml_InvalidXmlDocument, SR.Xdom_NoRootEle); XmlDOMTextWriter xw = new XmlDOMTextWriter(filename, TextEncoding); try { if (_preserveWhitespace == false) xw.Formatting = Formatting.Indented; WriteTo(xw); xw.Flush(); } finally { xw.Close(); } } //Saves out the to the file with exact content in the XmlDocument. public virtual void Save(Stream outStream) { XmlDOMTextWriter xw = new XmlDOMTextWriter(outStream, TextEncoding); if (_preserveWhitespace == false) xw.Formatting = Formatting.Indented; WriteTo(xw); xw.Flush(); } // Saves the XML document to the specified TextWriter. // //Saves out the file with xmldeclaration which has encoding value equal to //that of textwriter's encoding public virtual void Save(TextWriter writer) { XmlDOMTextWriter xw = new XmlDOMTextWriter(writer); if (_preserveWhitespace == false) xw.Formatting = Formatting.Indented; Save(xw); } // Saves the XML document to the specified XmlWriter. // //Saves out the file with xmldeclaration which has encoding value equal to //that of textwriter's encoding public virtual void Save(XmlWriter w) { XmlNode? n = this.FirstChild; if (n == null) return; if (w.WriteState == WriteState.Start) { if (n is XmlDeclaration) { if (Standalone!.Length == 0) w.WriteStartDocument(); else if (Standalone == "yes") w.WriteStartDocument(true); else if (Standalone == "no") w.WriteStartDocument(false); n = n.NextSibling; } else { w.WriteStartDocument(); } } while (n != null) { n.WriteTo(w); n = n.NextSibling; } w.Flush(); } // Saves the node to the specified XmlWriter. // //Writes out the to the file with exact content in the XmlDocument. public override void WriteTo(XmlWriter w) { WriteContentTo(w); } // Saves all the children of the node to the specified XmlWriter. // //Writes out the to the file with exact content in the XmlDocument. public override void WriteContentTo(XmlWriter xw) { foreach (XmlNode n in this) { n.WriteTo(xw); } } public void Validate(ValidationEventHandler? validationEventHandler) { Validate(validationEventHandler, this); } public void Validate(ValidationEventHandler? validationEventHandler, XmlNode nodeToValidate) { if (_schemas == null || _schemas.Count == 0) { //Should we error throw new InvalidOperationException(SR.XmlDocument_NoSchemaInfo); } XmlDocument parentDocument = nodeToValidate.Document; if (parentDocument != this) { throw new ArgumentException(SR.Format(SR.XmlDocument_NodeNotFromDocument, nameof(nodeToValidate))); } if (nodeToValidate == this) { _reportValidity = false; } DocumentSchemaValidator validator = new DocumentSchemaValidator(this, _schemas, validationEventHandler); validator.Validate(nodeToValidate); if (nodeToValidate == this) { _reportValidity = true; } } public event XmlNodeChangedEventHandler NodeInserting { add { _onNodeInsertingDelegate += value; } remove { _onNodeInsertingDelegate -= value; } } public event XmlNodeChangedEventHandler NodeInserted { add { _onNodeInsertedDelegate += value; } remove { _onNodeInsertedDelegate -= value; } } public event XmlNodeChangedEventHandler NodeRemoving { add { _onNodeRemovingDelegate += value; } remove { _onNodeRemovingDelegate -= value; } } public event XmlNodeChangedEventHandler NodeRemoved { add { _onNodeRemovedDelegate += value; } remove { _onNodeRemovedDelegate -= value; } } public event XmlNodeChangedEventHandler NodeChanging { add { _onNodeChangingDelegate += value; } remove { _onNodeChangingDelegate -= value; } } public event XmlNodeChangedEventHandler NodeChanged { add { _onNodeChangedDelegate += value; } remove { _onNodeChangedDelegate -= value; } } internal override XmlNodeChangedEventArgs? GetEventArgs(XmlNode node, XmlNode? oldParent, XmlNode? newParent, string? oldValue, string? newValue, XmlNodeChangedAction action) { _reportValidity = false; switch (action) { case XmlNodeChangedAction.Insert: if (_onNodeInsertingDelegate == null && _onNodeInsertedDelegate == null) { return null; } break; case XmlNodeChangedAction.Remove: if (_onNodeRemovingDelegate == null && _onNodeRemovedDelegate == null) { return null; } break; case XmlNodeChangedAction.Change: if (_onNodeChangingDelegate == null && _onNodeChangedDelegate == null) { return null; } break; } return new XmlNodeChangedEventArgs(node, oldParent, newParent, oldValue, newValue, action); } internal XmlNodeChangedEventArgs? GetInsertEventArgsForLoad(XmlNode node, XmlNode newParent) { if (_onNodeInsertingDelegate == null && _onNodeInsertedDelegate == null) { return null; } string? nodeValue = node.Value; return new XmlNodeChangedEventArgs(node, null, newParent, nodeValue, nodeValue, XmlNodeChangedAction.Insert); } internal override void BeforeEvent(XmlNodeChangedEventArgs args) { if (args != null) { switch (args.Action) { case XmlNodeChangedAction.Insert: if (_onNodeInsertingDelegate != null) _onNodeInsertingDelegate(this, args); break; case XmlNodeChangedAction.Remove: if (_onNodeRemovingDelegate != null) _onNodeRemovingDelegate(this, args); break; case XmlNodeChangedAction.Change: if (_onNodeChangingDelegate != null) _onNodeChangingDelegate(this, args); break; } } } internal override void AfterEvent(XmlNodeChangedEventArgs args) { if (args != null) { switch (args.Action) { case XmlNodeChangedAction.Insert: if (_onNodeInsertedDelegate != null) _onNodeInsertedDelegate(this, args); break; case XmlNodeChangedAction.Remove: if (_onNodeRemovedDelegate != null) _onNodeRemovedDelegate(this, args); break; case XmlNodeChangedAction.Change: if (_onNodeChangedDelegate != null) _onNodeChangedDelegate(this, args); break; } } } // The function such through schema info to find out if there exists a default attribute with passed in names in the passed in element // If so, return the newly created default attribute (with children tree); // Otherwise, return null. internal XmlAttribute? GetDefaultAttribute(XmlElement elem, string attrPrefix, string attrLocalname, string attrNamespaceURI) { SchemaInfo? schInfo = DtdSchemaInfo; SchemaElementDecl? ed = GetSchemaElementDecl(elem); if (ed != null && ed.AttDefs != null) { foreach (KeyValuePair<XmlQualifiedName, SchemaAttDef> attrDefs in ed.AttDefs) { SchemaAttDef attdef = attrDefs.Value; if (attdef.Presence == SchemaDeclBase.Use.Default || attdef.Presence == SchemaDeclBase.Use.Fixed) { if (attdef.Name.Name == attrLocalname) { if ((schInfo!.SchemaType == SchemaType.DTD && attdef.Name.Namespace == attrPrefix) || (schInfo.SchemaType != SchemaType.DTD && attdef.Name.Namespace == attrNamespaceURI)) { //find a def attribute with the same name, build a default attribute and return XmlAttribute defattr = PrepareDefaultAttribute(attdef, attrPrefix, attrLocalname, attrNamespaceURI); return defattr; } } } } } return null; } internal string? Version { get { XmlDeclaration? decl = Declaration; if (decl != null) return decl.Version; return null; } } internal string? Encoding { get { XmlDeclaration? decl = Declaration; if (decl != null) return decl.Encoding; return null; } } internal string? Standalone { get { XmlDeclaration? decl = Declaration; if (decl != null) return decl.Standalone; return null; } } internal XmlEntity? GetEntityNode(string name) { if (DocumentType != null) { XmlNamedNodeMap entites = DocumentType.Entities; if (entites != null) return (XmlEntity?)(entites.GetNamedItem(name)); } return null; } public override IXmlSchemaInfo SchemaInfo { get { if (_reportValidity) { XmlElement? documentElement = DocumentElement; if (documentElement != null) { switch (documentElement.SchemaInfo.Validity) { case XmlSchemaValidity.Valid: return ValidSchemaInfo; case XmlSchemaValidity.Invalid: return InvalidSchemaInfo; } } } return NotKnownSchemaInfo; } } public override string BaseURI { get { return baseURI; } } internal void SetBaseURI(string inBaseURI) { baseURI = inBaseURI; } internal override XmlNode AppendChildForLoad(XmlNode newChild, XmlDocument doc) { Debug.Assert(doc == this); if (!IsValidChildType(newChild.NodeType)) throw new InvalidOperationException(SR.Xdom_Node_Insert_TypeConflict); if (!CanInsertAfter(newChild, LastChild)) throw new InvalidOperationException(SR.Xdom_Node_Insert_Location); XmlNodeChangedEventArgs? args = GetInsertEventArgsForLoad(newChild, this); if (args != null) BeforeEvent(args); XmlLinkedNode newNode = (XmlLinkedNode)newChild; if (_lastChild == null) { newNode.next = newNode; } else { newNode.next = _lastChild.next; _lastChild.next = newNode; } _lastChild = newNode; newNode.SetParentForLoad(this); if (args != null) AfterEvent(args); return newNode; } internal override XPathNodeType XPNodeType { get { return XPathNodeType.Root; } } internal bool HasEntityReferences { get { return fEntRefNodesPresent; } } internal XmlAttribute NamespaceXml { get { if (_namespaceXml == null) { _namespaceXml = new XmlAttribute(AddAttrXmlName(strXmlns, strXml, strReservedXmlns, null), this); _namespaceXml.Value = strReservedXml; } return _namespaceXml; } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text; using System.Xml.Schema; using System.Xml.XPath; using System.Security; using System.Globalization; using System.Runtime.Versioning; using System.Diagnostics.CodeAnalysis; namespace System.Xml { // Represents an entire document. An XmlDocument contains XML data. public class XmlDocument : XmlNode { private const string DocumentName = "#document"; private const string DocumentFragmentName = "#document-fragment"; private const string CommentName = "#comment"; private const string TextName = "#text"; private const string CDataSectionName = "#cdata-section"; private const string EntityName = "#entity"; private const string ID = "id"; private const string Xmlns = "xmlns"; private const string Xml = "xml"; private const string Space = "space"; private const string Lang = "lang"; private const string NonSignificantWhitespaceName = "#whitespace"; private const string SignificantWhitespaceName = "#significant-whitespace"; // The seed index below requires that the constant strings above and the seed array below are // kept in the same order. private const int DocumentNameSeedIndex = 0; private const int DocumentFragmentNameSeedIndex = 1; private const int CommentNameSeedIndex = 2; private const int TextNameSeedIndex = 3; private const int CDataSectionNameSeedIndex = 4; private const int EntityNameSeedIndex = 5; private const int IDSeedIndex = 6; private const int XmlnsSeedIndex = 7; private const int XmlSeedIndex = 8; private const int SpaceSeedIndex = 9; private const int LangSeedIndex = 10; private const int NonSignificantWhitespaceNameSeedIndex = 11; private const int SignificantWhitespaceNameSeedIndex = 12; private const int NsXmlNsSeedIndex = 13; private const int NsXmlSeedIndex = 14; // If changing the array below ensure that the seed indexes before match private static readonly (string key, int hash)[] s_nameTableSeeds = new[] { (DocumentName, System.Xml.NameTable.ComputeHash32(DocumentName)), (DocumentFragmentName, System.Xml.NameTable.ComputeHash32(DocumentFragmentName)), (CommentName, System.Xml.NameTable.ComputeHash32(CommentName)), (TextName, System.Xml.NameTable.ComputeHash32(TextName)), (CDataSectionName, System.Xml.NameTable.ComputeHash32(CDataSectionName)), (EntityName, System.Xml.NameTable.ComputeHash32(EntityName)), (ID, System.Xml.NameTable.ComputeHash32(ID)), (Xmlns, System.Xml.NameTable.ComputeHash32(Xmlns)), (Xml, System.Xml.NameTable.ComputeHash32(Xml)), (Space, System.Xml.NameTable.ComputeHash32(Space)), (Lang, System.Xml.NameTable.ComputeHash32(Lang)), (NonSignificantWhitespaceName, System.Xml.NameTable.ComputeHash32(NonSignificantWhitespaceName)), (SignificantWhitespaceName, System.Xml.NameTable.ComputeHash32(SignificantWhitespaceName)), (XmlReservedNs.NsXmlNs, System.Xml.NameTable.ComputeHash32(XmlReservedNs.NsXmlNs)), (XmlReservedNs.NsXml, System.Xml.NameTable.ComputeHash32(XmlReservedNs.NsXml)) }; private readonly XmlImplementation _implementation; private readonly DomNameTable _domNameTable; // hash table of XmlName private XmlLinkedNode? _lastChild; private XmlNamedNodeMap? _entities; private Hashtable? _htElementIdMap; private Hashtable? _htElementIDAttrDecl; //key: id; object: the ArrayList of the elements that have the same id (connected or disconnected) private SchemaInfo? _schemaInfo; private XmlSchemaSet? _schemas; // schemas associated with the cache private bool _reportValidity; //This variable represents the actual loading status. Since, IsLoading will //be manipulated sometimes for adding content to EntityReference this variable //has been added which would always represent the loading status of document. private bool _actualLoadingStatus; private XmlNodeChangedEventHandler? _onNodeInsertingDelegate; private XmlNodeChangedEventHandler? _onNodeInsertedDelegate; private XmlNodeChangedEventHandler? _onNodeRemovingDelegate; private XmlNodeChangedEventHandler? _onNodeRemovedDelegate; private XmlNodeChangedEventHandler? _onNodeChangingDelegate; private XmlNodeChangedEventHandler? _onNodeChangedDelegate; // false if there are no ent-ref present, true if ent-ref nodes are or were present (i.e. if all ent-ref were removed, the doc will not clear this flag) internal bool fEntRefNodesPresent; internal bool fCDataNodesPresent; private bool _preserveWhitespace; private bool _isLoading; // special name strings for internal string strDocumentName; internal string strDocumentFragmentName; internal string strCommentName; internal string strTextName; internal string strCDataSectionName; internal string strEntityName; internal string strID; internal string strXmlns; internal string strXml; internal string strSpace; internal string strLang; internal string strNonSignificantWhitespaceName; internal string strSignificantWhitespaceName; internal string strReservedXmlns; internal string strReservedXml; internal string baseURI; private XmlResolver? _resolver; internal bool bSetResolver; internal object objLock; private XmlAttribute? _namespaceXml; internal static EmptyEnumerator EmptyEnumerator = new EmptyEnumerator(); internal static IXmlSchemaInfo NotKnownSchemaInfo = new XmlSchemaInfo(XmlSchemaValidity.NotKnown); internal static IXmlSchemaInfo ValidSchemaInfo = new XmlSchemaInfo(XmlSchemaValidity.Valid); internal static IXmlSchemaInfo InvalidSchemaInfo = new XmlSchemaInfo(XmlSchemaValidity.Invalid); // Initializes a new instance of the XmlDocument class. public XmlDocument() : this(new XmlImplementation()) { } // Initializes a new instance // of the XmlDocument class with the specified XmlNameTable. public XmlDocument(XmlNameTable nt) : this(new XmlImplementation(nt)) { } protected internal XmlDocument(XmlImplementation imp) : base() { _implementation = imp; _domNameTable = new DomNameTable(this); strXmlns = Xmlns; strXml = Xml; strReservedXmlns = XmlReservedNs.NsXmlNs; strReservedXml = XmlReservedNs.NsXml; baseURI = string.Empty; objLock = new object(); if (imp.NameTable.GetType() == typeof(NameTable)) { // When the name table being used is of type NameTable avoid re-calculating the hash codes. NameTable nt = (NameTable)imp.NameTable; strDocumentName = nt.GetOrAddEntry(s_nameTableSeeds[DocumentNameSeedIndex].key, s_nameTableSeeds[DocumentNameSeedIndex].hash); strDocumentFragmentName = nt.GetOrAddEntry(s_nameTableSeeds[DocumentFragmentNameSeedIndex].key, s_nameTableSeeds[DocumentFragmentNameSeedIndex].hash); strCommentName = nt.GetOrAddEntry(s_nameTableSeeds[CommentNameSeedIndex].key, s_nameTableSeeds[CommentNameSeedIndex].hash); strTextName = nt.GetOrAddEntry(s_nameTableSeeds[TextNameSeedIndex].key, s_nameTableSeeds[TextNameSeedIndex].hash); strCDataSectionName = nt.GetOrAddEntry(s_nameTableSeeds[CDataSectionNameSeedIndex].key, s_nameTableSeeds[CDataSectionNameSeedIndex].hash); strEntityName = nt.GetOrAddEntry(s_nameTableSeeds[EntityNameSeedIndex].key, s_nameTableSeeds[EntityNameSeedIndex].hash); strID = nt.GetOrAddEntry(s_nameTableSeeds[IDSeedIndex].key, s_nameTableSeeds[IDSeedIndex].hash); strNonSignificantWhitespaceName = nt.GetOrAddEntry(s_nameTableSeeds[NonSignificantWhitespaceNameSeedIndex].key, s_nameTableSeeds[NonSignificantWhitespaceNameSeedIndex].hash); strSignificantWhitespaceName = nt.GetOrAddEntry(s_nameTableSeeds[SignificantWhitespaceNameSeedIndex].key, s_nameTableSeeds[SignificantWhitespaceNameSeedIndex].hash); strXmlns = nt.GetOrAddEntry(s_nameTableSeeds[XmlnsSeedIndex].key, s_nameTableSeeds[XmlnsSeedIndex].hash); strXml = nt.GetOrAddEntry(s_nameTableSeeds[XmlSeedIndex].key, s_nameTableSeeds[XmlSeedIndex].hash); strSpace = nt.GetOrAddEntry(s_nameTableSeeds[SpaceSeedIndex].key, s_nameTableSeeds[SpaceSeedIndex].hash); strLang = nt.GetOrAddEntry(s_nameTableSeeds[LangSeedIndex].key, s_nameTableSeeds[LangSeedIndex].hash); strReservedXmlns = nt.GetOrAddEntry(s_nameTableSeeds[NsXmlNsSeedIndex].key, s_nameTableSeeds[NsXmlNsSeedIndex].hash); strReservedXml = nt.GetOrAddEntry(s_nameTableSeeds[NsXmlSeedIndex].key, s_nameTableSeeds[NsXmlSeedIndex].hash); } else { XmlNameTable customNameTable = imp.NameTable; strDocumentName = customNameTable.Add(DocumentName); strDocumentFragmentName = customNameTable.Add(DocumentFragmentName); strCommentName = customNameTable.Add(CommentName); strTextName = customNameTable.Add(TextName); strCDataSectionName = customNameTable.Add(CDataSectionName); strEntityName = customNameTable.Add(EntityName); strID = customNameTable.Add(ID); strNonSignificantWhitespaceName = customNameTable.Add(NonSignificantWhitespaceName); strSignificantWhitespaceName = customNameTable.Add(SignificantWhitespaceName); strXmlns = customNameTable.Add(Xmlns); strXml = customNameTable.Add(Xml); strSpace = customNameTable.Add(Space); strLang = customNameTable.Add(Lang); strReservedXmlns = customNameTable.Add(XmlReservedNs.NsXmlNs); strReservedXml = customNameTable.Add(XmlReservedNs.NsXml); } } internal SchemaInfo? DtdSchemaInfo { get { return _schemaInfo; } set { _schemaInfo = value; } } // NOTE: This does not correctly check start name char, but we cannot change it since it would be a breaking change. internal static void CheckName(string name) { int endPos = ValidateNames.ParseNmtoken(name, 0); if (endPos < name.Length) { throw new XmlException(SR.Xml_BadNameChar, XmlException.BuildCharExceptionArgs(name, endPos)); } } internal XmlName AddXmlName(string? prefix, string localName, string? namespaceURI, IXmlSchemaInfo? schemaInfo) { XmlName n = _domNameTable.AddName(prefix, localName, namespaceURI, schemaInfo); Debug.Assert((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix)); Debug.Assert(n.LocalName == localName); Debug.Assert((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI)); return n; } internal XmlName? GetXmlName(string? prefix, string localName, string? namespaceURI, IXmlSchemaInfo? schemaInfo) { XmlName? n = _domNameTable.GetName(prefix, localName, namespaceURI, schemaInfo); Debug.Assert(n == null || ((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix))); Debug.Assert(n == null || n.LocalName == localName); Debug.Assert(n == null || ((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI))); return n; } internal XmlName AddAttrXmlName(string? prefix, string localName, string? namespaceURI, IXmlSchemaInfo? schemaInfo) { XmlName xmlName = AddXmlName(prefix, localName, namespaceURI, schemaInfo); Debug.Assert((prefix == null) ? (xmlName.Prefix.Length == 0) : (prefix == xmlName.Prefix)); Debug.Assert(xmlName.LocalName == localName); Debug.Assert((namespaceURI == null) ? (xmlName.NamespaceURI.Length == 0) : (xmlName.NamespaceURI == namespaceURI)); if (!this.IsLoading) { // Use atomized versions instead of prefix, localName and nsURI object oPrefix = xmlName.Prefix; object oNamespaceURI = xmlName.NamespaceURI; object oLocalName = xmlName.LocalName; if ((oPrefix == (object)strXmlns || (xmlName.Prefix.Length == 0 && oLocalName == (object)strXmlns)) ^ (oNamespaceURI == (object)strReservedXmlns)) throw new ArgumentException(SR.Format(SR.Xdom_Attr_Reserved_XmlNS, namespaceURI)); } return xmlName; } internal bool AddIdInfo(XmlName eleName, XmlName attrName) { //when XmlLoader call XmlDocument.AddInfo, the element.XmlName and attr.XmlName //have already been replaced with the ones that don't have namespace values (or just //string.Empty) because in DTD, the namespace is not supported if (_htElementIDAttrDecl == null || _htElementIDAttrDecl[eleName] == null) { if (_htElementIDAttrDecl == null) _htElementIDAttrDecl = new Hashtable(); _htElementIDAttrDecl.Add(eleName, attrName); return true; } return false; } private XmlName? GetIDInfoByElement_(XmlName eleName) { //When XmlDocument is getting the IDAttribute for a given element, //we need only compare the prefix and localname of element.XmlName with //the registered htElementIDAttrDecl. XmlName? newName = GetXmlName(eleName.Prefix, eleName.LocalName, string.Empty, null); if (newName != null) { return (XmlName?)(_htElementIDAttrDecl![newName]); } return null; } internal XmlName? GetIDInfoByElement(XmlName eleName) { if (_htElementIDAttrDecl == null) return null; else return GetIDInfoByElement_(eleName); } private WeakReference<XmlElement>? GetElement(ArrayList elementList, XmlElement elem) { ArrayList gcElemRefs = new ArrayList(); foreach (WeakReference<XmlElement> elemRef in elementList) { if (!elemRef.TryGetTarget(out XmlElement? target)) { //take notes on the garbage collected nodes gcElemRefs.Add(elemRef); } else { if (target == elem) return elemRef; } } //Clear out the gced elements foreach (WeakReference<XmlElement> elemRef in gcElemRefs) elementList.Remove(elemRef); return null; } internal void AddElementWithId(string id, XmlElement elem) { if (_htElementIdMap == null || !_htElementIdMap.Contains(id)) { if (_htElementIdMap == null) _htElementIdMap = new Hashtable(); ArrayList elementList = new ArrayList(); elementList.Add(new WeakReference<XmlElement>(elem)); _htElementIdMap.Add(id, elementList); } else { // there are other element(s) that has the same id ArrayList elementList = (ArrayList)(_htElementIdMap[id]!); if (GetElement(elementList, elem) == null) elementList.Add(new WeakReference<XmlElement>(elem)); } } internal void RemoveElementWithId(string id, XmlElement elem) { if (_htElementIdMap != null && _htElementIdMap.Contains(id)) { ArrayList elementList = (ArrayList)(_htElementIdMap[id]!); WeakReference<XmlElement>? elemRef = GetElement(elementList, elem); if (elemRef != null) { elementList.Remove(elemRef); if (elementList.Count == 0) _htElementIdMap.Remove(id); } } } // Creates a duplicate of this node. public override XmlNode CloneNode(bool deep) { XmlDocument clone = Implementation.CreateDocument(); clone.SetBaseURI(this.baseURI); if (deep) clone.ImportChildren(this, clone, deep); return clone; } // Gets the type of the current node. public override XmlNodeType NodeType { get { return XmlNodeType.Document; } } public override XmlNode? ParentNode { get { return null; } } // Gets the node for the DOCTYPE declaration. public virtual XmlDocumentType? DocumentType { get { return (XmlDocumentType?)FindChild(XmlNodeType.DocumentType); } } internal virtual XmlDeclaration? Declaration { get { if (HasChildNodes) { XmlDeclaration? dec = FirstChild as XmlDeclaration; return dec; } return null; } } // Gets the XmlImplementation object for this document. public XmlImplementation Implementation { get { return _implementation; } } // Gets the name of the node. public override string Name { get { return strDocumentName; } } // Gets the name of the current node without the namespace prefix. public override string LocalName { get { return strDocumentName; } } // Gets the root XmlElement for the document. public XmlElement? DocumentElement { get { return (XmlElement?)FindChild(XmlNodeType.Element); } } internal override bool IsContainer { get { return true; } } internal override XmlLinkedNode? LastNode { get { return _lastChild; } set { _lastChild = value; } } // Gets the XmlDocument that contains this node. public override XmlDocument? OwnerDocument { get { return null; } } public XmlSchemaSet Schemas { get { if (_schemas == null) { _schemas = new XmlSchemaSet(NameTable); } return _schemas; } set { _schemas = value; } } internal bool CanReportValidity { get { return _reportValidity; } } internal bool HasSetResolver { get { return bSetResolver; } } internal XmlResolver? GetResolver() { return _resolver; } public virtual XmlResolver? XmlResolver { set { _resolver = value; if (!bSetResolver) bSetResolver = true; XmlDocumentType? dtd = this.DocumentType; if (dtd != null) { dtd.DtdSchemaInfo = null; } } } internal override bool IsValidChildType(XmlNodeType type) { switch (type) { case XmlNodeType.ProcessingInstruction: case XmlNodeType.Comment: case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: return true; case XmlNodeType.DocumentType: if (DocumentType != null) throw new InvalidOperationException(SR.Xdom_DualDocumentTypeNode); return true; case XmlNodeType.Element: if (DocumentElement != null) throw new InvalidOperationException(SR.Xdom_DualDocumentElementNode); return true; case XmlNodeType.XmlDeclaration: if (Declaration != null) throw new InvalidOperationException(SR.Xdom_DualDeclarationNode); return true; default: return false; } } // the function examines all the siblings before the refNode // if any of the nodes has type equals to "nt", return true; otherwise, return false; private bool HasNodeTypeInPrevSiblings(XmlNodeType nt, XmlNode? refNode) { if (refNode == null) return false; XmlNode? node = null; if (refNode.ParentNode != null) node = refNode.ParentNode.FirstChild; while (node != null) { if (node.NodeType == nt) return true; if (node == refNode) break; node = node.NextSibling; } return false; } // the function examines all the siblings after the refNode // if any of the nodes has the type equals to "nt", return true; otherwise, return false; private bool HasNodeTypeInNextSiblings(XmlNodeType nt, XmlNode? refNode) { XmlNode? node = refNode; while (node != null) { if (node.NodeType == nt) return true; node = node.NextSibling; } return false; } internal override bool CanInsertBefore(XmlNode newChild, XmlNode? refChild) { if (refChild == null) refChild = FirstChild; if (refChild == null) return true; switch (newChild.NodeType) { case XmlNodeType.XmlDeclaration: return (refChild == FirstChild); case XmlNodeType.ProcessingInstruction: case XmlNodeType.Comment: return refChild.NodeType != XmlNodeType.XmlDeclaration; case XmlNodeType.DocumentType: { if (refChild.NodeType != XmlNodeType.XmlDeclaration) { //if refChild is not the XmlDeclaration node, only need to go through the sibling before and including refChild to // make sure no Element ( rootElem node ) before the current position return !HasNodeTypeInPrevSiblings(XmlNodeType.Element, refChild.PreviousSibling); } } break; case XmlNodeType.Element: { if (refChild.NodeType != XmlNodeType.XmlDeclaration) { //if refChild is not the XmlDeclaration node, only need to go through the siblings after and including the refChild to // make sure no DocType node and XmlDeclaration node after the current position. return !HasNodeTypeInNextSiblings(XmlNodeType.DocumentType, refChild); } } break; } return false; } internal override bool CanInsertAfter(XmlNode newChild, XmlNode? refChild) { if (refChild == null) refChild = LastChild; if (refChild == null) return true; switch (newChild.NodeType) { case XmlNodeType.ProcessingInstruction: case XmlNodeType.Comment: case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: return true; case XmlNodeType.DocumentType: { //we will have to go through all the siblings before the refChild just to make sure no Element node ( rootElem ) // before the current position return !HasNodeTypeInPrevSiblings(XmlNodeType.Element, refChild); } case XmlNodeType.Element: { return !HasNodeTypeInNextSiblings(XmlNodeType.DocumentType, refChild.NextSibling); } } return false; } // Creates an XmlAttribute with the specified name. public XmlAttribute CreateAttribute(string name) { string prefix; string localName; string namespaceURI = string.Empty; SplitName(name, out prefix, out localName); SetDefaultNamespace(prefix, localName, ref namespaceURI); return CreateAttribute(prefix, localName, namespaceURI); } internal void SetDefaultNamespace(string prefix, string localName, ref string namespaceURI) { if (prefix == strXmlns || (prefix.Length == 0 && localName == strXmlns)) { namespaceURI = strReservedXmlns; } else if (prefix == strXml) { namespaceURI = strReservedXml; } } // Creates a XmlCDataSection containing the specified data. public virtual XmlCDataSection CreateCDataSection(string? data) { fCDataNodesPresent = true; return new XmlCDataSection(data, this); } // Creates an XmlComment containing the specified data. public virtual XmlComment CreateComment(string? data) { return new XmlComment(data, this); } // Returns a new XmlDocumentType object. public virtual XmlDocumentType CreateDocumentType(string name, string? publicId, string? systemId, string? internalSubset) { return new XmlDocumentType(name, publicId, systemId, internalSubset, this); } // Creates an XmlDocumentFragment. public virtual XmlDocumentFragment CreateDocumentFragment() { return new XmlDocumentFragment(this); } // Creates an element with the specified name. public XmlElement CreateElement(string name) { string prefix; string localName; SplitName(name, out prefix, out localName); return CreateElement(prefix, localName, string.Empty); } internal void AddDefaultAttributes(XmlElement elem) { SchemaInfo? schInfo = DtdSchemaInfo; SchemaElementDecl? ed = GetSchemaElementDecl(elem); if (ed != null && ed.AttDefs != null) { foreach (KeyValuePair<XmlQualifiedName, SchemaAttDef> attrDefs in ed.AttDefs) { SchemaAttDef attdef = attrDefs.Value; if (attdef.Presence == SchemaDeclBase.Use.Default || attdef.Presence == SchemaDeclBase.Use.Fixed) { //build a default attribute and return string attrPrefix; string attrLocalname = attdef.Name.Name; string attrNamespaceURI = string.Empty; if (schInfo!.SchemaType == SchemaType.DTD) { attrPrefix = attdef.Name.Namespace; } else { attrPrefix = attdef.Prefix; attrNamespaceURI = attdef.Name.Namespace; } XmlAttribute defattr = PrepareDefaultAttribute(attdef, attrPrefix, attrLocalname, attrNamespaceURI); elem.SetAttributeNode(defattr); } } } } private SchemaElementDecl? GetSchemaElementDecl(XmlElement elem) { SchemaInfo? schInfo = DtdSchemaInfo; if (schInfo != null) { //build XmlQualifiedName used to identify the element schema declaration XmlQualifiedName qname = new XmlQualifiedName(elem.LocalName, schInfo.SchemaType == SchemaType.DTD ? elem.Prefix : elem.NamespaceURI); //get the schema info for the element SchemaElementDecl? elemDecl; if (schInfo.ElementDecls.TryGetValue(qname, out elemDecl)) { return elemDecl; } } return null; } //Will be used by AddDeafulatAttributes() and GetDefaultAttribute() methods private XmlAttribute PrepareDefaultAttribute(SchemaAttDef attdef, string attrPrefix, string attrLocalname, string attrNamespaceURI) { SetDefaultNamespace(attrPrefix, attrLocalname, ref attrNamespaceURI); XmlAttribute defattr = CreateDefaultAttribute(attrPrefix, attrLocalname, attrNamespaceURI); //parsing the default value for the default attribute defattr.InnerXml = attdef.DefaultValueRaw; //during the expansion of the tree, the flag could be set to true, we need to set it back. XmlUnspecifiedAttribute? unspAttr = defattr as XmlUnspecifiedAttribute; if (unspAttr != null) { unspAttr.SetSpecified(false); } return defattr; } // Creates an XmlEntityReference with the specified name. public virtual XmlEntityReference CreateEntityReference(string name) { return new XmlEntityReference(name, this); } // Creates a XmlProcessingInstruction with the specified name // and data strings. public virtual XmlProcessingInstruction CreateProcessingInstruction(string target, string data) { return new XmlProcessingInstruction(target, data, this); } // Creates a XmlDeclaration node with the specified values. public virtual XmlDeclaration CreateXmlDeclaration(string version, string? encoding, string? standalone) { return new XmlDeclaration(version, encoding, standalone, this); } // Creates an XmlText with the specified text. public virtual XmlText CreateTextNode(string? text) { return new XmlText(text, this); } // Creates a XmlSignificantWhitespace node. public virtual XmlSignificantWhitespace CreateSignificantWhitespace(string? text) { return new XmlSignificantWhitespace(text, this); } public override XPathNavigator? CreateNavigator() { return CreateNavigator(this); } protected internal virtual XPathNavigator? CreateNavigator(XmlNode node) { XmlNodeType nodeType = node.NodeType; XmlNode? parent; XmlNodeType parentType; switch (nodeType) { case XmlNodeType.EntityReference: case XmlNodeType.Entity: case XmlNodeType.DocumentType: case XmlNodeType.Notation: case XmlNodeType.XmlDeclaration: return null; case XmlNodeType.Text: case XmlNodeType.CDATA: case XmlNodeType.SignificantWhitespace: parent = node.ParentNode; if (parent != null) { do { parentType = parent.NodeType; if (parentType == XmlNodeType.Attribute) { return null; } else if (parentType == XmlNodeType.EntityReference) { parent = parent.ParentNode; } else { break; } } while (parent != null); } node = NormalizeText(node)!; break; case XmlNodeType.Whitespace: parent = node.ParentNode; if (parent != null) { do { parentType = parent.NodeType; if (parentType == XmlNodeType.Document || parentType == XmlNodeType.Attribute) { return null; } else if (parentType == XmlNodeType.EntityReference) { parent = parent.ParentNode; } else { break; } } while (parent != null); } node = NormalizeText(node)!; break; default: break; } return new DocumentXPathNavigator(this, node); } internal static bool IsTextNode(XmlNodeType nt) { switch (nt) { case XmlNodeType.Text: case XmlNodeType.CDATA: case XmlNodeType.Whitespace: case XmlNodeType.SignificantWhitespace: return true; default: return false; } } private XmlNode? NormalizeText(XmlNode node) { XmlNode? retnode = null; XmlNode? n = node; while (IsTextNode(n.NodeType)) { retnode = n; n = n.PreviousSibling; if (n == null) { XmlNode intnode = retnode; while (true) { if (intnode.ParentNode != null && intnode.ParentNode.NodeType == XmlNodeType.EntityReference) { if (intnode.ParentNode.PreviousSibling != null) { n = intnode.ParentNode.PreviousSibling; break; } else { intnode = intnode.ParentNode; if (intnode == null) break; } } else break; } } if (n == null) break; while (n.NodeType == XmlNodeType.EntityReference) { n = n.LastChild!; } } return retnode; } // Creates a XmlWhitespace node. public virtual XmlWhitespace CreateWhitespace(string? text) { return new XmlWhitespace(text, this); } // Returns an XmlNodeList containing // a list of all descendant elements that match the specified name. public virtual XmlNodeList GetElementsByTagName(string name) { return new XmlElementList(this, name); } // DOM Level 2 // Creates an XmlAttribute with the specified LocalName // and NamespaceURI. public XmlAttribute CreateAttribute(string qualifiedName, string? namespaceURI) { string prefix; string localName; SplitName(qualifiedName, out prefix, out localName); return CreateAttribute(prefix, localName, namespaceURI); } // Creates an XmlElement with the specified LocalName and // NamespaceURI. public XmlElement CreateElement(string qualifiedName, string? namespaceURI) { string prefix; string localName; SplitName(qualifiedName, out prefix, out localName); return CreateElement(prefix, localName, namespaceURI); } // Returns a XmlNodeList containing // a list of all descendant elements that match the specified name. public virtual XmlNodeList GetElementsByTagName(string localName, string namespaceURI) { return new XmlElementList(this, localName, namespaceURI); } // Returns the XmlElement with the specified ID. public virtual XmlElement? GetElementById(string elementId) { if (_htElementIdMap != null) { ArrayList? elementList = (ArrayList?)(_htElementIdMap[elementId]); if (elementList != null) { foreach (WeakReference<XmlElement> elemRef in elementList) { if (elemRef.TryGetTarget(out XmlElement? elem) && elem.IsConnected()) return elem; } } } return null; } // Imports a node from another document to this document. public virtual XmlNode ImportNode(XmlNode node, bool deep) { return ImportNodeInternal(node, deep); } private XmlNode ImportNodeInternal(XmlNode node, bool deep) { if (node == null) { throw new InvalidOperationException(SR.Xdom_Import_NullNode); } else { XmlNode newNode; switch (node.NodeType) { case XmlNodeType.Element: newNode = CreateElement(node.Prefix, node.LocalName, node.NamespaceURI); ImportAttributes(node, newNode); if (deep) ImportChildren(node, newNode, deep); break; case XmlNodeType.Attribute: Debug.Assert(((XmlAttribute)node).Specified); newNode = CreateAttribute(node.Prefix, node.LocalName, node.NamespaceURI); ImportChildren(node, newNode, true); break; case XmlNodeType.Text: newNode = CreateTextNode(node.Value); break; case XmlNodeType.Comment: newNode = CreateComment(node.Value); break; case XmlNodeType.ProcessingInstruction: newNode = CreateProcessingInstruction(node.Name, node.Value!); break; case XmlNodeType.XmlDeclaration: XmlDeclaration decl = (XmlDeclaration)node; newNode = CreateXmlDeclaration(decl.Version, decl.Encoding, decl.Standalone); break; case XmlNodeType.CDATA: newNode = CreateCDataSection(node.Value); break; case XmlNodeType.DocumentType: XmlDocumentType docType = (XmlDocumentType)node; newNode = CreateDocumentType(docType.Name, docType.PublicId, docType.SystemId, docType.InternalSubset); break; case XmlNodeType.DocumentFragment: newNode = CreateDocumentFragment(); if (deep) ImportChildren(node, newNode, deep); break; case XmlNodeType.EntityReference: newNode = CreateEntityReference(node.Name); // we don't import the children of entity reference because they might result in different // children nodes given different namespace context in the new document. break; case XmlNodeType.Whitespace: newNode = CreateWhitespace(node.Value); break; case XmlNodeType.SignificantWhitespace: newNode = CreateSignificantWhitespace(node.Value); break; default: throw new InvalidOperationException(SR.Format(CultureInfo.InvariantCulture, SR.Xdom_Import, node.NodeType)); } return newNode; } } private void ImportAttributes(XmlNode fromElem, XmlNode toElem) { int cAttr = fromElem.Attributes!.Count; for (int iAttr = 0; iAttr < cAttr; iAttr++) { if (fromElem.Attributes[iAttr].Specified) toElem.Attributes!.SetNamedItem(ImportNodeInternal(fromElem.Attributes[iAttr], true)); } } private void ImportChildren(XmlNode fromNode, XmlNode toNode, bool deep) { Debug.Assert(toNode.NodeType != XmlNodeType.EntityReference); for (XmlNode? n = fromNode.FirstChild; n != null; n = n.NextSibling) { toNode.AppendChild(ImportNodeInternal(n, deep)); } } // Microsoft extensions // Gets the XmlNameTable associated with this // implementation. public XmlNameTable NameTable { get { return _implementation.NameTable; } } // Creates a XmlAttribute with the specified Prefix, LocalName, // and NamespaceURI. public virtual XmlAttribute CreateAttribute(string? prefix, string localName, string? namespaceURI) { return new XmlAttribute(AddAttrXmlName(prefix, localName, namespaceURI, null), this); } protected internal virtual XmlAttribute CreateDefaultAttribute(string? prefix, string localName, string? namespaceURI) { return new XmlUnspecifiedAttribute(prefix, localName, namespaceURI, this); } public virtual XmlElement CreateElement(string? prefix, string localName, string? namespaceURI) { XmlElement elem = new XmlElement(AddXmlName(prefix, localName, namespaceURI, null), true, this); if (!IsLoading) AddDefaultAttributes(elem); return elem; } // Gets or sets a value indicating whether to preserve whitespace. public bool PreserveWhitespace { get { return _preserveWhitespace; } set { _preserveWhitespace = value; } } // Gets a value indicating whether the node is read-only. public override bool IsReadOnly { get { return false; } } internal XmlNamedNodeMap Entities { get { if (_entities == null) _entities = new XmlNamedNodeMap(this); return _entities; } set { _entities = value; } } internal bool IsLoading { get { return _isLoading; } set { _isLoading = value; } } internal bool ActualLoadingStatus { get { return _actualLoadingStatus; } set { _actualLoadingStatus = value; } } // Creates a XmlNode with the specified XmlNodeType, Prefix, Name, and NamespaceURI. public virtual XmlNode CreateNode(XmlNodeType type, string? prefix, string name, string? namespaceURI) { switch (type) { case XmlNodeType.Element: if (prefix != null) return CreateElement(prefix, name, namespaceURI); else return CreateElement(name, namespaceURI); case XmlNodeType.Attribute: if (prefix != null) return CreateAttribute(prefix, name, namespaceURI); else return CreateAttribute(name, namespaceURI); case XmlNodeType.Text: return CreateTextNode(string.Empty); case XmlNodeType.CDATA: return CreateCDataSection(string.Empty); case XmlNodeType.EntityReference: return CreateEntityReference(name); case XmlNodeType.ProcessingInstruction: return CreateProcessingInstruction(name, string.Empty); case XmlNodeType.XmlDeclaration: return CreateXmlDeclaration("1.0", null, null); case XmlNodeType.Comment: return CreateComment(string.Empty); case XmlNodeType.DocumentFragment: return CreateDocumentFragment(); case XmlNodeType.DocumentType: return CreateDocumentType(name, string.Empty, string.Empty, string.Empty); case XmlNodeType.Document: return new XmlDocument(); case XmlNodeType.SignificantWhitespace: return CreateSignificantWhitespace(string.Empty); case XmlNodeType.Whitespace: return CreateWhitespace(string.Empty); default: throw new ArgumentException(SR.Format(SR.Arg_CannotCreateNode, type)); } } // Creates an XmlNode with the specified node type, Name, and // NamespaceURI. public virtual XmlNode CreateNode(string nodeTypeString, string name, string? namespaceURI) { return CreateNode(ConvertToNodeType(nodeTypeString), name, namespaceURI); } // Creates an XmlNode with the specified XmlNodeType, Name, and // NamespaceURI. public virtual XmlNode CreateNode(XmlNodeType type, string name, string? namespaceURI) { return CreateNode(type, null, name, namespaceURI); } // Creates an XmlNode object based on the information in the XmlReader. // The reader must be positioned on a node or attribute. public virtual XmlNode? ReadNode(XmlReader reader) { XmlNode? node = null; try { IsLoading = true; XmlLoader loader = new XmlLoader(); node = loader.ReadCurrentNode(this, reader); } finally { IsLoading = false; } return node; } internal XmlNodeType ConvertToNodeType(string nodeTypeString) { if (nodeTypeString == "element") { return XmlNodeType.Element; } else if (nodeTypeString == "attribute") { return XmlNodeType.Attribute; } else if (nodeTypeString == "text") { return XmlNodeType.Text; } else if (nodeTypeString == "cdatasection") { return XmlNodeType.CDATA; } else if (nodeTypeString == "entityreference") { return XmlNodeType.EntityReference; } else if (nodeTypeString == "entity") { return XmlNodeType.Entity; } else if (nodeTypeString == "processinginstruction") { return XmlNodeType.ProcessingInstruction; } else if (nodeTypeString == "comment") { return XmlNodeType.Comment; } else if (nodeTypeString == "document") { return XmlNodeType.Document; } else if (nodeTypeString == "documenttype") { return XmlNodeType.DocumentType; } else if (nodeTypeString == "documentfragment") { return XmlNodeType.DocumentFragment; } else if (nodeTypeString == "notation") { return XmlNodeType.Notation; } else if (nodeTypeString == "significantwhitespace") { return XmlNodeType.SignificantWhitespace; } else if (nodeTypeString == "whitespace") { return XmlNodeType.Whitespace; } throw new ArgumentException(SR.Format(SR.Xdom_Invalid_NT_String, nodeTypeString)); } private XmlTextReader SetupReader(XmlTextReader tr) { tr.XmlValidatingReaderCompatibilityMode = true; tr.EntityHandling = EntityHandling.ExpandCharEntities; if (this.HasSetResolver) tr.XmlResolver = GetResolver(); return tr; } // Loads the XML document from the specified URL. public virtual void Load(string filename) { XmlTextReader reader = SetupReader(new XmlTextReader(filename, NameTable)); try { Load(reader); } finally { reader.Close(); } } public virtual void Load(Stream inStream) { XmlTextReader reader = SetupReader(new XmlTextReader(inStream, NameTable)); try { Load(reader); } finally { reader.Impl.Close(false); } } // Loads the XML document from the specified TextReader. public virtual void Load(TextReader txtReader) { XmlTextReader reader = SetupReader(new XmlTextReader(txtReader, NameTable)); try { Load(reader); } finally { reader.Impl.Close(false); } } // Loads the XML document from the specified XmlReader. public virtual void Load(XmlReader reader) { try { IsLoading = true; _actualLoadingStatus = true; RemoveAll(); fEntRefNodesPresent = false; fCDataNodesPresent = false; _reportValidity = true; XmlLoader loader = new XmlLoader(); loader.Load(this, reader, _preserveWhitespace); } finally { IsLoading = false; _actualLoadingStatus = false; // Ensure the bit is still on after loading a dtd _reportValidity = true; } } // Loads the XML document from the specified string. public virtual void LoadXml(string xml) { XmlTextReader reader = SetupReader(new XmlTextReader(new StringReader(xml), NameTable)); try { Load(reader); } finally { reader.Close(); } } //TextEncoding is the one from XmlDeclaration if there is any internal Encoding? TextEncoding { get { if (Declaration != null) { string value = Declaration.Encoding; if (value.Length > 0) { return System.Text.Encoding.GetEncoding(value); } } return null; } } [AllowNull] public override string InnerText { set { throw new InvalidOperationException(SR.Xdom_Document_Innertext); } } public override string InnerXml { get { return base.InnerXml; } set { LoadXml(value); } } // Saves the XML document to the specified file. //Saves out the to the file with exact content in the XmlDocument. public virtual void Save(string filename) { if (DocumentElement == null) throw new XmlException(SR.Xml_InvalidXmlDocument, SR.Xdom_NoRootEle); XmlDOMTextWriter xw = new XmlDOMTextWriter(filename, TextEncoding); try { if (_preserveWhitespace == false) xw.Formatting = Formatting.Indented; WriteTo(xw); xw.Flush(); } finally { xw.Close(); } } //Saves out the to the file with exact content in the XmlDocument. public virtual void Save(Stream outStream) { XmlDOMTextWriter xw = new XmlDOMTextWriter(outStream, TextEncoding); if (_preserveWhitespace == false) xw.Formatting = Formatting.Indented; WriteTo(xw); xw.Flush(); } // Saves the XML document to the specified TextWriter. // //Saves out the file with xmldeclaration which has encoding value equal to //that of textwriter's encoding public virtual void Save(TextWriter writer) { XmlDOMTextWriter xw = new XmlDOMTextWriter(writer); if (_preserveWhitespace == false) xw.Formatting = Formatting.Indented; Save(xw); } // Saves the XML document to the specified XmlWriter. // //Saves out the file with xmldeclaration which has encoding value equal to //that of textwriter's encoding public virtual void Save(XmlWriter w) { XmlNode? n = this.FirstChild; if (n == null) return; if (w.WriteState == WriteState.Start) { if (n is XmlDeclaration) { if (Standalone!.Length == 0) w.WriteStartDocument(); else if (Standalone == "yes") w.WriteStartDocument(true); else if (Standalone == "no") w.WriteStartDocument(false); n = n.NextSibling; } else { w.WriteStartDocument(); } } while (n != null) { n.WriteTo(w); n = n.NextSibling; } w.Flush(); } // Saves the node to the specified XmlWriter. // //Writes out the to the file with exact content in the XmlDocument. public override void WriteTo(XmlWriter w) { WriteContentTo(w); } // Saves all the children of the node to the specified XmlWriter. // //Writes out the to the file with exact content in the XmlDocument. public override void WriteContentTo(XmlWriter xw) { foreach (XmlNode n in this) { n.WriteTo(xw); } } public void Validate(ValidationEventHandler? validationEventHandler) { Validate(validationEventHandler, this); } public void Validate(ValidationEventHandler? validationEventHandler, XmlNode nodeToValidate) { if (_schemas == null || _schemas.Count == 0) { //Should we error throw new InvalidOperationException(SR.XmlDocument_NoSchemaInfo); } XmlDocument parentDocument = nodeToValidate.Document; if (parentDocument != this) { throw new ArgumentException(SR.Format(SR.XmlDocument_NodeNotFromDocument, nameof(nodeToValidate))); } if (nodeToValidate == this) { _reportValidity = false; } DocumentSchemaValidator validator = new DocumentSchemaValidator(this, _schemas, validationEventHandler); validator.Validate(nodeToValidate); if (nodeToValidate == this) { _reportValidity = true; } } public event XmlNodeChangedEventHandler NodeInserting { add { _onNodeInsertingDelegate += value; } remove { _onNodeInsertingDelegate -= value; } } public event XmlNodeChangedEventHandler NodeInserted { add { _onNodeInsertedDelegate += value; } remove { _onNodeInsertedDelegate -= value; } } public event XmlNodeChangedEventHandler NodeRemoving { add { _onNodeRemovingDelegate += value; } remove { _onNodeRemovingDelegate -= value; } } public event XmlNodeChangedEventHandler NodeRemoved { add { _onNodeRemovedDelegate += value; } remove { _onNodeRemovedDelegate -= value; } } public event XmlNodeChangedEventHandler NodeChanging { add { _onNodeChangingDelegate += value; } remove { _onNodeChangingDelegate -= value; } } public event XmlNodeChangedEventHandler NodeChanged { add { _onNodeChangedDelegate += value; } remove { _onNodeChangedDelegate -= value; } } internal override XmlNodeChangedEventArgs? GetEventArgs(XmlNode node, XmlNode? oldParent, XmlNode? newParent, string? oldValue, string? newValue, XmlNodeChangedAction action) { _reportValidity = false; switch (action) { case XmlNodeChangedAction.Insert: if (_onNodeInsertingDelegate == null && _onNodeInsertedDelegate == null) { return null; } break; case XmlNodeChangedAction.Remove: if (_onNodeRemovingDelegate == null && _onNodeRemovedDelegate == null) { return null; } break; case XmlNodeChangedAction.Change: if (_onNodeChangingDelegate == null && _onNodeChangedDelegate == null) { return null; } break; } return new XmlNodeChangedEventArgs(node, oldParent, newParent, oldValue, newValue, action); } internal XmlNodeChangedEventArgs? GetInsertEventArgsForLoad(XmlNode node, XmlNode newParent) { if (_onNodeInsertingDelegate == null && _onNodeInsertedDelegate == null) { return null; } string? nodeValue = node.Value; return new XmlNodeChangedEventArgs(node, null, newParent, nodeValue, nodeValue, XmlNodeChangedAction.Insert); } internal override void BeforeEvent(XmlNodeChangedEventArgs args) { if (args != null) { switch (args.Action) { case XmlNodeChangedAction.Insert: if (_onNodeInsertingDelegate != null) _onNodeInsertingDelegate(this, args); break; case XmlNodeChangedAction.Remove: if (_onNodeRemovingDelegate != null) _onNodeRemovingDelegate(this, args); break; case XmlNodeChangedAction.Change: if (_onNodeChangingDelegate != null) _onNodeChangingDelegate(this, args); break; } } } internal override void AfterEvent(XmlNodeChangedEventArgs args) { if (args != null) { switch (args.Action) { case XmlNodeChangedAction.Insert: if (_onNodeInsertedDelegate != null) _onNodeInsertedDelegate(this, args); break; case XmlNodeChangedAction.Remove: if (_onNodeRemovedDelegate != null) _onNodeRemovedDelegate(this, args); break; case XmlNodeChangedAction.Change: if (_onNodeChangedDelegate != null) _onNodeChangedDelegate(this, args); break; } } } // The function such through schema info to find out if there exists a default attribute with passed in names in the passed in element // If so, return the newly created default attribute (with children tree); // Otherwise, return null. internal XmlAttribute? GetDefaultAttribute(XmlElement elem, string attrPrefix, string attrLocalname, string attrNamespaceURI) { SchemaInfo? schInfo = DtdSchemaInfo; SchemaElementDecl? ed = GetSchemaElementDecl(elem); if (ed != null && ed.AttDefs != null) { foreach (KeyValuePair<XmlQualifiedName, SchemaAttDef> attrDefs in ed.AttDefs) { SchemaAttDef attdef = attrDefs.Value; if (attdef.Presence == SchemaDeclBase.Use.Default || attdef.Presence == SchemaDeclBase.Use.Fixed) { if (attdef.Name.Name == attrLocalname) { if ((schInfo!.SchemaType == SchemaType.DTD && attdef.Name.Namespace == attrPrefix) || (schInfo.SchemaType != SchemaType.DTD && attdef.Name.Namespace == attrNamespaceURI)) { //find a def attribute with the same name, build a default attribute and return XmlAttribute defattr = PrepareDefaultAttribute(attdef, attrPrefix, attrLocalname, attrNamespaceURI); return defattr; } } } } } return null; } internal string? Version { get { XmlDeclaration? decl = Declaration; if (decl != null) return decl.Version; return null; } } internal string? Encoding { get { XmlDeclaration? decl = Declaration; if (decl != null) return decl.Encoding; return null; } } internal string? Standalone { get { XmlDeclaration? decl = Declaration; if (decl != null) return decl.Standalone; return null; } } internal XmlEntity? GetEntityNode(string name) { if (DocumentType != null) { XmlNamedNodeMap entites = DocumentType.Entities; if (entites != null) return (XmlEntity?)(entites.GetNamedItem(name)); } return null; } public override IXmlSchemaInfo SchemaInfo { get { if (_reportValidity) { XmlElement? documentElement = DocumentElement; if (documentElement != null) { switch (documentElement.SchemaInfo.Validity) { case XmlSchemaValidity.Valid: return ValidSchemaInfo; case XmlSchemaValidity.Invalid: return InvalidSchemaInfo; } } } return NotKnownSchemaInfo; } } public override string BaseURI { get { return baseURI; } } internal void SetBaseURI(string inBaseURI) { baseURI = inBaseURI; } internal override XmlNode AppendChildForLoad(XmlNode newChild, XmlDocument doc) { Debug.Assert(doc == this); if (!IsValidChildType(newChild.NodeType)) throw new InvalidOperationException(SR.Xdom_Node_Insert_TypeConflict); if (!CanInsertAfter(newChild, LastChild)) throw new InvalidOperationException(SR.Xdom_Node_Insert_Location); XmlNodeChangedEventArgs? args = GetInsertEventArgsForLoad(newChild, this); if (args != null) BeforeEvent(args); XmlLinkedNode newNode = (XmlLinkedNode)newChild; if (_lastChild == null) { newNode.next = newNode; } else { newNode.next = _lastChild.next; _lastChild.next = newNode; } _lastChild = newNode; newNode.SetParentForLoad(this); if (args != null) AfterEvent(args); return newNode; } internal override XPathNodeType XPNodeType { get { return XPathNodeType.Root; } } internal bool HasEntityReferences { get { return fEntRefNodesPresent; } } internal XmlAttribute NamespaceXml { get { if (_namespaceXml == null) { _namespaceXml = new XmlAttribute(AddAttrXmlName(strXmlns, strXml, strReservedXmlns, null), this); _namespaceXml.Value = strReservedXml; } return _namespaceXml; } } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Text.Encodings.Web/src/System/Text/Encodings/Web/HtmlEncoder.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Text.Unicode; namespace System.Text.Encodings.Web { /// <summary> /// Represents a type used to do HTML encoding. /// </summary> public abstract class HtmlEncoder : TextEncoder { /// <summary> /// Returns a default built-in instance of <see cref="HtmlEncoder"/>. /// </summary> public static HtmlEncoder Default => DefaultHtmlEncoder.BasicLatinSingleton; /// <summary> /// Creates a new instance of HtmlEncoder with provided settings. /// </summary> /// <param name="settings">Settings used to control how the created <see cref="HtmlEncoder"/> encodes, primarily which characters to encode.</param> /// <returns>A new instance of the <see cref="HtmlEncoder"/>.</returns> public static HtmlEncoder Create(TextEncoderSettings settings) { return new DefaultHtmlEncoder(settings); } /// <summary> /// Creates a new instance of HtmlEncoder specifying character to be encoded. /// </summary> /// <param name="allowedRanges">Set of characters that the encoder is allowed to not encode.</param> /// <returns>A new instance of the <see cref="HtmlEncoder"/></returns> /// <remarks>Some characters in <paramref name="allowedRanges"/> might still get encoded, i.e. this parameter is just telling the encoder what ranges it is allowed to not encode, not what characters it must not encode.</remarks> public static HtmlEncoder Create(params UnicodeRange[] allowedRanges) { return new DefaultHtmlEncoder(new TextEncoderSettings(allowedRanges)); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Text.Unicode; namespace System.Text.Encodings.Web { /// <summary> /// Represents a type used to do HTML encoding. /// </summary> public abstract class HtmlEncoder : TextEncoder { /// <summary> /// Returns a default built-in instance of <see cref="HtmlEncoder"/>. /// </summary> public static HtmlEncoder Default => DefaultHtmlEncoder.BasicLatinSingleton; /// <summary> /// Creates a new instance of HtmlEncoder with provided settings. /// </summary> /// <param name="settings">Settings used to control how the created <see cref="HtmlEncoder"/> encodes, primarily which characters to encode.</param> /// <returns>A new instance of the <see cref="HtmlEncoder"/>.</returns> public static HtmlEncoder Create(TextEncoderSettings settings) { return new DefaultHtmlEncoder(settings); } /// <summary> /// Creates a new instance of HtmlEncoder specifying character to be encoded. /// </summary> /// <param name="allowedRanges">Set of characters that the encoder is allowed to not encode.</param> /// <returns>A new instance of the <see cref="HtmlEncoder"/></returns> /// <remarks>Some characters in <paramref name="allowedRanges"/> might still get encoded, i.e. this parameter is just telling the encoder what ranges it is allowed to not encode, not what characters it must not encode.</remarks> public static HtmlEncoder Create(params UnicodeRange[] allowedRanges) { return new DefaultHtmlEncoder(new TextEncoderSettings(allowedRanges)); } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/tests/JIT/Performance/CodeQuality/SIMD/RayTracer/Vector.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // using System; using System.Numerics; using System.Runtime.CompilerServices; internal struct Vector { private Vector3 _simdVector; public float X { get { return _simdVector.X; } } public float Y { get { return _simdVector.Y; } set { _simdVector = new Vector3(_simdVector.X, value, _simdVector.Z); } } public float Z { get { return _simdVector.Z; } } public Vector(double x, double y, double z) { _simdVector = new Vector3((float)x, (float)y, (float)z); } public Vector(string str) { string[] nums = str.Split(','); if (nums.Length != 3) throw new ArgumentException(); _simdVector = new Vector3(float.Parse(nums[0]), float.Parse(nums[1]), float.Parse(nums[2])); } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static Vector Times(double n, Vector v) { Vector result; result._simdVector = (float)n * v._simdVector; return result; } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static Vector Minus(Vector v1, Vector v2) { Vector result; result._simdVector = v1._simdVector - v2._simdVector; return result; } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static Vector Plus(Vector v1, Vector v2) { Vector result; result._simdVector = v1._simdVector + v2._simdVector; return result; } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static float Dot(Vector v1, Vector v2) { return Vector3.Dot(v1._simdVector, v2._simdVector); } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static float Mag(Vector v) { return (float)Math.Sqrt(Dot(v, v)); } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static Vector Norm(Vector v) { float mag = Mag(v); float div = mag == 0 ? float.PositiveInfinity : 1 / mag; return Times(div, v); } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static Vector Cross(Vector v1, Vector v2) { return new Vector(((v1.Y * v2.Z) - (v1.Z * v2.Y)), ((v1.Z * v2.X) - (v1.X * v2.Z)), ((v1.X * v2.Y) - (v1.Y * v2.X))); } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static bool Equals(Vector v1, Vector v2) { return v1._simdVector.Equals(v2._simdVector); } public static Vector Null { get { Vector result; result._simdVector = Vector3.Zero; return result; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // using System; using System.Numerics; using System.Runtime.CompilerServices; internal struct Vector { private Vector3 _simdVector; public float X { get { return _simdVector.X; } } public float Y { get { return _simdVector.Y; } set { _simdVector = new Vector3(_simdVector.X, value, _simdVector.Z); } } public float Z { get { return _simdVector.Z; } } public Vector(double x, double y, double z) { _simdVector = new Vector3((float)x, (float)y, (float)z); } public Vector(string str) { string[] nums = str.Split(','); if (nums.Length != 3) throw new ArgumentException(); _simdVector = new Vector3(float.Parse(nums[0]), float.Parse(nums[1]), float.Parse(nums[2])); } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static Vector Times(double n, Vector v) { Vector result; result._simdVector = (float)n * v._simdVector; return result; } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static Vector Minus(Vector v1, Vector v2) { Vector result; result._simdVector = v1._simdVector - v2._simdVector; return result; } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static Vector Plus(Vector v1, Vector v2) { Vector result; result._simdVector = v1._simdVector + v2._simdVector; return result; } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static float Dot(Vector v1, Vector v2) { return Vector3.Dot(v1._simdVector, v2._simdVector); } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static float Mag(Vector v) { return (float)Math.Sqrt(Dot(v, v)); } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static Vector Norm(Vector v) { float mag = Mag(v); float div = mag == 0 ? float.PositiveInfinity : 1 / mag; return Times(div, v); } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static Vector Cross(Vector v1, Vector v2) { return new Vector(((v1.Y * v2.Z) - (v1.Z * v2.Y)), ((v1.Z * v2.X) - (v1.X * v2.Z)), ((v1.X * v2.Y) - (v1.Y * v2.X))); } [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] public static bool Equals(Vector v1, Vector v2) { return v1._simdVector.Equals(v2._simdVector); } public static Vector Null { get { Vector result; result._simdVector = Vector3.Zero; return result; } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Private.Xml/src/System/Xml/Xsl/ISourceLineInfo.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.Xml.Xsl { internal interface ISourceLineInfo { string? Uri { get; } bool IsNoSource { get; } Location Start { get; } Location End { get; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.Xml.Xsl { internal interface ISourceLineInfo { string? Uri { get; } bool IsNoSource { get; } Location Start { get; } Location End { get; } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Reflection.Context/src/System/Reflection/Context/Projection/ProjectingExceptionHandlingClause.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; using System.Reflection.Context.Delegation; namespace System.Reflection.Context.Projection { // Recursively 'projects' any assemblies, modules, types and members returned by a given exception handling clause internal sealed class ProjectingExceptionHandlingClause : DelegatingExceptionHandlingClause { private readonly Projector _projector; public ProjectingExceptionHandlingClause(ExceptionHandlingClause clause, Projector projector) : base(clause) { Debug.Assert(null != projector); _projector = projector; } public override Type? CatchType { get { return _projector.ProjectType(base.CatchType); } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; using System.Reflection.Context.Delegation; namespace System.Reflection.Context.Projection { // Recursively 'projects' any assemblies, modules, types and members returned by a given exception handling clause internal sealed class ProjectingExceptionHandlingClause : DelegatingExceptionHandlingClause { private readonly Projector _projector; public ProjectingExceptionHandlingClause(ExceptionHandlingClause clause, Projector projector) : base(clause) { Debug.Assert(null != projector); _projector = projector; } public override Type? CatchType { get { return _projector.ProjectType(base.CatchType); } } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Linq.Expressions/tests/Unary/MakeUnaryTests.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; using System.Reflection; using Xunit; namespace System.Linq.Expressions.Tests { public class MakeUnaryTests { public static readonly object[][] NonUnaryExpressionTypes = { new object[] {ExpressionType.Add}, new object[] {ExpressionType.AddChecked}, new object[] {ExpressionType.And}, new object[] {ExpressionType.AndAlso}, new object[] {ExpressionType.ArrayIndex}, new object[] {ExpressionType.Call}, new object[] {ExpressionType.Coalesce}, new object[] {ExpressionType.Conditional}, new object[] {ExpressionType.Constant}, new object[] {ExpressionType.Divide}, new object[] {ExpressionType.Equal}, new object[] {ExpressionType.ExclusiveOr}, new object[] {ExpressionType.GreaterThan}, new object[] {ExpressionType.GreaterThanOrEqual}, new object[] {ExpressionType.Invoke}, new object[] {ExpressionType.Lambda}, new object[] {ExpressionType.LeftShift}, new object[] {ExpressionType.LessThan}, new object[] {ExpressionType.LessThanOrEqual}, new object[] {ExpressionType.ListInit}, new object[] {ExpressionType.MemberAccess}, new object[] {ExpressionType.MemberInit}, new object[] {ExpressionType.Modulo}, new object[] {ExpressionType.Multiply}, new object[] {ExpressionType.MultiplyChecked}, new object[] {ExpressionType.New}, new object[] {ExpressionType.NewArrayInit}, new object[] {ExpressionType.NewArrayBounds}, new object[] {ExpressionType.NotEqual}, new object[] {ExpressionType.Or}, new object[] {ExpressionType.OrElse}, new object[] {ExpressionType.Parameter}, new object[] {ExpressionType.Power}, new object[] {ExpressionType.RightShift}, new object[] {ExpressionType.Subtract}, new object[] {ExpressionType.SubtractChecked}, new object[] {ExpressionType.TypeIs}, new object[] {ExpressionType.Assign}, new object[] {ExpressionType.Block}, new object[] {ExpressionType.DebugInfo}, new object[] {ExpressionType.Dynamic}, new object[] {ExpressionType.Default}, new object[] {ExpressionType.Extension}, new object[] {ExpressionType.Goto}, new object[] {ExpressionType.Index}, new object[] {ExpressionType.Label}, new object[] {ExpressionType.RuntimeVariables}, new object[] {ExpressionType.Loop}, new object[] {ExpressionType.Switch}, new object[] {ExpressionType.Try}, new object[] {ExpressionType.AddAssign}, new object[] {ExpressionType.AndAssign}, new object[] {ExpressionType.DivideAssign}, new object[] {ExpressionType.ExclusiveOrAssign}, new object[] {ExpressionType.LeftShiftAssign}, new object[] {ExpressionType.ModuloAssign}, new object[] {ExpressionType.MultiplyAssign}, new object[] {ExpressionType.OrAssign}, new object[] {ExpressionType.PowerAssign}, new object[] {ExpressionType.RightShiftAssign}, new object[] {ExpressionType.SubtractAssign}, new object[] {ExpressionType.AddAssignChecked}, new object[] {ExpressionType.MultiplyAssignChecked}, new object[] {ExpressionType.SubtractAssignChecked}, new object[] {ExpressionType.TypeEqual}, new object[] {(ExpressionType)(-1)}, new object[] {(ExpressionType)int.MaxValue} }; public static IEnumerable<object[]> NumericMethodAllowedUnaryTypes { get { yield return new object[] {ExpressionType.Negate}; yield return new object[] {ExpressionType.NegateChecked}; yield return new object[] {ExpressionType.OnesComplement}; yield return new object[] {ExpressionType.UnaryPlus}; yield return new object[] {ExpressionType.Increment}; yield return new object[] {ExpressionType.Decrement}; yield return new object[] {ExpressionType.PreIncrementAssign}; yield return new object[] {ExpressionType.PostIncrementAssign}; yield return new object[] {ExpressionType.PreDecrementAssign}; yield return new object[] {ExpressionType.PostDecrementAssign}; } } public static IEnumerable<object[]> BooleanMethodAllowedUnaryTypes { get { yield return new object[] {ExpressionType.Not}; yield return new object[] {ExpressionType.IsFalse}; yield return new object[] {ExpressionType.IsTrue}; } } public static IEnumerable<object[]> ConversionUnaryTypes { get { yield return new object[] {ExpressionType.Convert}; yield return new object[] {ExpressionType.ConvertChecked}; } } private class GenericClassWithNonGenericMethod<TClassType> { public static int DoIntStuff(int x) => x; public static bool DoBooleanStuff(bool b) => b; public static int CastLongToInt(long l) => unchecked((int)l); } [Theory, MemberData(nameof(NonUnaryExpressionTypes))] public void MakeUnaryExpressionNonUnary(ExpressionType type) { AssertExtensions.Throws<ArgumentException>("unaryType", () => Expression.MakeUnary(type, null, null)); } [Theory, MemberData(nameof(NumericMethodAllowedUnaryTypes))] public void MethodOfOpenGenericOnNumeric(ExpressionType type) { ParameterExpression variable = Expression.Variable(typeof(int)); Type genType = typeof(GenericClassWithNonGenericMethod<>); MethodInfo method = genType.GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoIntStuff)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(int), method)); method = genType.MakeGenericType(genType).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoIntStuff)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(int), method)); // Demonstrate does work when closed. method = genType.MakeGenericType(typeof(int)).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoIntStuff)); Expression.MakeUnary(type, variable, typeof(int), method); } [Theory, MemberData(nameof(BooleanMethodAllowedUnaryTypes))] public void MethodOfOpenGenericOnBoolean(ExpressionType type) { ParameterExpression variable = Expression.Variable(typeof(bool)); Type genType = typeof(GenericClassWithNonGenericMethod<>); MethodInfo method = genType.GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoBooleanStuff)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(bool), method)); method = genType.MakeGenericType(genType).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoBooleanStuff)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(bool), method)); // Demonstrate does work when closed. method = genType.MakeGenericType(typeof(int)).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoBooleanStuff)); Expression.MakeUnary(type, variable, typeof(bool), method); } [Theory, MemberData(nameof(BooleanMethodAllowedUnaryTypes))] public void MethodOfOpenGenericOnConversion(ExpressionType type) { ParameterExpression variable = Expression.Variable(typeof(long)); Type genType = typeof(GenericClassWithNonGenericMethod<>); MethodInfo method = genType.GetMethod(nameof(GenericClassWithNonGenericMethod<int>.CastLongToInt)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(int), method)); method = genType.MakeGenericType(genType).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.CastLongToInt)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(int), method)); // Demonstrate does work when closed. method = genType.MakeGenericType(typeof(int)).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.CastLongToInt)); Expression.MakeUnary(type, variable, typeof(int), method); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; using System.Reflection; using Xunit; namespace System.Linq.Expressions.Tests { public class MakeUnaryTests { public static readonly object[][] NonUnaryExpressionTypes = { new object[] {ExpressionType.Add}, new object[] {ExpressionType.AddChecked}, new object[] {ExpressionType.And}, new object[] {ExpressionType.AndAlso}, new object[] {ExpressionType.ArrayIndex}, new object[] {ExpressionType.Call}, new object[] {ExpressionType.Coalesce}, new object[] {ExpressionType.Conditional}, new object[] {ExpressionType.Constant}, new object[] {ExpressionType.Divide}, new object[] {ExpressionType.Equal}, new object[] {ExpressionType.ExclusiveOr}, new object[] {ExpressionType.GreaterThan}, new object[] {ExpressionType.GreaterThanOrEqual}, new object[] {ExpressionType.Invoke}, new object[] {ExpressionType.Lambda}, new object[] {ExpressionType.LeftShift}, new object[] {ExpressionType.LessThan}, new object[] {ExpressionType.LessThanOrEqual}, new object[] {ExpressionType.ListInit}, new object[] {ExpressionType.MemberAccess}, new object[] {ExpressionType.MemberInit}, new object[] {ExpressionType.Modulo}, new object[] {ExpressionType.Multiply}, new object[] {ExpressionType.MultiplyChecked}, new object[] {ExpressionType.New}, new object[] {ExpressionType.NewArrayInit}, new object[] {ExpressionType.NewArrayBounds}, new object[] {ExpressionType.NotEqual}, new object[] {ExpressionType.Or}, new object[] {ExpressionType.OrElse}, new object[] {ExpressionType.Parameter}, new object[] {ExpressionType.Power}, new object[] {ExpressionType.RightShift}, new object[] {ExpressionType.Subtract}, new object[] {ExpressionType.SubtractChecked}, new object[] {ExpressionType.TypeIs}, new object[] {ExpressionType.Assign}, new object[] {ExpressionType.Block}, new object[] {ExpressionType.DebugInfo}, new object[] {ExpressionType.Dynamic}, new object[] {ExpressionType.Default}, new object[] {ExpressionType.Extension}, new object[] {ExpressionType.Goto}, new object[] {ExpressionType.Index}, new object[] {ExpressionType.Label}, new object[] {ExpressionType.RuntimeVariables}, new object[] {ExpressionType.Loop}, new object[] {ExpressionType.Switch}, new object[] {ExpressionType.Try}, new object[] {ExpressionType.AddAssign}, new object[] {ExpressionType.AndAssign}, new object[] {ExpressionType.DivideAssign}, new object[] {ExpressionType.ExclusiveOrAssign}, new object[] {ExpressionType.LeftShiftAssign}, new object[] {ExpressionType.ModuloAssign}, new object[] {ExpressionType.MultiplyAssign}, new object[] {ExpressionType.OrAssign}, new object[] {ExpressionType.PowerAssign}, new object[] {ExpressionType.RightShiftAssign}, new object[] {ExpressionType.SubtractAssign}, new object[] {ExpressionType.AddAssignChecked}, new object[] {ExpressionType.MultiplyAssignChecked}, new object[] {ExpressionType.SubtractAssignChecked}, new object[] {ExpressionType.TypeEqual}, new object[] {(ExpressionType)(-1)}, new object[] {(ExpressionType)int.MaxValue} }; public static IEnumerable<object[]> NumericMethodAllowedUnaryTypes { get { yield return new object[] {ExpressionType.Negate}; yield return new object[] {ExpressionType.NegateChecked}; yield return new object[] {ExpressionType.OnesComplement}; yield return new object[] {ExpressionType.UnaryPlus}; yield return new object[] {ExpressionType.Increment}; yield return new object[] {ExpressionType.Decrement}; yield return new object[] {ExpressionType.PreIncrementAssign}; yield return new object[] {ExpressionType.PostIncrementAssign}; yield return new object[] {ExpressionType.PreDecrementAssign}; yield return new object[] {ExpressionType.PostDecrementAssign}; } } public static IEnumerable<object[]> BooleanMethodAllowedUnaryTypes { get { yield return new object[] {ExpressionType.Not}; yield return new object[] {ExpressionType.IsFalse}; yield return new object[] {ExpressionType.IsTrue}; } } public static IEnumerable<object[]> ConversionUnaryTypes { get { yield return new object[] {ExpressionType.Convert}; yield return new object[] {ExpressionType.ConvertChecked}; } } private class GenericClassWithNonGenericMethod<TClassType> { public static int DoIntStuff(int x) => x; public static bool DoBooleanStuff(bool b) => b; public static int CastLongToInt(long l) => unchecked((int)l); } [Theory, MemberData(nameof(NonUnaryExpressionTypes))] public void MakeUnaryExpressionNonUnary(ExpressionType type) { AssertExtensions.Throws<ArgumentException>("unaryType", () => Expression.MakeUnary(type, null, null)); } [Theory, MemberData(nameof(NumericMethodAllowedUnaryTypes))] public void MethodOfOpenGenericOnNumeric(ExpressionType type) { ParameterExpression variable = Expression.Variable(typeof(int)); Type genType = typeof(GenericClassWithNonGenericMethod<>); MethodInfo method = genType.GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoIntStuff)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(int), method)); method = genType.MakeGenericType(genType).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoIntStuff)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(int), method)); // Demonstrate does work when closed. method = genType.MakeGenericType(typeof(int)).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoIntStuff)); Expression.MakeUnary(type, variable, typeof(int), method); } [Theory, MemberData(nameof(BooleanMethodAllowedUnaryTypes))] public void MethodOfOpenGenericOnBoolean(ExpressionType type) { ParameterExpression variable = Expression.Variable(typeof(bool)); Type genType = typeof(GenericClassWithNonGenericMethod<>); MethodInfo method = genType.GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoBooleanStuff)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(bool), method)); method = genType.MakeGenericType(genType).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoBooleanStuff)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(bool), method)); // Demonstrate does work when closed. method = genType.MakeGenericType(typeof(int)).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.DoBooleanStuff)); Expression.MakeUnary(type, variable, typeof(bool), method); } [Theory, MemberData(nameof(BooleanMethodAllowedUnaryTypes))] public void MethodOfOpenGenericOnConversion(ExpressionType type) { ParameterExpression variable = Expression.Variable(typeof(long)); Type genType = typeof(GenericClassWithNonGenericMethod<>); MethodInfo method = genType.GetMethod(nameof(GenericClassWithNonGenericMethod<int>.CastLongToInt)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(int), method)); method = genType.MakeGenericType(genType).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.CastLongToInt)); AssertExtensions.Throws<ArgumentException>("method", () => Expression.MakeUnary(type, variable, typeof(int), method)); // Demonstrate does work when closed. method = genType.MakeGenericType(typeof(int)).GetMethod(nameof(GenericClassWithNonGenericMethod<int>.CastLongToInt)); Expression.MakeUnary(type, variable, typeof(int), method); } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/coreclr/nativeaot/System.Private.Reflection.Core/src/System/Reflection/Runtime/BindingFlagSupport/NameFilter.NativeFormat.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Globalization; using Internal.Metadata.NativeFormat; namespace System.Reflection.Runtime.BindingFlagSupport { internal abstract partial class NameFilter { public abstract bool Matches(ConstantStringValueHandle stringHandle, MetadataReader reader); } internal sealed partial class NameFilterCaseSensitive : NameFilter { public sealed override bool Matches(ConstantStringValueHandle stringHandle, MetadataReader reader) => stringHandle.StringEquals(ExpectedName, reader); } internal sealed partial class NameFilterCaseInsensitive : NameFilter { public sealed override bool Matches(ConstantStringValueHandle stringHandle, MetadataReader reader) => stringHandle.GetConstantStringValue(reader).Value.Equals(ExpectedName, StringComparison.OrdinalIgnoreCase); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Globalization; using Internal.Metadata.NativeFormat; namespace System.Reflection.Runtime.BindingFlagSupport { internal abstract partial class NameFilter { public abstract bool Matches(ConstantStringValueHandle stringHandle, MetadataReader reader); } internal sealed partial class NameFilterCaseSensitive : NameFilter { public sealed override bool Matches(ConstantStringValueHandle stringHandle, MetadataReader reader) => stringHandle.StringEquals(ExpectedName, reader); } internal sealed partial class NameFilterCaseInsensitive : NameFilter { public sealed override bool Matches(ConstantStringValueHandle stringHandle, MetadataReader reader) => stringHandle.GetConstantStringValue(reader).Value.Equals(ExpectedName, StringComparison.OrdinalIgnoreCase); } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/tests/Loader/classloader/generics/Instantiation/Nesting/NestedGenericTypesMix.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // this test loads a type with deeply nested generic structs and classes (up to level 500) using System; public class Test_NestedGenericTypesMix { public static int Main() { MyStruct0<int>.MyClass1<int>.MyStruct2<int>.MyClass3<int>.MyStruct4<int>.MyClass5<int>.MyStruct6<int>.MyClass7<int>.MyStruct8<int>.MyClass9<int>.MyStruct10<int>.MyClass11<int>.MyStruct12<int>.MyClass13<int>.MyStruct14<int>.MyClass15<int>.MyStruct16<int>.MyClass17<int>.MyStruct18<int>.MyClass19<int>.MyStruct20<int>.MyClass21<int>.MyStruct22<int>.MyClass23<int>.MyStruct24<int>.MyClass25<int>.MyStruct26<int>.MyClass27<int>.MyStruct28<int>.MyClass29<int>.MyStruct30<int>.MyClass31<int>.MyStruct32<int>.MyClass33<int>.MyStruct34<int>.MyClass35<int>.MyStruct36<int>.MyClass37<int>.MyStruct38<int>.MyClass39<int>.MyStruct40<int>.MyClass41<int>.MyStruct42<int>.MyClass43<int>.MyStruct44<int>.MyClass45<int>.MyStruct46<int>.MyClass47<int>.MyStruct48<int>.MyClass49<int>.MyStruct50<int>.MyClass51<int>.MyStruct52<int>.MyClass53<int>.MyStruct54<int>.MyClass55<int>.MyStruct56<int>.MyClass57<int>.MyStruct58<int>.MyClass59<int>.MyStruct60<int>.MyClass61<int>.MyStruct62<int>.MyClass63<int>.MyStruct64<int>.MyClass65<int>.MyStruct66<int>.MyClass67<int>.MyStruct68<int>.MyClass69<int>.MyStruct70<int>.MyClass71<int>.MyStruct72<int>.MyClass73<int>.MyStruct74<int>.MyClass75<int>.MyStruct76<int>.MyClass77<int>.MyStruct78<int>.MyClass79<int>.MyStruct80<int>.MyClass81<int>.MyStruct82<int>.MyClass83<int>.MyStruct84<int>.MyClass85<int>.MyStruct86<int>.MyClass87<int>.MyStruct88<int>.MyClass89<int>.MyStruct90<int>.MyClass91<int>.MyStruct92<int>.MyClass93<int>.MyStruct94<int>.MyClass95<int>.MyStruct96<int>.MyClass97<int>.MyStruct98<int>.MyClass99<int>.MyStruct100<int>.MyClass101<int>.MyStruct102<int>.MyClass103<int>.MyStruct104<int>.MyClass105<int>.MyStruct106<int>.MyClass107<int>.MyStruct108<int>.MyClass109<int>.MyStruct110<int>.MyClass111<int>.MyStruct112<int>.MyClass113<int>.MyStruct114<int>.MyClass115<int>.MyStruct116<int>.MyClass117<int>.MyStruct118<int>.MyClass119<int>.MyStruct120<int>.MyClass121<int>.MyStruct122<int>.MyClass123<int>.MyStruct124<int>.MyClass125<int>.MyStruct126<int>.MyClass127<int>.MyStruct128<int>.MyClass129<int>.MyStruct130<int>.MyClass131<int>.MyStruct132<int>.MyClass133<int>.MyStruct134<int>.MyClass135<int>.MyStruct136<int>.MyClass137<int>.MyStruct138<int>.MyClass139<int>.MyStruct140<int>.MyClass141<int>.MyStruct142<int>.MyClass143<int>.MyStruct144<int>.MyClass145<int>.MyStruct146<int>.MyClass147<int>.MyStruct148<int>.MyClass149<int>.MyStruct150<int>.MyClass151<int>.MyStruct152<int>.MyClass153<int>.MyStruct154<int>.MyClass155<int>.MyStruct156<int>.MyClass157<int>.MyStruct158<int>.MyClass159<int>.MyStruct160<int>.MyClass161<int>.MyStruct162<int>.MyClass163<int>.MyStruct164<int>.MyClass165<int>.MyStruct166<int>.MyClass167<int>.MyStruct168<int>.MyClass169<int>.MyStruct170<int>.MyClass171<int>.MyStruct172<int>.MyClass173<int>.MyStruct174<int>.MyClass175<int>.MyStruct176<int>.MyClass177<int>.MyStruct178<int>.MyClass179<int>.MyStruct180<int>.MyClass181<int>.MyStruct182<int>.MyClass183<int>.MyStruct184<int>.MyClass185<int>.MyStruct186<int>.MyClass187<int>.MyStruct188<int>.MyClass189<int>.MyStruct190<int>.MyClass191<int>.MyStruct192<int>.MyClass193<int>.MyStruct194<int>.MyClass195<int>.MyStruct196<int>.MyClass197<int>.MyStruct198<int>.MyClass199<int>.MyStruct200<int>.MyClass201<int>.MyStruct202<int>.MyClass203<int>.MyStruct204<int>.MyClass205<int>.MyStruct206<int>.MyClass207<int>.MyStruct208<int>.MyClass209<int>.MyStruct210<int>.MyClass211<int>.MyStruct212<int>.MyClass213<int>.MyStruct214<int>.MyClass215<int>.MyStruct216<int>.MyClass217<int>.MyStruct218<int>.MyClass219<int>.MyStruct220<int>.MyClass221<int>.MyStruct222<int>.MyClass223<int>.MyStruct224<int>.MyClass225<int>.MyStruct226<int>.MyClass227<int>.MyStruct228<int>.MyClass229<int>.MyStruct230<int>.MyClass231<int>.MyStruct232<int>.MyClass233<int>.MyStruct234<int>.MyClass235<int>.MyStruct236<int>.MyClass237<int>.MyStruct238<int>.MyClass239<int>.MyStruct240<int>.MyClass241<int>.MyStruct242<int>.MyClass243<int>.MyStruct244<int>.MyClass245<int>.MyStruct246<int>.MyClass247<int>.MyStruct248<int>.MyClass249<int>.MyStruct250<int>.MyClass251<int>.MyStruct252<int>.MyClass253<int>.MyStruct254<int>.MyClass255<int>.MyStruct256<int>.MyClass257<int>.MyStruct258<int>.MyClass259<int>.MyStruct260<int>.MyClass261<int>.MyStruct262<int>.MyClass263<int>.MyStruct264<int>.MyClass265<int>.MyStruct266<int>.MyClass267<int>.MyStruct268<int>.MyClass269<int>.MyStruct270<int>.MyClass271<int>.MyStruct272<int>.MyClass273<int>.MyStruct274<int>.MyClass275<int>.MyStruct276<int>.MyClass277<int>.MyStruct278<int>.MyClass279<int>.MyStruct280<int>.MyClass281<int>.MyStruct282<int>.MyClass283<int>.MyStruct284<int>.MyClass285<int>.MyStruct286<int>.MyClass287<int>.MyStruct288<int>.MyClass289<int>.MyStruct290<int>.MyClass291<int>.MyStruct292<int>.MyClass293<int>.MyStruct294<int>.MyClass295<int>.MyStruct296<int>.MyClass297<int>.MyStruct298<int>.MyClass299<int>.MyStruct300<int>.MyClass301<int>.MyStruct302<int>.MyClass303<int>.MyStruct304<int>.MyClass305<int>.MyStruct306<int>.MyClass307<int>.MyStruct308<int>.MyClass309<int>.MyStruct310<int>.MyClass311<int>.MyStruct312<int>.MyClass313<int>.MyStruct314<int>.MyClass315<int>.MyStruct316<int>.MyClass317<int>.MyStruct318<int>.MyClass319<int>.MyStruct320<int>.MyClass321<int>.MyStruct322<int>.MyClass323<int>.MyStruct324<int>.MyClass325<int>.MyStruct326<int>.MyClass327<int>.MyStruct328<int>.MyClass329<int>.MyStruct330<int>.MyClass331<int>.MyStruct332<int>.MyClass333<int>.MyStruct334<int>.MyClass335<int>.MyStruct336<int>.MyClass337<int>.MyStruct338<int>.MyClass339<int>.MyStruct340<int>.MyClass341<int>.MyStruct342<int>.MyClass343<int>.MyStruct344<int>.MyClass345<int>.MyStruct346<int>.MyClass347<int>.MyStruct348<int>.MyClass349<int>.MyStruct350<int>.MyClass351<int>.MyStruct352<int>.MyClass353<int>.MyStruct354<int>.MyClass355<int>.MyStruct356<int>.MyClass357<int>.MyStruct358<int>.MyClass359<int>.MyStruct360<int>.MyClass361<int>.MyStruct362<int>.MyClass363<int>.MyStruct364<int>.MyClass365<int>.MyStruct366<int>.MyClass367<int>.MyStruct368<int>.MyClass369<int>.MyStruct370<int>.MyClass371<int>.MyStruct372<int>.MyClass373<int>.MyStruct374<int>.MyClass375<int>.MyStruct376<int>.MyClass377<int>.MyStruct378<int>.MyClass379<int>.MyStruct380<int>.MyClass381<int>.MyStruct382<int>.MyClass383<int>.MyStruct384<int>.MyClass385<int>.MyStruct386<int>.MyClass387<int>.MyStruct388<int>.MyClass389<int>.MyStruct390<int>.MyClass391<int>.MyStruct392<int>.MyClass393<int>.MyStruct394<int>.MyClass395<int>.MyStruct396<int>.MyClass397<int>.MyStruct398<int>.MyClass399<int>.MyStruct400<int>.MyClass401<int>.MyStruct402<int>.MyClass403<int>.MyStruct404<int>.MyClass405<int>.MyStruct406<int>.MyClass407<int>.MyStruct408<int>.MyClass409<int>.MyStruct410<int>.MyClass411<int>.MyStruct412<int>.MyClass413<int>.MyStruct414<int>.MyClass415<int>.MyStruct416<int>.MyClass417<int>.MyStruct418<int>.MyClass419<int>.MyStruct420<int>.MyClass421<int>.MyStruct422<int>.MyClass423<int>.MyStruct424<int>.MyClass425<int>.MyStruct426<int>.MyClass427<int>.MyStruct428<int>.MyClass429<int>.MyStruct430<int>.MyClass431<int>.MyStruct432<int>.MyClass433<int>.MyStruct434<int>.MyClass435<int>.MyStruct436<int>.MyClass437<int>.MyStruct438<int>.MyClass439<int>.MyStruct440<int>.MyClass441<int>.MyStruct442<int>.MyClass443<int>.MyStruct444<int>.MyClass445<int>.MyStruct446<int>.MyClass447<int>.MyStruct448<int>.MyClass449<int>.MyStruct450<int>.MyClass451<int>.MyStruct452<int>.MyClass453<int>.MyStruct454<int>.MyClass455<int>.MyStruct456<int>.MyClass457<int>.MyStruct458<int>.MyClass459<int>.MyStruct460<int>.MyClass461<int>.MyStruct462<int>.MyClass463<int>.MyStruct464<int>.MyClass465<int>.MyStruct466<int>.MyClass467<int>.MyStruct468<int>.MyClass469<int>.MyStruct470<int>.MyClass471<int>.MyStruct472<int>.MyClass473<int>.MyStruct474<int>.MyClass475<int>.MyStruct476<int>.MyClass477<int>.MyStruct478<int>.MyClass479<int>.MyStruct480<int>.MyClass481<int>.MyStruct482<int>.MyClass483<int>.MyStruct484<int>.MyClass485<int>.MyStruct486<int>.MyClass487<int>.MyStruct488<int>.MyClass489<int>.MyStruct490<int>.MyClass491<int>.MyStruct492<int>.MyClass493<int>.MyStruct494<int>.MyClass495<int>.MyStruct496<int>.MyClass497<int>.MyStruct498<int>.MyClass499<int> obj = new MyStruct0<int>.MyClass1<int>.MyStruct2<int>.MyClass3<int>.MyStruct4<int>.MyClass5<int>.MyStruct6<int>.MyClass7<int>.MyStruct8<int>.MyClass9<int>.MyStruct10<int>.MyClass11<int>.MyStruct12<int>.MyClass13<int>.MyStruct14<int>.MyClass15<int>.MyStruct16<int>.MyClass17<int>.MyStruct18<int>.MyClass19<int>.MyStruct20<int>.MyClass21<int>.MyStruct22<int>.MyClass23<int>.MyStruct24<int>.MyClass25<int>.MyStruct26<int>.MyClass27<int>.MyStruct28<int>.MyClass29<int>.MyStruct30<int>.MyClass31<int>.MyStruct32<int>.MyClass33<int>.MyStruct34<int>.MyClass35<int>.MyStruct36<int>.MyClass37<int>.MyStruct38<int>.MyClass39<int>.MyStruct40<int>.MyClass41<int>.MyStruct42<int>.MyClass43<int>.MyStruct44<int>.MyClass45<int>.MyStruct46<int>.MyClass47<int>.MyStruct48<int>.MyClass49<int>.MyStruct50<int>.MyClass51<int>.MyStruct52<int>.MyClass53<int>.MyStruct54<int>.MyClass55<int>.MyStruct56<int>.MyClass57<int>.MyStruct58<int>.MyClass59<int>.MyStruct60<int>.MyClass61<int>.MyStruct62<int>.MyClass63<int>.MyStruct64<int>.MyClass65<int>.MyStruct66<int>.MyClass67<int>.MyStruct68<int>.MyClass69<int>.MyStruct70<int>.MyClass71<int>.MyStruct72<int>.MyClass73<int>.MyStruct74<int>.MyClass75<int>.MyStruct76<int>.MyClass77<int>.MyStruct78<int>.MyClass79<int>.MyStruct80<int>.MyClass81<int>.MyStruct82<int>.MyClass83<int>.MyStruct84<int>.MyClass85<int>.MyStruct86<int>.MyClass87<int>.MyStruct88<int>.MyClass89<int>.MyStruct90<int>.MyClass91<int>.MyStruct92<int>.MyClass93<int>.MyStruct94<int>.MyClass95<int>.MyStruct96<int>.MyClass97<int>.MyStruct98<int>.MyClass99<int>.MyStruct100<int>.MyClass101<int>.MyStruct102<int>.MyClass103<int>.MyStruct104<int>.MyClass105<int>.MyStruct106<int>.MyClass107<int>.MyStruct108<int>.MyClass109<int>.MyStruct110<int>.MyClass111<int>.MyStruct112<int>.MyClass113<int>.MyStruct114<int>.MyClass115<int>.MyStruct116<int>.MyClass117<int>.MyStruct118<int>.MyClass119<int>.MyStruct120<int>.MyClass121<int>.MyStruct122<int>.MyClass123<int>.MyStruct124<int>.MyClass125<int>.MyStruct126<int>.MyClass127<int>.MyStruct128<int>.MyClass129<int>.MyStruct130<int>.MyClass131<int>.MyStruct132<int>.MyClass133<int>.MyStruct134<int>.MyClass135<int>.MyStruct136<int>.MyClass137<int>.MyStruct138<int>.MyClass139<int>.MyStruct140<int>.MyClass141<int>.MyStruct142<int>.MyClass143<int>.MyStruct144<int>.MyClass145<int>.MyStruct146<int>.MyClass147<int>.MyStruct148<int>.MyClass149<int>.MyStruct150<int>.MyClass151<int>.MyStruct152<int>.MyClass153<int>.MyStruct154<int>.MyClass155<int>.MyStruct156<int>.MyClass157<int>.MyStruct158<int>.MyClass159<int>.MyStruct160<int>.MyClass161<int>.MyStruct162<int>.MyClass163<int>.MyStruct164<int>.MyClass165<int>.MyStruct166<int>.MyClass167<int>.MyStruct168<int>.MyClass169<int>.MyStruct170<int>.MyClass171<int>.MyStruct172<int>.MyClass173<int>.MyStruct174<int>.MyClass175<int>.MyStruct176<int>.MyClass177<int>.MyStruct178<int>.MyClass179<int>.MyStruct180<int>.MyClass181<int>.MyStruct182<int>.MyClass183<int>.MyStruct184<int>.MyClass185<int>.MyStruct186<int>.MyClass187<int>.MyStruct188<int>.MyClass189<int>.MyStruct190<int>.MyClass191<int>.MyStruct192<int>.MyClass193<int>.MyStruct194<int>.MyClass195<int>.MyStruct196<int>.MyClass197<int>.MyStruct198<int>.MyClass199<int>.MyStruct200<int>.MyClass201<int>.MyStruct202<int>.MyClass203<int>.MyStruct204<int>.MyClass205<int>.MyStruct206<int>.MyClass207<int>.MyStruct208<int>.MyClass209<int>.MyStruct210<int>.MyClass211<int>.MyStruct212<int>.MyClass213<int>.MyStruct214<int>.MyClass215<int>.MyStruct216<int>.MyClass217<int>.MyStruct218<int>.MyClass219<int>.MyStruct220<int>.MyClass221<int>.MyStruct222<int>.MyClass223<int>.MyStruct224<int>.MyClass225<int>.MyStruct226<int>.MyClass227<int>.MyStruct228<int>.MyClass229<int>.MyStruct230<int>.MyClass231<int>.MyStruct232<int>.MyClass233<int>.MyStruct234<int>.MyClass235<int>.MyStruct236<int>.MyClass237<int>.MyStruct238<int>.MyClass239<int>.MyStruct240<int>.MyClass241<int>.MyStruct242<int>.MyClass243<int>.MyStruct244<int>.MyClass245<int>.MyStruct246<int>.MyClass247<int>.MyStruct248<int>.MyClass249<int>.MyStruct250<int>.MyClass251<int>.MyStruct252<int>.MyClass253<int>.MyStruct254<int>.MyClass255<int>.MyStruct256<int>.MyClass257<int>.MyStruct258<int>.MyClass259<int>.MyStruct260<int>.MyClass261<int>.MyStruct262<int>.MyClass263<int>.MyStruct264<int>.MyClass265<int>.MyStruct266<int>.MyClass267<int>.MyStruct268<int>.MyClass269<int>.MyStruct270<int>.MyClass271<int>.MyStruct272<int>.MyClass273<int>.MyStruct274<int>.MyClass275<int>.MyStruct276<int>.MyClass277<int>.MyStruct278<int>.MyClass279<int>.MyStruct280<int>.MyClass281<int>.MyStruct282<int>.MyClass283<int>.MyStruct284<int>.MyClass285<int>.MyStruct286<int>.MyClass287<int>.MyStruct288<int>.MyClass289<int>.MyStruct290<int>.MyClass291<int>.MyStruct292<int>.MyClass293<int>.MyStruct294<int>.MyClass295<int>.MyStruct296<int>.MyClass297<int>.MyStruct298<int>.MyClass299<int>.MyStruct300<int>.MyClass301<int>.MyStruct302<int>.MyClass303<int>.MyStruct304<int>.MyClass305<int>.MyStruct306<int>.MyClass307<int>.MyStruct308<int>.MyClass309<int>.MyStruct310<int>.MyClass311<int>.MyStruct312<int>.MyClass313<int>.MyStruct314<int>.MyClass315<int>.MyStruct316<int>.MyClass317<int>.MyStruct318<int>.MyClass319<int>.MyStruct320<int>.MyClass321<int>.MyStruct322<int>.MyClass323<int>.MyStruct324<int>.MyClass325<int>.MyStruct326<int>.MyClass327<int>.MyStruct328<int>.MyClass329<int>.MyStruct330<int>.MyClass331<int>.MyStruct332<int>.MyClass333<int>.MyStruct334<int>.MyClass335<int>.MyStruct336<int>.MyClass337<int>.MyStruct338<int>.MyClass339<int>.MyStruct340<int>.MyClass341<int>.MyStruct342<int>.MyClass343<int>.MyStruct344<int>.MyClass345<int>.MyStruct346<int>.MyClass347<int>.MyStruct348<int>.MyClass349<int>.MyStruct350<int>.MyClass351<int>.MyStruct352<int>.MyClass353<int>.MyStruct354<int>.MyClass355<int>.MyStruct356<int>.MyClass357<int>.MyStruct358<int>.MyClass359<int>.MyStruct360<int>.MyClass361<int>.MyStruct362<int>.MyClass363<int>.MyStruct364<int>.MyClass365<int>.MyStruct366<int>.MyClass367<int>.MyStruct368<int>.MyClass369<int>.MyStruct370<int>.MyClass371<int>.MyStruct372<int>.MyClass373<int>.MyStruct374<int>.MyClass375<int>.MyStruct376<int>.MyClass377<int>.MyStruct378<int>.MyClass379<int>.MyStruct380<int>.MyClass381<int>.MyStruct382<int>.MyClass383<int>.MyStruct384<int>.MyClass385<int>.MyStruct386<int>.MyClass387<int>.MyStruct388<int>.MyClass389<int>.MyStruct390<int>.MyClass391<int>.MyStruct392<int>.MyClass393<int>.MyStruct394<int>.MyClass395<int>.MyStruct396<int>.MyClass397<int>.MyStruct398<int>.MyClass399<int>.MyStruct400<int>.MyClass401<int>.MyStruct402<int>.MyClass403<int>.MyStruct404<int>.MyClass405<int>.MyStruct406<int>.MyClass407<int>.MyStruct408<int>.MyClass409<int>.MyStruct410<int>.MyClass411<int>.MyStruct412<int>.MyClass413<int>.MyStruct414<int>.MyClass415<int>.MyStruct416<int>.MyClass417<int>.MyStruct418<int>.MyClass419<int>.MyStruct420<int>.MyClass421<int>.MyStruct422<int>.MyClass423<int>.MyStruct424<int>.MyClass425<int>.MyStruct426<int>.MyClass427<int>.MyStruct428<int>.MyClass429<int>.MyStruct430<int>.MyClass431<int>.MyStruct432<int>.MyClass433<int>.MyStruct434<int>.MyClass435<int>.MyStruct436<int>.MyClass437<int>.MyStruct438<int>.MyClass439<int>.MyStruct440<int>.MyClass441<int>.MyStruct442<int>.MyClass443<int>.MyStruct444<int>.MyClass445<int>.MyStruct446<int>.MyClass447<int>.MyStruct448<int>.MyClass449<int>.MyStruct450<int>.MyClass451<int>.MyStruct452<int>.MyClass453<int>.MyStruct454<int>.MyClass455<int>.MyStruct456<int>.MyClass457<int>.MyStruct458<int>.MyClass459<int>.MyStruct460<int>.MyClass461<int>.MyStruct462<int>.MyClass463<int>.MyStruct464<int>.MyClass465<int>.MyStruct466<int>.MyClass467<int>.MyStruct468<int>.MyClass469<int>.MyStruct470<int>.MyClass471<int>.MyStruct472<int>.MyClass473<int>.MyStruct474<int>.MyClass475<int>.MyStruct476<int>.MyClass477<int>.MyStruct478<int>.MyClass479<int>.MyStruct480<int>.MyClass481<int>.MyStruct482<int>.MyClass483<int>.MyStruct484<int>.MyClass485<int>.MyStruct486<int>.MyClass487<int>.MyStruct488<int>.MyClass489<int>.MyStruct490<int>.MyClass491<int>.MyStruct492<int>.MyClass493<int>.MyStruct494<int>.MyClass495<int>.MyStruct496<int>.MyClass497<int>.MyStruct498<int>.MyClass499<int>(); Console.WriteLine("PASS"); return 100; } } public struct MyStruct0<T0> { public class MyClass1<T1> { public struct MyStruct2<T2> { public class MyClass3<T3> { public struct MyStruct4<T4> { public class MyClass5<T5> { public struct MyStruct6<T6> { public class MyClass7<T7> { public struct MyStruct8<T8> { public class MyClass9<T9> { public struct MyStruct10<T10> { public class MyClass11<T11> { public struct MyStruct12<T12> { public class MyClass13<T13> { public struct MyStruct14<T14> { public class MyClass15<T15> { public struct MyStruct16<T16> { public class MyClass17<T17> { public struct MyStruct18<T18> { public class MyClass19<T19> { public struct MyStruct20<T20> { public class MyClass21<T21> { public struct MyStruct22<T22> { public class MyClass23<T23> { public struct MyStruct24<T24> { public class MyClass25<T25> { public struct MyStruct26<T26> { public class MyClass27<T27> { public struct MyStruct28<T28> { public class MyClass29<T29> { public struct MyStruct30<T30> { public class MyClass31<T31> { public struct MyStruct32<T32> { public class MyClass33<T33> { public struct MyStruct34<T34> { public class MyClass35<T35> { public struct MyStruct36<T36> { public class MyClass37<T37> { public struct MyStruct38<T38> { public class MyClass39<T39> { public struct MyStruct40<T40> { public class MyClass41<T41> { public struct MyStruct42<T42> { public class MyClass43<T43> { public struct MyStruct44<T44> { public class MyClass45<T45> { public struct MyStruct46<T46> { public class MyClass47<T47> { public struct MyStruct48<T48> { public class MyClass49<T49> { public struct MyStruct50<T50> { public class MyClass51<T51> { public struct MyStruct52<T52> { public class MyClass53<T53> { public struct MyStruct54<T54> { public class MyClass55<T55> { public struct MyStruct56<T56> { public class MyClass57<T57> { public struct MyStruct58<T58> { public class MyClass59<T59> { public struct MyStruct60<T60> { public class MyClass61<T61> { public struct MyStruct62<T62> { public class MyClass63<T63> { public struct MyStruct64<T64> { public class MyClass65<T65> { public struct MyStruct66<T66> { public class MyClass67<T67> { public struct MyStruct68<T68> { public class MyClass69<T69> { public struct MyStruct70<T70> { public class MyClass71<T71> { public struct MyStruct72<T72> { public class MyClass73<T73> { public struct MyStruct74<T74> { public class MyClass75<T75> { public struct MyStruct76<T76> { public class MyClass77<T77> { public struct MyStruct78<T78> { public class MyClass79<T79> { public struct MyStruct80<T80> { public class MyClass81<T81> { public struct MyStruct82<T82> { public class MyClass83<T83> { public struct MyStruct84<T84> { public class MyClass85<T85> { public struct MyStruct86<T86> { public class MyClass87<T87> { public struct MyStruct88<T88> { public class MyClass89<T89> { public struct MyStruct90<T90> { public class MyClass91<T91> { public struct MyStruct92<T92> { public class MyClass93<T93> { public struct MyStruct94<T94> { public class MyClass95<T95> { public struct MyStruct96<T96> { public class MyClass97<T97> { public struct MyStruct98<T98> { public class MyClass99<T99> { public struct MyStruct100<T100> { public class MyClass101<T101> { public struct MyStruct102<T102> { public class MyClass103<T103> { public struct MyStruct104<T104> { public class MyClass105<T105> { public struct MyStruct106<T106> { public class MyClass107<T107> { public struct MyStruct108<T108> { public class MyClass109<T109> { public struct MyStruct110<T110> { public class MyClass111<T111> { public struct MyStruct112<T112> { public class MyClass113<T113> { public struct MyStruct114<T114> { public class MyClass115<T115> { public struct MyStruct116<T116> { public class MyClass117<T117> { public struct MyStruct118<T118> { public class MyClass119<T119> { public struct MyStruct120<T120> { public class MyClass121<T121> { public struct MyStruct122<T122> { public class MyClass123<T123> { public struct MyStruct124<T124> { public class MyClass125<T125> { public struct MyStruct126<T126> { public class MyClass127<T127> { public struct MyStruct128<T128> { public class MyClass129<T129> { public struct MyStruct130<T130> { public class MyClass131<T131> { public struct MyStruct132<T132> { public class MyClass133<T133> { public struct MyStruct134<T134> { public class MyClass135<T135> { public struct MyStruct136<T136> { public class MyClass137<T137> { public struct MyStruct138<T138> { public class MyClass139<T139> { public struct MyStruct140<T140> { public class MyClass141<T141> { public struct MyStruct142<T142> { public class MyClass143<T143> { public struct MyStruct144<T144> { public class MyClass145<T145> { public struct MyStruct146<T146> { public class MyClass147<T147> { public struct MyStruct148<T148> { public class MyClass149<T149> { public struct MyStruct150<T150> { public class MyClass151<T151> { public struct MyStruct152<T152> { public class MyClass153<T153> { public struct MyStruct154<T154> { public class MyClass155<T155> { public struct MyStruct156<T156> { public class MyClass157<T157> { public struct MyStruct158<T158> { public class MyClass159<T159> { public struct MyStruct160<T160> { public class MyClass161<T161> { public struct MyStruct162<T162> { public class MyClass163<T163> { public struct MyStruct164<T164> { public class MyClass165<T165> { public struct MyStruct166<T166> { public class MyClass167<T167> { public struct MyStruct168<T168> { public class MyClass169<T169> { public struct MyStruct170<T170> { public class MyClass171<T171> { public struct MyStruct172<T172> { public class MyClass173<T173> { public struct MyStruct174<T174> { public class MyClass175<T175> { public struct MyStruct176<T176> { public class MyClass177<T177> { public struct MyStruct178<T178> { public class MyClass179<T179> { public struct MyStruct180<T180> { public class MyClass181<T181> { public struct MyStruct182<T182> { public class MyClass183<T183> { public struct MyStruct184<T184> { public class MyClass185<T185> { public struct MyStruct186<T186> { public class MyClass187<T187> { public struct MyStruct188<T188> { public class MyClass189<T189> { public struct MyStruct190<T190> { public class MyClass191<T191> { public struct MyStruct192<T192> { public class MyClass193<T193> { public struct MyStruct194<T194> { public class MyClass195<T195> { public struct MyStruct196<T196> { public class MyClass197<T197> { public struct MyStruct198<T198> { public class MyClass199<T199> { public struct MyStruct200<T200> { public class MyClass201<T201> { public struct MyStruct202<T202> { public class MyClass203<T203> { public struct MyStruct204<T204> { public class MyClass205<T205> { public struct MyStruct206<T206> { public class MyClass207<T207> { public struct MyStruct208<T208> { public class MyClass209<T209> { public struct MyStruct210<T210> { public class MyClass211<T211> { public struct MyStruct212<T212> { public class MyClass213<T213> { public struct MyStruct214<T214> { public class MyClass215<T215> { public struct MyStruct216<T216> { public class MyClass217<T217> { public struct MyStruct218<T218> { public class MyClass219<T219> { public struct MyStruct220<T220> { public class MyClass221<T221> { public struct MyStruct222<T222> { public class MyClass223<T223> { public struct MyStruct224<T224> { public class MyClass225<T225> { public struct MyStruct226<T226> { public class MyClass227<T227> { public struct MyStruct228<T228> { public class MyClass229<T229> { public struct MyStruct230<T230> { public class MyClass231<T231> { public struct MyStruct232<T232> { public class MyClass233<T233> { public struct MyStruct234<T234> { public class MyClass235<T235> { public struct MyStruct236<T236> { public class MyClass237<T237> { public struct MyStruct238<T238> { public class MyClass239<T239> { public struct MyStruct240<T240> { public class MyClass241<T241> { public struct MyStruct242<T242> { public class MyClass243<T243> { public struct MyStruct244<T244> { public class MyClass245<T245> { public struct MyStruct246<T246> { public class MyClass247<T247> { public struct MyStruct248<T248> { public class MyClass249<T249> { public struct MyStruct250<T250> { public class MyClass251<T251> { public struct MyStruct252<T252> { public class MyClass253<T253> { public struct MyStruct254<T254> { public class MyClass255<T255> { public struct MyStruct256<T256> { public class MyClass257<T257> { public struct MyStruct258<T258> { public class MyClass259<T259> { public struct MyStruct260<T260> { public class MyClass261<T261> { public struct MyStruct262<T262> { public class MyClass263<T263> { public struct MyStruct264<T264> { public class MyClass265<T265> { public struct MyStruct266<T266> { public class MyClass267<T267> { public struct MyStruct268<T268> { public class MyClass269<T269> { public struct MyStruct270<T270> { public class MyClass271<T271> { public struct MyStruct272<T272> { public class MyClass273<T273> { public struct MyStruct274<T274> { public class MyClass275<T275> { public struct MyStruct276<T276> { public class MyClass277<T277> { public struct MyStruct278<T278> { public class MyClass279<T279> { public struct MyStruct280<T280> { public class MyClass281<T281> { public struct MyStruct282<T282> { public class MyClass283<T283> { public struct MyStruct284<T284> { public class MyClass285<T285> { public struct MyStruct286<T286> { public class MyClass287<T287> { public struct MyStruct288<T288> { public class MyClass289<T289> { public struct MyStruct290<T290> { public class MyClass291<T291> { public struct MyStruct292<T292> { public class MyClass293<T293> { public struct MyStruct294<T294> { public class MyClass295<T295> { public struct MyStruct296<T296> { public class MyClass297<T297> { public struct MyStruct298<T298> { public class MyClass299<T299> { public struct MyStruct300<T300> { public class MyClass301<T301> { public struct MyStruct302<T302> { public class MyClass303<T303> { public struct MyStruct304<T304> { public class MyClass305<T305> { public struct MyStruct306<T306> { public class MyClass307<T307> { public struct MyStruct308<T308> { public class MyClass309<T309> { public struct MyStruct310<T310> { public class MyClass311<T311> { public struct MyStruct312<T312> { public class MyClass313<T313> { public struct MyStruct314<T314> { public class MyClass315<T315> { public struct MyStruct316<T316> { public class MyClass317<T317> { public struct MyStruct318<T318> { public class MyClass319<T319> { public struct MyStruct320<T320> { public class MyClass321<T321> { public struct MyStruct322<T322> { public class MyClass323<T323> { public struct MyStruct324<T324> { public class MyClass325<T325> { public struct MyStruct326<T326> { public class MyClass327<T327> { public struct MyStruct328<T328> { public class MyClass329<T329> { public struct MyStruct330<T330> { public class MyClass331<T331> { public struct MyStruct332<T332> { public class MyClass333<T333> { public struct MyStruct334<T334> { public class MyClass335<T335> { public struct MyStruct336<T336> { public class MyClass337<T337> { public struct MyStruct338<T338> { public class MyClass339<T339> { public struct MyStruct340<T340> { public class MyClass341<T341> { public struct MyStruct342<T342> { public class MyClass343<T343> { public struct MyStruct344<T344> { public class MyClass345<T345> { public struct MyStruct346<T346> { public class MyClass347<T347> { public struct MyStruct348<T348> { public class MyClass349<T349> { public struct MyStruct350<T350> { public class MyClass351<T351> { public struct MyStruct352<T352> { public class MyClass353<T353> { public struct MyStruct354<T354> { public class MyClass355<T355> { public struct MyStruct356<T356> { public class MyClass357<T357> { public struct MyStruct358<T358> { public class MyClass359<T359> { public struct MyStruct360<T360> { public class MyClass361<T361> { public struct MyStruct362<T362> { public class MyClass363<T363> { public struct MyStruct364<T364> { public class MyClass365<T365> { public struct MyStruct366<T366> { public class MyClass367<T367> { public struct MyStruct368<T368> { public class MyClass369<T369> { public struct MyStruct370<T370> { public class MyClass371<T371> { public struct MyStruct372<T372> { public class MyClass373<T373> { public struct MyStruct374<T374> { public class MyClass375<T375> { public struct MyStruct376<T376> { public class MyClass377<T377> { public struct MyStruct378<T378> { public class MyClass379<T379> { public struct MyStruct380<T380> { public class MyClass381<T381> { public struct MyStruct382<T382> { public class MyClass383<T383> { public struct MyStruct384<T384> { public class MyClass385<T385> { public struct MyStruct386<T386> { public class MyClass387<T387> { public struct MyStruct388<T388> { public class MyClass389<T389> { public struct MyStruct390<T390> { public class MyClass391<T391> { public struct MyStruct392<T392> { public class MyClass393<T393> { public struct MyStruct394<T394> { public class MyClass395<T395> { public struct MyStruct396<T396> { public class MyClass397<T397> { public struct MyStruct398<T398> { public class MyClass399<T399> { public struct MyStruct400<T400> { public class MyClass401<T401> { public struct MyStruct402<T402> { public class MyClass403<T403> { public struct MyStruct404<T404> { public class MyClass405<T405> { public struct MyStruct406<T406> { public class MyClass407<T407> { public struct MyStruct408<T408> { public class MyClass409<T409> { public struct MyStruct410<T410> { public class MyClass411<T411> { public struct MyStruct412<T412> { public class MyClass413<T413> { public struct MyStruct414<T414> { public class MyClass415<T415> { public struct MyStruct416<T416> { public class MyClass417<T417> { public struct MyStruct418<T418> { public class MyClass419<T419> { public struct MyStruct420<T420> { public class MyClass421<T421> { public struct MyStruct422<T422> { public class MyClass423<T423> { public struct MyStruct424<T424> { public class MyClass425<T425> { public struct MyStruct426<T426> { public class MyClass427<T427> { public struct MyStruct428<T428> { public class MyClass429<T429> { public struct MyStruct430<T430> { public class MyClass431<T431> { public struct MyStruct432<T432> { public class MyClass433<T433> { public struct MyStruct434<T434> { public class MyClass435<T435> { public struct MyStruct436<T436> { public class MyClass437<T437> { public struct MyStruct438<T438> { public class MyClass439<T439> { public struct MyStruct440<T440> { public class MyClass441<T441> { public struct MyStruct442<T442> { public class MyClass443<T443> { public struct MyStruct444<T444> { public class MyClass445<T445> { public struct MyStruct446<T446> { public class MyClass447<T447> { public struct MyStruct448<T448> { public class MyClass449<T449> { public struct MyStruct450<T450> { public class MyClass451<T451> { public struct MyStruct452<T452> { public class MyClass453<T453> { public struct MyStruct454<T454> { public class MyClass455<T455> { public struct MyStruct456<T456> { public class MyClass457<T457> { public struct MyStruct458<T458> { public class MyClass459<T459> { public struct MyStruct460<T460> { public class MyClass461<T461> { public struct MyStruct462<T462> { public class MyClass463<T463> { public struct MyStruct464<T464> { public class MyClass465<T465> { public struct MyStruct466<T466> { public class MyClass467<T467> { public struct MyStruct468<T468> { public class MyClass469<T469> { public struct MyStruct470<T470> { public class MyClass471<T471> { public struct MyStruct472<T472> { public class MyClass473<T473> { public struct MyStruct474<T474> { public class MyClass475<T475> { public struct MyStruct476<T476> { public class MyClass477<T477> { public struct MyStruct478<T478> { public class MyClass479<T479> { public struct MyStruct480<T480> { public class MyClass481<T481> { public struct MyStruct482<T482> { public class MyClass483<T483> { public struct MyStruct484<T484> { public class MyClass485<T485> { public struct MyStruct486<T486> { public class MyClass487<T487> { public struct MyStruct488<T488> { public class MyClass489<T489> { public struct MyStruct490<T490> { public class MyClass491<T491> { public struct MyStruct492<T492> { public class MyClass493<T493> { public struct MyStruct494<T494> { public class MyClass495<T495> { public struct MyStruct496<T496> { public class MyClass497<T497> { public struct MyStruct498<T498> { public class MyClass499<T499> { } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // this test loads a type with deeply nested generic structs and classes (up to level 500) using System; public class Test_NestedGenericTypesMix { public static int Main() { MyStruct0<int>.MyClass1<int>.MyStruct2<int>.MyClass3<int>.MyStruct4<int>.MyClass5<int>.MyStruct6<int>.MyClass7<int>.MyStruct8<int>.MyClass9<int>.MyStruct10<int>.MyClass11<int>.MyStruct12<int>.MyClass13<int>.MyStruct14<int>.MyClass15<int>.MyStruct16<int>.MyClass17<int>.MyStruct18<int>.MyClass19<int>.MyStruct20<int>.MyClass21<int>.MyStruct22<int>.MyClass23<int>.MyStruct24<int>.MyClass25<int>.MyStruct26<int>.MyClass27<int>.MyStruct28<int>.MyClass29<int>.MyStruct30<int>.MyClass31<int>.MyStruct32<int>.MyClass33<int>.MyStruct34<int>.MyClass35<int>.MyStruct36<int>.MyClass37<int>.MyStruct38<int>.MyClass39<int>.MyStruct40<int>.MyClass41<int>.MyStruct42<int>.MyClass43<int>.MyStruct44<int>.MyClass45<int>.MyStruct46<int>.MyClass47<int>.MyStruct48<int>.MyClass49<int>.MyStruct50<int>.MyClass51<int>.MyStruct52<int>.MyClass53<int>.MyStruct54<int>.MyClass55<int>.MyStruct56<int>.MyClass57<int>.MyStruct58<int>.MyClass59<int>.MyStruct60<int>.MyClass61<int>.MyStruct62<int>.MyClass63<int>.MyStruct64<int>.MyClass65<int>.MyStruct66<int>.MyClass67<int>.MyStruct68<int>.MyClass69<int>.MyStruct70<int>.MyClass71<int>.MyStruct72<int>.MyClass73<int>.MyStruct74<int>.MyClass75<int>.MyStruct76<int>.MyClass77<int>.MyStruct78<int>.MyClass79<int>.MyStruct80<int>.MyClass81<int>.MyStruct82<int>.MyClass83<int>.MyStruct84<int>.MyClass85<int>.MyStruct86<int>.MyClass87<int>.MyStruct88<int>.MyClass89<int>.MyStruct90<int>.MyClass91<int>.MyStruct92<int>.MyClass93<int>.MyStruct94<int>.MyClass95<int>.MyStruct96<int>.MyClass97<int>.MyStruct98<int>.MyClass99<int>.MyStruct100<int>.MyClass101<int>.MyStruct102<int>.MyClass103<int>.MyStruct104<int>.MyClass105<int>.MyStruct106<int>.MyClass107<int>.MyStruct108<int>.MyClass109<int>.MyStruct110<int>.MyClass111<int>.MyStruct112<int>.MyClass113<int>.MyStruct114<int>.MyClass115<int>.MyStruct116<int>.MyClass117<int>.MyStruct118<int>.MyClass119<int>.MyStruct120<int>.MyClass121<int>.MyStruct122<int>.MyClass123<int>.MyStruct124<int>.MyClass125<int>.MyStruct126<int>.MyClass127<int>.MyStruct128<int>.MyClass129<int>.MyStruct130<int>.MyClass131<int>.MyStruct132<int>.MyClass133<int>.MyStruct134<int>.MyClass135<int>.MyStruct136<int>.MyClass137<int>.MyStruct138<int>.MyClass139<int>.MyStruct140<int>.MyClass141<int>.MyStruct142<int>.MyClass143<int>.MyStruct144<int>.MyClass145<int>.MyStruct146<int>.MyClass147<int>.MyStruct148<int>.MyClass149<int>.MyStruct150<int>.MyClass151<int>.MyStruct152<int>.MyClass153<int>.MyStruct154<int>.MyClass155<int>.MyStruct156<int>.MyClass157<int>.MyStruct158<int>.MyClass159<int>.MyStruct160<int>.MyClass161<int>.MyStruct162<int>.MyClass163<int>.MyStruct164<int>.MyClass165<int>.MyStruct166<int>.MyClass167<int>.MyStruct168<int>.MyClass169<int>.MyStruct170<int>.MyClass171<int>.MyStruct172<int>.MyClass173<int>.MyStruct174<int>.MyClass175<int>.MyStruct176<int>.MyClass177<int>.MyStruct178<int>.MyClass179<int>.MyStruct180<int>.MyClass181<int>.MyStruct182<int>.MyClass183<int>.MyStruct184<int>.MyClass185<int>.MyStruct186<int>.MyClass187<int>.MyStruct188<int>.MyClass189<int>.MyStruct190<int>.MyClass191<int>.MyStruct192<int>.MyClass193<int>.MyStruct194<int>.MyClass195<int>.MyStruct196<int>.MyClass197<int>.MyStruct198<int>.MyClass199<int>.MyStruct200<int>.MyClass201<int>.MyStruct202<int>.MyClass203<int>.MyStruct204<int>.MyClass205<int>.MyStruct206<int>.MyClass207<int>.MyStruct208<int>.MyClass209<int>.MyStruct210<int>.MyClass211<int>.MyStruct212<int>.MyClass213<int>.MyStruct214<int>.MyClass215<int>.MyStruct216<int>.MyClass217<int>.MyStruct218<int>.MyClass219<int>.MyStruct220<int>.MyClass221<int>.MyStruct222<int>.MyClass223<int>.MyStruct224<int>.MyClass225<int>.MyStruct226<int>.MyClass227<int>.MyStruct228<int>.MyClass229<int>.MyStruct230<int>.MyClass231<int>.MyStruct232<int>.MyClass233<int>.MyStruct234<int>.MyClass235<int>.MyStruct236<int>.MyClass237<int>.MyStruct238<int>.MyClass239<int>.MyStruct240<int>.MyClass241<int>.MyStruct242<int>.MyClass243<int>.MyStruct244<int>.MyClass245<int>.MyStruct246<int>.MyClass247<int>.MyStruct248<int>.MyClass249<int>.MyStruct250<int>.MyClass251<int>.MyStruct252<int>.MyClass253<int>.MyStruct254<int>.MyClass255<int>.MyStruct256<int>.MyClass257<int>.MyStruct258<int>.MyClass259<int>.MyStruct260<int>.MyClass261<int>.MyStruct262<int>.MyClass263<int>.MyStruct264<int>.MyClass265<int>.MyStruct266<int>.MyClass267<int>.MyStruct268<int>.MyClass269<int>.MyStruct270<int>.MyClass271<int>.MyStruct272<int>.MyClass273<int>.MyStruct274<int>.MyClass275<int>.MyStruct276<int>.MyClass277<int>.MyStruct278<int>.MyClass279<int>.MyStruct280<int>.MyClass281<int>.MyStruct282<int>.MyClass283<int>.MyStruct284<int>.MyClass285<int>.MyStruct286<int>.MyClass287<int>.MyStruct288<int>.MyClass289<int>.MyStruct290<int>.MyClass291<int>.MyStruct292<int>.MyClass293<int>.MyStruct294<int>.MyClass295<int>.MyStruct296<int>.MyClass297<int>.MyStruct298<int>.MyClass299<int>.MyStruct300<int>.MyClass301<int>.MyStruct302<int>.MyClass303<int>.MyStruct304<int>.MyClass305<int>.MyStruct306<int>.MyClass307<int>.MyStruct308<int>.MyClass309<int>.MyStruct310<int>.MyClass311<int>.MyStruct312<int>.MyClass313<int>.MyStruct314<int>.MyClass315<int>.MyStruct316<int>.MyClass317<int>.MyStruct318<int>.MyClass319<int>.MyStruct320<int>.MyClass321<int>.MyStruct322<int>.MyClass323<int>.MyStruct324<int>.MyClass325<int>.MyStruct326<int>.MyClass327<int>.MyStruct328<int>.MyClass329<int>.MyStruct330<int>.MyClass331<int>.MyStruct332<int>.MyClass333<int>.MyStruct334<int>.MyClass335<int>.MyStruct336<int>.MyClass337<int>.MyStruct338<int>.MyClass339<int>.MyStruct340<int>.MyClass341<int>.MyStruct342<int>.MyClass343<int>.MyStruct344<int>.MyClass345<int>.MyStruct346<int>.MyClass347<int>.MyStruct348<int>.MyClass349<int>.MyStruct350<int>.MyClass351<int>.MyStruct352<int>.MyClass353<int>.MyStruct354<int>.MyClass355<int>.MyStruct356<int>.MyClass357<int>.MyStruct358<int>.MyClass359<int>.MyStruct360<int>.MyClass361<int>.MyStruct362<int>.MyClass363<int>.MyStruct364<int>.MyClass365<int>.MyStruct366<int>.MyClass367<int>.MyStruct368<int>.MyClass369<int>.MyStruct370<int>.MyClass371<int>.MyStruct372<int>.MyClass373<int>.MyStruct374<int>.MyClass375<int>.MyStruct376<int>.MyClass377<int>.MyStruct378<int>.MyClass379<int>.MyStruct380<int>.MyClass381<int>.MyStruct382<int>.MyClass383<int>.MyStruct384<int>.MyClass385<int>.MyStruct386<int>.MyClass387<int>.MyStruct388<int>.MyClass389<int>.MyStruct390<int>.MyClass391<int>.MyStruct392<int>.MyClass393<int>.MyStruct394<int>.MyClass395<int>.MyStruct396<int>.MyClass397<int>.MyStruct398<int>.MyClass399<int>.MyStruct400<int>.MyClass401<int>.MyStruct402<int>.MyClass403<int>.MyStruct404<int>.MyClass405<int>.MyStruct406<int>.MyClass407<int>.MyStruct408<int>.MyClass409<int>.MyStruct410<int>.MyClass411<int>.MyStruct412<int>.MyClass413<int>.MyStruct414<int>.MyClass415<int>.MyStruct416<int>.MyClass417<int>.MyStruct418<int>.MyClass419<int>.MyStruct420<int>.MyClass421<int>.MyStruct422<int>.MyClass423<int>.MyStruct424<int>.MyClass425<int>.MyStruct426<int>.MyClass427<int>.MyStruct428<int>.MyClass429<int>.MyStruct430<int>.MyClass431<int>.MyStruct432<int>.MyClass433<int>.MyStruct434<int>.MyClass435<int>.MyStruct436<int>.MyClass437<int>.MyStruct438<int>.MyClass439<int>.MyStruct440<int>.MyClass441<int>.MyStruct442<int>.MyClass443<int>.MyStruct444<int>.MyClass445<int>.MyStruct446<int>.MyClass447<int>.MyStruct448<int>.MyClass449<int>.MyStruct450<int>.MyClass451<int>.MyStruct452<int>.MyClass453<int>.MyStruct454<int>.MyClass455<int>.MyStruct456<int>.MyClass457<int>.MyStruct458<int>.MyClass459<int>.MyStruct460<int>.MyClass461<int>.MyStruct462<int>.MyClass463<int>.MyStruct464<int>.MyClass465<int>.MyStruct466<int>.MyClass467<int>.MyStruct468<int>.MyClass469<int>.MyStruct470<int>.MyClass471<int>.MyStruct472<int>.MyClass473<int>.MyStruct474<int>.MyClass475<int>.MyStruct476<int>.MyClass477<int>.MyStruct478<int>.MyClass479<int>.MyStruct480<int>.MyClass481<int>.MyStruct482<int>.MyClass483<int>.MyStruct484<int>.MyClass485<int>.MyStruct486<int>.MyClass487<int>.MyStruct488<int>.MyClass489<int>.MyStruct490<int>.MyClass491<int>.MyStruct492<int>.MyClass493<int>.MyStruct494<int>.MyClass495<int>.MyStruct496<int>.MyClass497<int>.MyStruct498<int>.MyClass499<int> obj = new MyStruct0<int>.MyClass1<int>.MyStruct2<int>.MyClass3<int>.MyStruct4<int>.MyClass5<int>.MyStruct6<int>.MyClass7<int>.MyStruct8<int>.MyClass9<int>.MyStruct10<int>.MyClass11<int>.MyStruct12<int>.MyClass13<int>.MyStruct14<int>.MyClass15<int>.MyStruct16<int>.MyClass17<int>.MyStruct18<int>.MyClass19<int>.MyStruct20<int>.MyClass21<int>.MyStruct22<int>.MyClass23<int>.MyStruct24<int>.MyClass25<int>.MyStruct26<int>.MyClass27<int>.MyStruct28<int>.MyClass29<int>.MyStruct30<int>.MyClass31<int>.MyStruct32<int>.MyClass33<int>.MyStruct34<int>.MyClass35<int>.MyStruct36<int>.MyClass37<int>.MyStruct38<int>.MyClass39<int>.MyStruct40<int>.MyClass41<int>.MyStruct42<int>.MyClass43<int>.MyStruct44<int>.MyClass45<int>.MyStruct46<int>.MyClass47<int>.MyStruct48<int>.MyClass49<int>.MyStruct50<int>.MyClass51<int>.MyStruct52<int>.MyClass53<int>.MyStruct54<int>.MyClass55<int>.MyStruct56<int>.MyClass57<int>.MyStruct58<int>.MyClass59<int>.MyStruct60<int>.MyClass61<int>.MyStruct62<int>.MyClass63<int>.MyStruct64<int>.MyClass65<int>.MyStruct66<int>.MyClass67<int>.MyStruct68<int>.MyClass69<int>.MyStruct70<int>.MyClass71<int>.MyStruct72<int>.MyClass73<int>.MyStruct74<int>.MyClass75<int>.MyStruct76<int>.MyClass77<int>.MyStruct78<int>.MyClass79<int>.MyStruct80<int>.MyClass81<int>.MyStruct82<int>.MyClass83<int>.MyStruct84<int>.MyClass85<int>.MyStruct86<int>.MyClass87<int>.MyStruct88<int>.MyClass89<int>.MyStruct90<int>.MyClass91<int>.MyStruct92<int>.MyClass93<int>.MyStruct94<int>.MyClass95<int>.MyStruct96<int>.MyClass97<int>.MyStruct98<int>.MyClass99<int>.MyStruct100<int>.MyClass101<int>.MyStruct102<int>.MyClass103<int>.MyStruct104<int>.MyClass105<int>.MyStruct106<int>.MyClass107<int>.MyStruct108<int>.MyClass109<int>.MyStruct110<int>.MyClass111<int>.MyStruct112<int>.MyClass113<int>.MyStruct114<int>.MyClass115<int>.MyStruct116<int>.MyClass117<int>.MyStruct118<int>.MyClass119<int>.MyStruct120<int>.MyClass121<int>.MyStruct122<int>.MyClass123<int>.MyStruct124<int>.MyClass125<int>.MyStruct126<int>.MyClass127<int>.MyStruct128<int>.MyClass129<int>.MyStruct130<int>.MyClass131<int>.MyStruct132<int>.MyClass133<int>.MyStruct134<int>.MyClass135<int>.MyStruct136<int>.MyClass137<int>.MyStruct138<int>.MyClass139<int>.MyStruct140<int>.MyClass141<int>.MyStruct142<int>.MyClass143<int>.MyStruct144<int>.MyClass145<int>.MyStruct146<int>.MyClass147<int>.MyStruct148<int>.MyClass149<int>.MyStruct150<int>.MyClass151<int>.MyStruct152<int>.MyClass153<int>.MyStruct154<int>.MyClass155<int>.MyStruct156<int>.MyClass157<int>.MyStruct158<int>.MyClass159<int>.MyStruct160<int>.MyClass161<int>.MyStruct162<int>.MyClass163<int>.MyStruct164<int>.MyClass165<int>.MyStruct166<int>.MyClass167<int>.MyStruct168<int>.MyClass169<int>.MyStruct170<int>.MyClass171<int>.MyStruct172<int>.MyClass173<int>.MyStruct174<int>.MyClass175<int>.MyStruct176<int>.MyClass177<int>.MyStruct178<int>.MyClass179<int>.MyStruct180<int>.MyClass181<int>.MyStruct182<int>.MyClass183<int>.MyStruct184<int>.MyClass185<int>.MyStruct186<int>.MyClass187<int>.MyStruct188<int>.MyClass189<int>.MyStruct190<int>.MyClass191<int>.MyStruct192<int>.MyClass193<int>.MyStruct194<int>.MyClass195<int>.MyStruct196<int>.MyClass197<int>.MyStruct198<int>.MyClass199<int>.MyStruct200<int>.MyClass201<int>.MyStruct202<int>.MyClass203<int>.MyStruct204<int>.MyClass205<int>.MyStruct206<int>.MyClass207<int>.MyStruct208<int>.MyClass209<int>.MyStruct210<int>.MyClass211<int>.MyStruct212<int>.MyClass213<int>.MyStruct214<int>.MyClass215<int>.MyStruct216<int>.MyClass217<int>.MyStruct218<int>.MyClass219<int>.MyStruct220<int>.MyClass221<int>.MyStruct222<int>.MyClass223<int>.MyStruct224<int>.MyClass225<int>.MyStruct226<int>.MyClass227<int>.MyStruct228<int>.MyClass229<int>.MyStruct230<int>.MyClass231<int>.MyStruct232<int>.MyClass233<int>.MyStruct234<int>.MyClass235<int>.MyStruct236<int>.MyClass237<int>.MyStruct238<int>.MyClass239<int>.MyStruct240<int>.MyClass241<int>.MyStruct242<int>.MyClass243<int>.MyStruct244<int>.MyClass245<int>.MyStruct246<int>.MyClass247<int>.MyStruct248<int>.MyClass249<int>.MyStruct250<int>.MyClass251<int>.MyStruct252<int>.MyClass253<int>.MyStruct254<int>.MyClass255<int>.MyStruct256<int>.MyClass257<int>.MyStruct258<int>.MyClass259<int>.MyStruct260<int>.MyClass261<int>.MyStruct262<int>.MyClass263<int>.MyStruct264<int>.MyClass265<int>.MyStruct266<int>.MyClass267<int>.MyStruct268<int>.MyClass269<int>.MyStruct270<int>.MyClass271<int>.MyStruct272<int>.MyClass273<int>.MyStruct274<int>.MyClass275<int>.MyStruct276<int>.MyClass277<int>.MyStruct278<int>.MyClass279<int>.MyStruct280<int>.MyClass281<int>.MyStruct282<int>.MyClass283<int>.MyStruct284<int>.MyClass285<int>.MyStruct286<int>.MyClass287<int>.MyStruct288<int>.MyClass289<int>.MyStruct290<int>.MyClass291<int>.MyStruct292<int>.MyClass293<int>.MyStruct294<int>.MyClass295<int>.MyStruct296<int>.MyClass297<int>.MyStruct298<int>.MyClass299<int>.MyStruct300<int>.MyClass301<int>.MyStruct302<int>.MyClass303<int>.MyStruct304<int>.MyClass305<int>.MyStruct306<int>.MyClass307<int>.MyStruct308<int>.MyClass309<int>.MyStruct310<int>.MyClass311<int>.MyStruct312<int>.MyClass313<int>.MyStruct314<int>.MyClass315<int>.MyStruct316<int>.MyClass317<int>.MyStruct318<int>.MyClass319<int>.MyStruct320<int>.MyClass321<int>.MyStruct322<int>.MyClass323<int>.MyStruct324<int>.MyClass325<int>.MyStruct326<int>.MyClass327<int>.MyStruct328<int>.MyClass329<int>.MyStruct330<int>.MyClass331<int>.MyStruct332<int>.MyClass333<int>.MyStruct334<int>.MyClass335<int>.MyStruct336<int>.MyClass337<int>.MyStruct338<int>.MyClass339<int>.MyStruct340<int>.MyClass341<int>.MyStruct342<int>.MyClass343<int>.MyStruct344<int>.MyClass345<int>.MyStruct346<int>.MyClass347<int>.MyStruct348<int>.MyClass349<int>.MyStruct350<int>.MyClass351<int>.MyStruct352<int>.MyClass353<int>.MyStruct354<int>.MyClass355<int>.MyStruct356<int>.MyClass357<int>.MyStruct358<int>.MyClass359<int>.MyStruct360<int>.MyClass361<int>.MyStruct362<int>.MyClass363<int>.MyStruct364<int>.MyClass365<int>.MyStruct366<int>.MyClass367<int>.MyStruct368<int>.MyClass369<int>.MyStruct370<int>.MyClass371<int>.MyStruct372<int>.MyClass373<int>.MyStruct374<int>.MyClass375<int>.MyStruct376<int>.MyClass377<int>.MyStruct378<int>.MyClass379<int>.MyStruct380<int>.MyClass381<int>.MyStruct382<int>.MyClass383<int>.MyStruct384<int>.MyClass385<int>.MyStruct386<int>.MyClass387<int>.MyStruct388<int>.MyClass389<int>.MyStruct390<int>.MyClass391<int>.MyStruct392<int>.MyClass393<int>.MyStruct394<int>.MyClass395<int>.MyStruct396<int>.MyClass397<int>.MyStruct398<int>.MyClass399<int>.MyStruct400<int>.MyClass401<int>.MyStruct402<int>.MyClass403<int>.MyStruct404<int>.MyClass405<int>.MyStruct406<int>.MyClass407<int>.MyStruct408<int>.MyClass409<int>.MyStruct410<int>.MyClass411<int>.MyStruct412<int>.MyClass413<int>.MyStruct414<int>.MyClass415<int>.MyStruct416<int>.MyClass417<int>.MyStruct418<int>.MyClass419<int>.MyStruct420<int>.MyClass421<int>.MyStruct422<int>.MyClass423<int>.MyStruct424<int>.MyClass425<int>.MyStruct426<int>.MyClass427<int>.MyStruct428<int>.MyClass429<int>.MyStruct430<int>.MyClass431<int>.MyStruct432<int>.MyClass433<int>.MyStruct434<int>.MyClass435<int>.MyStruct436<int>.MyClass437<int>.MyStruct438<int>.MyClass439<int>.MyStruct440<int>.MyClass441<int>.MyStruct442<int>.MyClass443<int>.MyStruct444<int>.MyClass445<int>.MyStruct446<int>.MyClass447<int>.MyStruct448<int>.MyClass449<int>.MyStruct450<int>.MyClass451<int>.MyStruct452<int>.MyClass453<int>.MyStruct454<int>.MyClass455<int>.MyStruct456<int>.MyClass457<int>.MyStruct458<int>.MyClass459<int>.MyStruct460<int>.MyClass461<int>.MyStruct462<int>.MyClass463<int>.MyStruct464<int>.MyClass465<int>.MyStruct466<int>.MyClass467<int>.MyStruct468<int>.MyClass469<int>.MyStruct470<int>.MyClass471<int>.MyStruct472<int>.MyClass473<int>.MyStruct474<int>.MyClass475<int>.MyStruct476<int>.MyClass477<int>.MyStruct478<int>.MyClass479<int>.MyStruct480<int>.MyClass481<int>.MyStruct482<int>.MyClass483<int>.MyStruct484<int>.MyClass485<int>.MyStruct486<int>.MyClass487<int>.MyStruct488<int>.MyClass489<int>.MyStruct490<int>.MyClass491<int>.MyStruct492<int>.MyClass493<int>.MyStruct494<int>.MyClass495<int>.MyStruct496<int>.MyClass497<int>.MyStruct498<int>.MyClass499<int>(); Console.WriteLine("PASS"); return 100; } } public struct MyStruct0<T0> { public class MyClass1<T1> { public struct MyStruct2<T2> { public class MyClass3<T3> { public struct MyStruct4<T4> { public class MyClass5<T5> { public struct MyStruct6<T6> { public class MyClass7<T7> { public struct MyStruct8<T8> { public class MyClass9<T9> { public struct MyStruct10<T10> { public class MyClass11<T11> { public struct MyStruct12<T12> { public class MyClass13<T13> { public struct MyStruct14<T14> { public class MyClass15<T15> { public struct MyStruct16<T16> { public class MyClass17<T17> { public struct MyStruct18<T18> { public class MyClass19<T19> { public struct MyStruct20<T20> { public class MyClass21<T21> { public struct MyStruct22<T22> { public class MyClass23<T23> { public struct MyStruct24<T24> { public class MyClass25<T25> { public struct MyStruct26<T26> { public class MyClass27<T27> { public struct MyStruct28<T28> { public class MyClass29<T29> { public struct MyStruct30<T30> { public class MyClass31<T31> { public struct MyStruct32<T32> { public class MyClass33<T33> { public struct MyStruct34<T34> { public class MyClass35<T35> { public struct MyStruct36<T36> { public class MyClass37<T37> { public struct MyStruct38<T38> { public class MyClass39<T39> { public struct MyStruct40<T40> { public class MyClass41<T41> { public struct MyStruct42<T42> { public class MyClass43<T43> { public struct MyStruct44<T44> { public class MyClass45<T45> { public struct MyStruct46<T46> { public class MyClass47<T47> { public struct MyStruct48<T48> { public class MyClass49<T49> { public struct MyStruct50<T50> { public class MyClass51<T51> { public struct MyStruct52<T52> { public class MyClass53<T53> { public struct MyStruct54<T54> { public class MyClass55<T55> { public struct MyStruct56<T56> { public class MyClass57<T57> { public struct MyStruct58<T58> { public class MyClass59<T59> { public struct MyStruct60<T60> { public class MyClass61<T61> { public struct MyStruct62<T62> { public class MyClass63<T63> { public struct MyStruct64<T64> { public class MyClass65<T65> { public struct MyStruct66<T66> { public class MyClass67<T67> { public struct MyStruct68<T68> { public class MyClass69<T69> { public struct MyStruct70<T70> { public class MyClass71<T71> { public struct MyStruct72<T72> { public class MyClass73<T73> { public struct MyStruct74<T74> { public class MyClass75<T75> { public struct MyStruct76<T76> { public class MyClass77<T77> { public struct MyStruct78<T78> { public class MyClass79<T79> { public struct MyStruct80<T80> { public class MyClass81<T81> { public struct MyStruct82<T82> { public class MyClass83<T83> { public struct MyStruct84<T84> { public class MyClass85<T85> { public struct MyStruct86<T86> { public class MyClass87<T87> { public struct MyStruct88<T88> { public class MyClass89<T89> { public struct MyStruct90<T90> { public class MyClass91<T91> { public struct MyStruct92<T92> { public class MyClass93<T93> { public struct MyStruct94<T94> { public class MyClass95<T95> { public struct MyStruct96<T96> { public class MyClass97<T97> { public struct MyStruct98<T98> { public class MyClass99<T99> { public struct MyStruct100<T100> { public class MyClass101<T101> { public struct MyStruct102<T102> { public class MyClass103<T103> { public struct MyStruct104<T104> { public class MyClass105<T105> { public struct MyStruct106<T106> { public class MyClass107<T107> { public struct MyStruct108<T108> { public class MyClass109<T109> { public struct MyStruct110<T110> { public class MyClass111<T111> { public struct MyStruct112<T112> { public class MyClass113<T113> { public struct MyStruct114<T114> { public class MyClass115<T115> { public struct MyStruct116<T116> { public class MyClass117<T117> { public struct MyStruct118<T118> { public class MyClass119<T119> { public struct MyStruct120<T120> { public class MyClass121<T121> { public struct MyStruct122<T122> { public class MyClass123<T123> { public struct MyStruct124<T124> { public class MyClass125<T125> { public struct MyStruct126<T126> { public class MyClass127<T127> { public struct MyStruct128<T128> { public class MyClass129<T129> { public struct MyStruct130<T130> { public class MyClass131<T131> { public struct MyStruct132<T132> { public class MyClass133<T133> { public struct MyStruct134<T134> { public class MyClass135<T135> { public struct MyStruct136<T136> { public class MyClass137<T137> { public struct MyStruct138<T138> { public class MyClass139<T139> { public struct MyStruct140<T140> { public class MyClass141<T141> { public struct MyStruct142<T142> { public class MyClass143<T143> { public struct MyStruct144<T144> { public class MyClass145<T145> { public struct MyStruct146<T146> { public class MyClass147<T147> { public struct MyStruct148<T148> { public class MyClass149<T149> { public struct MyStruct150<T150> { public class MyClass151<T151> { public struct MyStruct152<T152> { public class MyClass153<T153> { public struct MyStruct154<T154> { public class MyClass155<T155> { public struct MyStruct156<T156> { public class MyClass157<T157> { public struct MyStruct158<T158> { public class MyClass159<T159> { public struct MyStruct160<T160> { public class MyClass161<T161> { public struct MyStruct162<T162> { public class MyClass163<T163> { public struct MyStruct164<T164> { public class MyClass165<T165> { public struct MyStruct166<T166> { public class MyClass167<T167> { public struct MyStruct168<T168> { public class MyClass169<T169> { public struct MyStruct170<T170> { public class MyClass171<T171> { public struct MyStruct172<T172> { public class MyClass173<T173> { public struct MyStruct174<T174> { public class MyClass175<T175> { public struct MyStruct176<T176> { public class MyClass177<T177> { public struct MyStruct178<T178> { public class MyClass179<T179> { public struct MyStruct180<T180> { public class MyClass181<T181> { public struct MyStruct182<T182> { public class MyClass183<T183> { public struct MyStruct184<T184> { public class MyClass185<T185> { public struct MyStruct186<T186> { public class MyClass187<T187> { public struct MyStruct188<T188> { public class MyClass189<T189> { public struct MyStruct190<T190> { public class MyClass191<T191> { public struct MyStruct192<T192> { public class MyClass193<T193> { public struct MyStruct194<T194> { public class MyClass195<T195> { public struct MyStruct196<T196> { public class MyClass197<T197> { public struct MyStruct198<T198> { public class MyClass199<T199> { public struct MyStruct200<T200> { public class MyClass201<T201> { public struct MyStruct202<T202> { public class MyClass203<T203> { public struct MyStruct204<T204> { public class MyClass205<T205> { public struct MyStruct206<T206> { public class MyClass207<T207> { public struct MyStruct208<T208> { public class MyClass209<T209> { public struct MyStruct210<T210> { public class MyClass211<T211> { public struct MyStruct212<T212> { public class MyClass213<T213> { public struct MyStruct214<T214> { public class MyClass215<T215> { public struct MyStruct216<T216> { public class MyClass217<T217> { public struct MyStruct218<T218> { public class MyClass219<T219> { public struct MyStruct220<T220> { public class MyClass221<T221> { public struct MyStruct222<T222> { public class MyClass223<T223> { public struct MyStruct224<T224> { public class MyClass225<T225> { public struct MyStruct226<T226> { public class MyClass227<T227> { public struct MyStruct228<T228> { public class MyClass229<T229> { public struct MyStruct230<T230> { public class MyClass231<T231> { public struct MyStruct232<T232> { public class MyClass233<T233> { public struct MyStruct234<T234> { public class MyClass235<T235> { public struct MyStruct236<T236> { public class MyClass237<T237> { public struct MyStruct238<T238> { public class MyClass239<T239> { public struct MyStruct240<T240> { public class MyClass241<T241> { public struct MyStruct242<T242> { public class MyClass243<T243> { public struct MyStruct244<T244> { public class MyClass245<T245> { public struct MyStruct246<T246> { public class MyClass247<T247> { public struct MyStruct248<T248> { public class MyClass249<T249> { public struct MyStruct250<T250> { public class MyClass251<T251> { public struct MyStruct252<T252> { public class MyClass253<T253> { public struct MyStruct254<T254> { public class MyClass255<T255> { public struct MyStruct256<T256> { public class MyClass257<T257> { public struct MyStruct258<T258> { public class MyClass259<T259> { public struct MyStruct260<T260> { public class MyClass261<T261> { public struct MyStruct262<T262> { public class MyClass263<T263> { public struct MyStruct264<T264> { public class MyClass265<T265> { public struct MyStruct266<T266> { public class MyClass267<T267> { public struct MyStruct268<T268> { public class MyClass269<T269> { public struct MyStruct270<T270> { public class MyClass271<T271> { public struct MyStruct272<T272> { public class MyClass273<T273> { public struct MyStruct274<T274> { public class MyClass275<T275> { public struct MyStruct276<T276> { public class MyClass277<T277> { public struct MyStruct278<T278> { public class MyClass279<T279> { public struct MyStruct280<T280> { public class MyClass281<T281> { public struct MyStruct282<T282> { public class MyClass283<T283> { public struct MyStruct284<T284> { public class MyClass285<T285> { public struct MyStruct286<T286> { public class MyClass287<T287> { public struct MyStruct288<T288> { public class MyClass289<T289> { public struct MyStruct290<T290> { public class MyClass291<T291> { public struct MyStruct292<T292> { public class MyClass293<T293> { public struct MyStruct294<T294> { public class MyClass295<T295> { public struct MyStruct296<T296> { public class MyClass297<T297> { public struct MyStruct298<T298> { public class MyClass299<T299> { public struct MyStruct300<T300> { public class MyClass301<T301> { public struct MyStruct302<T302> { public class MyClass303<T303> { public struct MyStruct304<T304> { public class MyClass305<T305> { public struct MyStruct306<T306> { public class MyClass307<T307> { public struct MyStruct308<T308> { public class MyClass309<T309> { public struct MyStruct310<T310> { public class MyClass311<T311> { public struct MyStruct312<T312> { public class MyClass313<T313> { public struct MyStruct314<T314> { public class MyClass315<T315> { public struct MyStruct316<T316> { public class MyClass317<T317> { public struct MyStruct318<T318> { public class MyClass319<T319> { public struct MyStruct320<T320> { public class MyClass321<T321> { public struct MyStruct322<T322> { public class MyClass323<T323> { public struct MyStruct324<T324> { public class MyClass325<T325> { public struct MyStruct326<T326> { public class MyClass327<T327> { public struct MyStruct328<T328> { public class MyClass329<T329> { public struct MyStruct330<T330> { public class MyClass331<T331> { public struct MyStruct332<T332> { public class MyClass333<T333> { public struct MyStruct334<T334> { public class MyClass335<T335> { public struct MyStruct336<T336> { public class MyClass337<T337> { public struct MyStruct338<T338> { public class MyClass339<T339> { public struct MyStruct340<T340> { public class MyClass341<T341> { public struct MyStruct342<T342> { public class MyClass343<T343> { public struct MyStruct344<T344> { public class MyClass345<T345> { public struct MyStruct346<T346> { public class MyClass347<T347> { public struct MyStruct348<T348> { public class MyClass349<T349> { public struct MyStruct350<T350> { public class MyClass351<T351> { public struct MyStruct352<T352> { public class MyClass353<T353> { public struct MyStruct354<T354> { public class MyClass355<T355> { public struct MyStruct356<T356> { public class MyClass357<T357> { public struct MyStruct358<T358> { public class MyClass359<T359> { public struct MyStruct360<T360> { public class MyClass361<T361> { public struct MyStruct362<T362> { public class MyClass363<T363> { public struct MyStruct364<T364> { public class MyClass365<T365> { public struct MyStruct366<T366> { public class MyClass367<T367> { public struct MyStruct368<T368> { public class MyClass369<T369> { public struct MyStruct370<T370> { public class MyClass371<T371> { public struct MyStruct372<T372> { public class MyClass373<T373> { public struct MyStruct374<T374> { public class MyClass375<T375> { public struct MyStruct376<T376> { public class MyClass377<T377> { public struct MyStruct378<T378> { public class MyClass379<T379> { public struct MyStruct380<T380> { public class MyClass381<T381> { public struct MyStruct382<T382> { public class MyClass383<T383> { public struct MyStruct384<T384> { public class MyClass385<T385> { public struct MyStruct386<T386> { public class MyClass387<T387> { public struct MyStruct388<T388> { public class MyClass389<T389> { public struct MyStruct390<T390> { public class MyClass391<T391> { public struct MyStruct392<T392> { public class MyClass393<T393> { public struct MyStruct394<T394> { public class MyClass395<T395> { public struct MyStruct396<T396> { public class MyClass397<T397> { public struct MyStruct398<T398> { public class MyClass399<T399> { public struct MyStruct400<T400> { public class MyClass401<T401> { public struct MyStruct402<T402> { public class MyClass403<T403> { public struct MyStruct404<T404> { public class MyClass405<T405> { public struct MyStruct406<T406> { public class MyClass407<T407> { public struct MyStruct408<T408> { public class MyClass409<T409> { public struct MyStruct410<T410> { public class MyClass411<T411> { public struct MyStruct412<T412> { public class MyClass413<T413> { public struct MyStruct414<T414> { public class MyClass415<T415> { public struct MyStruct416<T416> { public class MyClass417<T417> { public struct MyStruct418<T418> { public class MyClass419<T419> { public struct MyStruct420<T420> { public class MyClass421<T421> { public struct MyStruct422<T422> { public class MyClass423<T423> { public struct MyStruct424<T424> { public class MyClass425<T425> { public struct MyStruct426<T426> { public class MyClass427<T427> { public struct MyStruct428<T428> { public class MyClass429<T429> { public struct MyStruct430<T430> { public class MyClass431<T431> { public struct MyStruct432<T432> { public class MyClass433<T433> { public struct MyStruct434<T434> { public class MyClass435<T435> { public struct MyStruct436<T436> { public class MyClass437<T437> { public struct MyStruct438<T438> { public class MyClass439<T439> { public struct MyStruct440<T440> { public class MyClass441<T441> { public struct MyStruct442<T442> { public class MyClass443<T443> { public struct MyStruct444<T444> { public class MyClass445<T445> { public struct MyStruct446<T446> { public class MyClass447<T447> { public struct MyStruct448<T448> { public class MyClass449<T449> { public struct MyStruct450<T450> { public class MyClass451<T451> { public struct MyStruct452<T452> { public class MyClass453<T453> { public struct MyStruct454<T454> { public class MyClass455<T455> { public struct MyStruct456<T456> { public class MyClass457<T457> { public struct MyStruct458<T458> { public class MyClass459<T459> { public struct MyStruct460<T460> { public class MyClass461<T461> { public struct MyStruct462<T462> { public class MyClass463<T463> { public struct MyStruct464<T464> { public class MyClass465<T465> { public struct MyStruct466<T466> { public class MyClass467<T467> { public struct MyStruct468<T468> { public class MyClass469<T469> { public struct MyStruct470<T470> { public class MyClass471<T471> { public struct MyStruct472<T472> { public class MyClass473<T473> { public struct MyStruct474<T474> { public class MyClass475<T475> { public struct MyStruct476<T476> { public class MyClass477<T477> { public struct MyStruct478<T478> { public class MyClass479<T479> { public struct MyStruct480<T480> { public class MyClass481<T481> { public struct MyStruct482<T482> { public class MyClass483<T483> { public struct MyStruct484<T484> { public class MyClass485<T485> { public struct MyStruct486<T486> { public class MyClass487<T487> { public struct MyStruct488<T488> { public class MyClass489<T489> { public struct MyStruct490<T490> { public class MyClass491<T491> { public struct MyStruct492<T492> { public class MyClass493<T493> { public struct MyStruct494<T494> { public class MyClass495<T495> { public struct MyStruct496<T496> { public class MyClass497<T497> { public struct MyStruct498<T498> { public class MyClass499<T499> { } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/tests/JIT/HardwareIntrinsics/X86/Sse41/RoundToZeroScalar.Single.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; namespace JIT.HardwareIntrinsics.X86 { public static partial class Program { private static void RoundToZeroScalarSingle() { var test = new SimpleBinaryOpTest__RoundToZeroScalarSingle(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (Sse.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); // Validates basic functionality works, using LoadAligned test.RunBasicScenario_LoadAligned(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (Sse.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); // Validates calling via reflection works, using LoadAligned test.RunReflectionScenario_LoadAligned(); } // Validates passing a static member works test.RunClsVarScenario(); if (Sse.IsSupported) { // Validates passing a static member works, using pinning and Load test.RunClsVarScenario_Load(); } // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (Sse.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); // Validates passing a local works, using LoadAligned test.RunLclVarScenario_LoadAligned(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); if (Sse.IsSupported) { // Validates passing the field of a local class works, using pinning and Load test.RunClassLclFldScenario_Load(); } // Validates passing an instance member of a class works test.RunClassFldScenario(); if (Sse.IsSupported) { // Validates passing an instance member of a class works, using pinning and Load test.RunClassFldScenario_Load(); } // Validates passing the field of a local struct works test.RunStructLclFldScenario(); if (Sse.IsSupported) { // Validates passing the field of a local struct works, using pinning and Load test.RunStructLclFldScenario_Load(); } // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (Sse.IsSupported) { // Validates passing an instance member of a struct works, using pinning and Load test.RunStructFldScenario_Load(); } } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class SimpleBinaryOpTest__RoundToZeroScalarSingle { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; private ulong alignment; public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Single>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Single>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>(); if ((alignment != 32 && alignment != 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Single, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Single, byte>(ref inArray2[0]), (uint)sizeOfinArray2); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector128<Single> _fld1; public Vector128<Single> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref testStruct._fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); return testStruct; } public void RunStructFldScenario(SimpleBinaryOpTest__RoundToZeroScalarSingle testClass) { var result = Sse41.RoundToZeroScalar(_fld1, _fld2); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } public void RunStructFldScenario_Load(SimpleBinaryOpTest__RoundToZeroScalarSingle testClass) { fixed (Vector128<Single>* pFld1 = &_fld1) fixed (Vector128<Single>* pFld2 = &_fld2) { var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(pFld1)), Sse.LoadVector128((Single*)(pFld2)) ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } } private static readonly int LargestVectorSize = 16; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single); private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single); private static Single[] _data1 = new Single[Op1ElementCount]; private static Single[] _data2 = new Single[Op2ElementCount]; private static Vector128<Single> _clsVar1; private static Vector128<Single> _clsVar2; private Vector128<Single> _fld1; private Vector128<Single> _fld2; private DataTable _dataTable; static SimpleBinaryOpTest__RoundToZeroScalarSingle() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); } public SimpleBinaryOpTest__RoundToZeroScalarSingle() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); } public bool IsSupported => Sse41.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = Sse41.RoundToZeroScalar( Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)), Sse.LoadVector128((Single*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_LoadAligned() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_LoadAligned)); var result = Sse41.RoundToZeroScalar( Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)), Sse.LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(Sse41).GetMethod(nameof(Sse41.RoundToZeroScalar), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>) }) .Invoke(null, new object[] { Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(Sse41).GetMethod(nameof(Sse41.RoundToZeroScalar), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>) }) .Invoke(null, new object[] { Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)), Sse.LoadVector128((Single*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_LoadAligned() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_LoadAligned)); var result = typeof(Sse41).GetMethod(nameof(Sse41.RoundToZeroScalar), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>) }) .Invoke(null, new object[] { Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)), Sse.LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = Sse41.RoundToZeroScalar( _clsVar1, _clsVar2 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunClsVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); fixed (Vector128<Single>* pClsVar1 = &_clsVar1) fixed (Vector128<Single>* pClsVar2 = &_clsVar2) { var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(pClsVar1)), Sse.LoadVector128((Single*)(pClsVar2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr); var result = Sse41.RoundToZeroScalar(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var op1 = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)); var op2 = Sse.LoadVector128((Single*)(_dataTable.inArray2Ptr)); var result = Sse41.RoundToZeroScalar(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunLclVarScenario_LoadAligned() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_LoadAligned)); var op1 = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)); var op2 = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)); var result = Sse41.RoundToZeroScalar(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new SimpleBinaryOpTest__RoundToZeroScalarSingle(); var result = Sse41.RoundToZeroScalar(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); var test = new SimpleBinaryOpTest__RoundToZeroScalarSingle(); fixed (Vector128<Single>* pFld1 = &test._fld1) fixed (Vector128<Single>* pFld2 = &test._fld2) { var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(pFld1)), Sse.LoadVector128((Single*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = Sse41.RoundToZeroScalar(_fld1, _fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); fixed (Vector128<Single>* pFld1 = &_fld1) fixed (Vector128<Single>* pFld2 = &_fld2) { var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(pFld1)), Sse.LoadVector128((Single*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = Sse41.RoundToZeroScalar(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); var test = TestStruct.Create(); var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(&test._fld1)), Sse.LoadVector128((Single*)(&test._fld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunStructFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); var test = TestStruct.Create(); test.RunStructFldScenario_Load(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult(Vector128<Single> op1, Vector128<Single> op2, void* result, [CallerMemberName] string method = "") { Single[] inArray1 = new Single[Op1ElementCount]; Single[] inArray2 = new Single[Op2ElementCount]; Single[] outArray = new Single[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), op2); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") { Single[] inArray1 = new Single[Op1ElementCount]; Single[] inArray2 = new Single[Op2ElementCount]; Single[] outArray = new Single[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Single>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Single>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") { bool succeeded = true; if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits((right[0] > 0) ? MathF.Floor(right[0]) : MathF.Ceiling(right[0]))) { succeeded = false; } else { for (var i = 1; i < RetElementCount; i++) { if (BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])) { succeeded = false; break; } } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(Sse41)}.{nameof(Sse41.RoundToZeroScalar)}<Single>(Vector128<Single>, Vector128<Single>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; namespace JIT.HardwareIntrinsics.X86 { public static partial class Program { private static void RoundToZeroScalarSingle() { var test = new SimpleBinaryOpTest__RoundToZeroScalarSingle(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (Sse.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); // Validates basic functionality works, using LoadAligned test.RunBasicScenario_LoadAligned(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (Sse.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); // Validates calling via reflection works, using LoadAligned test.RunReflectionScenario_LoadAligned(); } // Validates passing a static member works test.RunClsVarScenario(); if (Sse.IsSupported) { // Validates passing a static member works, using pinning and Load test.RunClsVarScenario_Load(); } // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (Sse.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); // Validates passing a local works, using LoadAligned test.RunLclVarScenario_LoadAligned(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); if (Sse.IsSupported) { // Validates passing the field of a local class works, using pinning and Load test.RunClassLclFldScenario_Load(); } // Validates passing an instance member of a class works test.RunClassFldScenario(); if (Sse.IsSupported) { // Validates passing an instance member of a class works, using pinning and Load test.RunClassFldScenario_Load(); } // Validates passing the field of a local struct works test.RunStructLclFldScenario(); if (Sse.IsSupported) { // Validates passing the field of a local struct works, using pinning and Load test.RunStructLclFldScenario_Load(); } // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (Sse.IsSupported) { // Validates passing an instance member of a struct works, using pinning and Load test.RunStructFldScenario_Load(); } } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class SimpleBinaryOpTest__RoundToZeroScalarSingle { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; private ulong alignment; public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Single>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Single>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>(); if ((alignment != 32 && alignment != 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Single, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Single, byte>(ref inArray2[0]), (uint)sizeOfinArray2); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector128<Single> _fld1; public Vector128<Single> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref testStruct._fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); return testStruct; } public void RunStructFldScenario(SimpleBinaryOpTest__RoundToZeroScalarSingle testClass) { var result = Sse41.RoundToZeroScalar(_fld1, _fld2); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } public void RunStructFldScenario_Load(SimpleBinaryOpTest__RoundToZeroScalarSingle testClass) { fixed (Vector128<Single>* pFld1 = &_fld1) fixed (Vector128<Single>* pFld2 = &_fld2) { var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(pFld1)), Sse.LoadVector128((Single*)(pFld2)) ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } } private static readonly int LargestVectorSize = 16; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single); private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Single>>() / sizeof(Single); private static Single[] _data1 = new Single[Op1ElementCount]; private static Single[] _data2 = new Single[Op2ElementCount]; private static Vector128<Single> _clsVar1; private static Vector128<Single> _clsVar2; private Vector128<Single> _fld1; private Vector128<Single> _fld2; private DataTable _dataTable; static SimpleBinaryOpTest__RoundToZeroScalarSingle() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); } public SimpleBinaryOpTest__RoundToZeroScalarSingle() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Single>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } _dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize); } public bool IsSupported => Sse41.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = Sse41.RoundToZeroScalar( Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)), Sse.LoadVector128((Single*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_LoadAligned() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_LoadAligned)); var result = Sse41.RoundToZeroScalar( Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)), Sse.LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(Sse41).GetMethod(nameof(Sse41.RoundToZeroScalar), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>) }) .Invoke(null, new object[] { Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(Sse41).GetMethod(nameof(Sse41.RoundToZeroScalar), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>) }) .Invoke(null, new object[] { Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)), Sse.LoadVector128((Single*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_LoadAligned() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_LoadAligned)); var result = typeof(Sse41).GetMethod(nameof(Sse41.RoundToZeroScalar), new Type[] { typeof(Vector128<Single>), typeof(Vector128<Single>) }) .Invoke(null, new object[] { Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)), Sse.LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Single>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = Sse41.RoundToZeroScalar( _clsVar1, _clsVar2 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunClsVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); fixed (Vector128<Single>* pClsVar1 = &_clsVar1) fixed (Vector128<Single>* pClsVar2 = &_clsVar2) { var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(pClsVar1)), Sse.LoadVector128((Single*)(pClsVar2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector128<Single>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector128<Single>>(_dataTable.inArray2Ptr); var result = Sse41.RoundToZeroScalar(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var op1 = Sse.LoadVector128((Single*)(_dataTable.inArray1Ptr)); var op2 = Sse.LoadVector128((Single*)(_dataTable.inArray2Ptr)); var result = Sse41.RoundToZeroScalar(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunLclVarScenario_LoadAligned() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_LoadAligned)); var op1 = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray1Ptr)); var op2 = Sse.LoadAlignedVector128((Single*)(_dataTable.inArray2Ptr)); var result = Sse41.RoundToZeroScalar(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new SimpleBinaryOpTest__RoundToZeroScalarSingle(); var result = Sse41.RoundToZeroScalar(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); var test = new SimpleBinaryOpTest__RoundToZeroScalarSingle(); fixed (Vector128<Single>* pFld1 = &test._fld1) fixed (Vector128<Single>* pFld2 = &test._fld2) { var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(pFld1)), Sse.LoadVector128((Single*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = Sse41.RoundToZeroScalar(_fld1, _fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); fixed (Vector128<Single>* pFld1 = &_fld1) fixed (Vector128<Single>* pFld2 = &_fld2) { var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(pFld1)), Sse.LoadVector128((Single*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = Sse41.RoundToZeroScalar(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); var test = TestStruct.Create(); var result = Sse41.RoundToZeroScalar( Sse.LoadVector128((Single*)(&test._fld1)), Sse.LoadVector128((Single*)(&test._fld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunStructFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); var test = TestStruct.Create(); test.RunStructFldScenario_Load(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult(Vector128<Single> op1, Vector128<Single> op2, void* result, [CallerMemberName] string method = "") { Single[] inArray1 = new Single[Op1ElementCount]; Single[] inArray2 = new Single[Op2ElementCount]; Single[] outArray = new Single[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), op2); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") { Single[] inArray1 = new Single[Op1ElementCount]; Single[] inArray2 = new Single[Op2ElementCount]; Single[] outArray = new Single[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Single>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Single>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Single>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "") { bool succeeded = true; if (BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits((right[0] > 0) ? MathF.Floor(right[0]) : MathF.Ceiling(right[0]))) { succeeded = false; } else { for (var i = 1; i < RetElementCount; i++) { if (BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])) { succeeded = false; break; } } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(Sse41)}.{nameof(Sse41.RoundToZeroScalar)}<Single>(Vector128<Single>, Vector128<Single>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Private.CoreLib/src/System/Environment.SpecialFolderOption.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System { public static partial class Environment { public enum SpecialFolderOption { None = 0, Create = SpecialFolderOptionValues.CSIDL_FLAG_CREATE, DoNotVerify = SpecialFolderOptionValues.CSIDL_FLAG_DONT_VERIFY, } // These values are specific to Windows and are known to SHGetFolderPath, however they are // also the values used in the SpecialFolderOption enum. As such, we keep them as constants // with their Win32 names, but keep them here rather than in Interop.Kernel32 as they're // used on all platforms. private static class SpecialFolderOptionValues { /// <summary> /// Force folder creation in SHGetFolderPath. Equivalent of KF_FLAG_CREATE (0x00008000). /// </summary> internal const int CSIDL_FLAG_CREATE = 0x8000; /// <summary> /// Return an unverified folder path. Equivalent of KF_FLAG_DONT_VERIFY (0x00004000). /// </summary> internal const int CSIDL_FLAG_DONT_VERIFY = 0x4000; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System { public static partial class Environment { public enum SpecialFolderOption { None = 0, Create = SpecialFolderOptionValues.CSIDL_FLAG_CREATE, DoNotVerify = SpecialFolderOptionValues.CSIDL_FLAG_DONT_VERIFY, } // These values are specific to Windows and are known to SHGetFolderPath, however they are // also the values used in the SpecialFolderOption enum. As such, we keep them as constants // with their Win32 names, but keep them here rather than in Interop.Kernel32 as they're // used on all platforms. private static class SpecialFolderOptionValues { /// <summary> /// Force folder creation in SHGetFolderPath. Equivalent of KF_FLAG_CREATE (0x00008000). /// </summary> internal const int CSIDL_FLAG_CREATE = 0x8000; /// <summary> /// Return an unverified folder path. Equivalent of KF_FLAG_DONT_VERIFY (0x00004000). /// </summary> internal const int CSIDL_FLAG_DONT_VERIFY = 0x4000; } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/MultiplyWideningLowerAndAdd.Vector64.Int16.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.Arm; namespace JIT.HardwareIntrinsics.Arm { public static partial class Program { private static void MultiplyWideningLowerAndAdd_Vector64_Int16() { var test = new SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); } // Validates passing a static member works test.RunClsVarScenario(); if (AdvSimd.IsSupported) { // Validates passing a static member works, using pinning and Load test.RunClsVarScenario_Load(); } // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local class works, using pinning and Load test.RunClassLclFldScenario_Load(); } // Validates passing an instance member of a class works test.RunClassFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a class works, using pinning and Load test.RunClassFldScenario_Load(); } // Validates passing the field of a local struct works test.RunStructLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local struct works, using pinning and Load test.RunStructLclFldScenario_Load(); } // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a struct works, using pinning and Load test.RunStructFldScenario_Load(); } } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16 { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] inArray3; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle inHandle3; private GCHandle outHandle; private ulong alignment; public DataTable(Int32[] inArray1, Int16[] inArray2, Int16[] inArray3, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int16>(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int16>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>(); if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.inArray3 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int16, byte>(ref inArray2[0]), (uint)sizeOfinArray2); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int16, byte>(ref inArray3[0]), (uint)sizeOfinArray3); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); inHandle3.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector128<Int32> _fld1; public Vector64<Int16> _fld2; public Vector64<Int16> _fld3; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref testStruct._fld2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref testStruct._fld3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); return testStruct; } public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16 testClass) { var result = AdvSimd.MultiplyWideningLowerAndAdd(_fld1, _fld2, _fld3); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); } public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16 testClass) { fixed (Vector128<Int32>* pFld1 = &_fld1) fixed (Vector64<Int16>* pFld2 = &_fld2) fixed (Vector64<Int16>* pFld3 = &_fld3) { var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(pFld1)), AdvSimd.LoadVector64((Int16*)(pFld2)), AdvSimd.LoadVector64((Int16*)(pFld3)) ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); } } } private static readonly int LargestVectorSize = 16; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int16>>() / sizeof(Int16); private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<Int16>>() / sizeof(Int16); private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32); private static Int32[] _data1 = new Int32[Op1ElementCount]; private static Int16[] _data2 = new Int16[Op2ElementCount]; private static Int16[] _data3 = new Int16[Op3ElementCount]; private static Vector128<Int32> _clsVar1; private static Vector64<Int16> _clsVar2; private static Vector64<Int16> _clsVar3; private Vector128<Int32> _fld1; private Vector64<Int16> _fld2; private Vector64<Int16> _fld3; private DataTable _dataTable; static SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _clsVar2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _clsVar3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); } public SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _fld2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _fld3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); } public bool IsSupported => AdvSimd.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = AdvSimd.MultiplyWideningLowerAndAdd( Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<Int16>>(_dataTable.inArray2Ptr), Unsafe.Read<Vector64<Int16>>(_dataTable.inArray3Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyWideningLowerAndAdd), new Type[] { typeof(Vector128<Int32>), typeof(Vector64<Int16>), typeof(Vector64<Int16>) }) .Invoke(null, new object[] { Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<Int16>>(_dataTable.inArray2Ptr), Unsafe.Read<Vector64<Int16>>(_dataTable.inArray3Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyWideningLowerAndAdd), new Type[] { typeof(Vector128<Int32>), typeof(Vector64<Int16>), typeof(Vector64<Int16>) }) .Invoke(null, new object[] { AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = AdvSimd.MultiplyWideningLowerAndAdd( _clsVar1, _clsVar2, _clsVar3 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); } public void RunClsVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); fixed (Vector128<Int32>* pClsVar1 = &_clsVar1) fixed (Vector64<Int16>* pClsVar2 = &_clsVar2) fixed (Vector64<Int16>* pClsVar3 = &_clsVar3) { var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(pClsVar1)), AdvSimd.LoadVector64((Int16*)(pClsVar2)), AdvSimd.LoadVector64((Int16*)(pClsVar3)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); } } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector64<Int16>>(_dataTable.inArray2Ptr); var op3 = Unsafe.Read<Vector64<Int16>>(_dataTable.inArray3Ptr); var result = AdvSimd.MultiplyWideningLowerAndAdd(op1, op2, op3); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); var result = AdvSimd.MultiplyWideningLowerAndAdd(op1, op2, op3); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16(); var result = AdvSimd.MultiplyWideningLowerAndAdd(test._fld1, test._fld2, test._fld3); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); } public void RunClassLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); var test = new SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16(); fixed (Vector128<Int32>* pFld1 = &test._fld1) fixed (Vector64<Int16>* pFld2 = &test._fld2) fixed (Vector64<Int16>* pFld3 = &test._fld3) { var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(pFld1)), AdvSimd.LoadVector64((Int16*)(pFld2)), AdvSimd.LoadVector64((Int16*)(pFld3)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); } } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = AdvSimd.MultiplyWideningLowerAndAdd(_fld1, _fld2, _fld3); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); } public void RunClassFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); fixed (Vector128<Int32>* pFld1 = &_fld1) fixed (Vector64<Int16>* pFld2 = &_fld2) fixed (Vector64<Int16>* pFld3 = &_fld3) { var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(pFld1)), AdvSimd.LoadVector64((Int16*)(pFld2)), AdvSimd.LoadVector64((Int16*)(pFld3)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); } } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = AdvSimd.MultiplyWideningLowerAndAdd(test._fld1, test._fld2, test._fld3); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); } public void RunStructLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); var test = TestStruct.Create(); var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(&test._fld1)), AdvSimd.LoadVector64((Int16*)(&test._fld2)), AdvSimd.LoadVector64((Int16*)(&test._fld3)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunStructFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); var test = TestStruct.Create(); test.RunStructFldScenario_Load(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult(Vector128<Int32> op1, Vector64<Int16> op2, Vector64<Int16> op3, void* result, [CallerMemberName] string method = "") { Int32[] inArray1 = new Int32[Op1ElementCount]; Int16[] inArray2 = new Int16[Op2ElementCount]; Int16[] inArray3 = new Int16[Op3ElementCount]; Int32[] outArray = new Int32[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref inArray2[0]), op2); Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref inArray3[0]), op3); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>()); ValidateResult(inArray1, inArray2, inArray3, outArray, method); } private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") { Int32[] inArray1 = new Int32[Op1ElementCount]; Int16[] inArray2 = new Int16[Op2ElementCount]; Int16[] inArray3 = new Int16[Op3ElementCount]; Int32[] outArray = new Int32[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Int32>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int16>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<Int16>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>()); ValidateResult(inArray1, inArray2, inArray3, outArray, method); } private void ValidateResult(Int32[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int32[] result, [CallerMemberName] string method = "") { bool succeeded = true; for (var i = 0; i < RetElementCount; i++) { if (Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) { succeeded = false; break; } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyWideningLowerAndAdd)}<Int32>(Vector128<Int32>, Vector64<Int16>, Vector64<Int16>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.Arm; namespace JIT.HardwareIntrinsics.Arm { public static partial class Program { private static void MultiplyWideningLowerAndAdd_Vector64_Int16() { var test = new SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); } // Validates passing a static member works test.RunClsVarScenario(); if (AdvSimd.IsSupported) { // Validates passing a static member works, using pinning and Load test.RunClsVarScenario_Load(); } // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local class works, using pinning and Load test.RunClassLclFldScenario_Load(); } // Validates passing an instance member of a class works test.RunClassFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a class works, using pinning and Load test.RunClassFldScenario_Load(); } // Validates passing the field of a local struct works test.RunStructLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local struct works, using pinning and Load test.RunStructLclFldScenario_Load(); } // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a struct works, using pinning and Load test.RunStructFldScenario_Load(); } } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16 { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] inArray3; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle inHandle3; private GCHandle outHandle; private ulong alignment; public DataTable(Int32[] inArray1, Int16[] inArray2, Int16[] inArray3, Int32[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int16>(); int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int16>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>(); if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.inArray3 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int16, byte>(ref inArray2[0]), (uint)sizeOfinArray2); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int16, byte>(ref inArray3[0]), (uint)sizeOfinArray3); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); inHandle3.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector128<Int32> _fld1; public Vector64<Int16> _fld2; public Vector64<Int16> _fld3; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref testStruct._fld2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref testStruct._fld3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); return testStruct; } public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16 testClass) { var result = AdvSimd.MultiplyWideningLowerAndAdd(_fld1, _fld2, _fld3); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); } public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16 testClass) { fixed (Vector128<Int32>* pFld1 = &_fld1) fixed (Vector64<Int16>* pFld2 = &_fld2) fixed (Vector64<Int16>* pFld3 = &_fld3) { var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(pFld1)), AdvSimd.LoadVector64((Int16*)(pFld2)), AdvSimd.LoadVector64((Int16*)(pFld3)) ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr); } } } private static readonly int LargestVectorSize = 16; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int16>>() / sizeof(Int16); private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector64<Int16>>() / sizeof(Int16); private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32); private static Int32[] _data1 = new Int32[Op1ElementCount]; private static Int16[] _data2 = new Int16[Op2ElementCount]; private static Int16[] _data3 = new Int16[Op3ElementCount]; private static Vector128<Int32> _clsVar1; private static Vector64<Int16> _clsVar2; private static Vector64<Int16> _clsVar3; private Vector128<Int32> _fld1; private Vector64<Int16> _fld2; private Vector64<Int16> _fld3; private DataTable _dataTable; static SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _clsVar2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _clsVar3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); } public SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _fld2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int16>, byte>(ref _fld3), ref Unsafe.As<Int16, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector64<Int16>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt16(); } _dataTable = new DataTable(_data1, _data2, _data3, new Int32[RetElementCount], LargestVectorSize); } public bool IsSupported => AdvSimd.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = AdvSimd.MultiplyWideningLowerAndAdd( Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<Int16>>(_dataTable.inArray2Ptr), Unsafe.Read<Vector64<Int16>>(_dataTable.inArray3Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyWideningLowerAndAdd), new Type[] { typeof(Vector128<Int32>), typeof(Vector64<Int16>), typeof(Vector64<Int16>) }) .Invoke(null, new object[] { Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<Int16>>(_dataTable.inArray2Ptr), Unsafe.Read<Vector64<Int16>>(_dataTable.inArray3Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.MultiplyWideningLowerAndAdd), new Type[] { typeof(Vector128<Int32>), typeof(Vector64<Int16>), typeof(Vector64<Int16>) }) .Invoke(null, new object[] { AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)), AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = AdvSimd.MultiplyWideningLowerAndAdd( _clsVar1, _clsVar2, _clsVar3 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); } public void RunClsVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); fixed (Vector128<Int32>* pClsVar1 = &_clsVar1) fixed (Vector64<Int16>* pClsVar2 = &_clsVar2) fixed (Vector64<Int16>* pClsVar3 = &_clsVar3) { var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(pClsVar1)), AdvSimd.LoadVector64((Int16*)(pClsVar2)), AdvSimd.LoadVector64((Int16*)(pClsVar3)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr); } } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector64<Int16>>(_dataTable.inArray2Ptr); var op3 = Unsafe.Read<Vector64<Int16>>(_dataTable.inArray3Ptr); var result = AdvSimd.MultiplyWideningLowerAndAdd(op1, op2, op3); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr)); var op2 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray2Ptr)); var op3 = AdvSimd.LoadVector64((Int16*)(_dataTable.inArray3Ptr)); var result = AdvSimd.MultiplyWideningLowerAndAdd(op1, op2, op3); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, op3, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16(); var result = AdvSimd.MultiplyWideningLowerAndAdd(test._fld1, test._fld2, test._fld3); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); } public void RunClassLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); var test = new SimpleTernaryOpTest__MultiplyWideningLowerAndAdd_Vector64_Int16(); fixed (Vector128<Int32>* pFld1 = &test._fld1) fixed (Vector64<Int16>* pFld2 = &test._fld2) fixed (Vector64<Int16>* pFld3 = &test._fld3) { var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(pFld1)), AdvSimd.LoadVector64((Int16*)(pFld2)), AdvSimd.LoadVector64((Int16*)(pFld3)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); } } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = AdvSimd.MultiplyWideningLowerAndAdd(_fld1, _fld2, _fld3); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); } public void RunClassFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); fixed (Vector128<Int32>* pFld1 = &_fld1) fixed (Vector64<Int16>* pFld2 = &_fld2) fixed (Vector64<Int16>* pFld3 = &_fld3) { var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(pFld1)), AdvSimd.LoadVector64((Int16*)(pFld2)), AdvSimd.LoadVector64((Int16*)(pFld3)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr); } } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = AdvSimd.MultiplyWideningLowerAndAdd(test._fld1, test._fld2, test._fld3); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); } public void RunStructLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); var test = TestStruct.Create(); var result = AdvSimd.MultiplyWideningLowerAndAdd( AdvSimd.LoadVector128((Int32*)(&test._fld1)), AdvSimd.LoadVector64((Int16*)(&test._fld2)), AdvSimd.LoadVector64((Int16*)(&test._fld3)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunStructFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); var test = TestStruct.Create(); test.RunStructFldScenario_Load(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult(Vector128<Int32> op1, Vector64<Int16> op2, Vector64<Int16> op3, void* result, [CallerMemberName] string method = "") { Int32[] inArray1 = new Int32[Op1ElementCount]; Int16[] inArray2 = new Int16[Op2ElementCount]; Int16[] inArray3 = new Int16[Op3ElementCount]; Int32[] outArray = new Int32[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref inArray2[0]), op2); Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref inArray3[0]), op3); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>()); ValidateResult(inArray1, inArray2, inArray3, outArray, method); } private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "") { Int32[] inArray1 = new Int32[Op1ElementCount]; Int16[] inArray2 = new Int16[Op2ElementCount]; Int16[] inArray3 = new Int16[Op3ElementCount]; Int32[] outArray = new Int32[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Int32>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int16>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int16, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector64<Int16>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>()); ValidateResult(inArray1, inArray2, inArray3, outArray, method); } private void ValidateResult(Int32[] firstOp, Int16[] secondOp, Int16[] thirdOp, Int32[] result, [CallerMemberName] string method = "") { bool succeeded = true; for (var i = 0; i < RetElementCount; i++) { if (Helpers.MultiplyWideningAndAdd(firstOp[i], secondOp[i], thirdOp[i]) != result[i]) { succeeded = false; break; } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.MultiplyWideningLowerAndAdd)}<Int32>(Vector128<Int32>, Vector64<Int16>, Vector64<Int16>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})"); TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})"); TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Runtime/tests/System/CharTests.GenericMath.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.Versioning; using Xunit; namespace System.Tests { [RequiresPreviewFeaturesAttribute] public class CharTests_GenericMath { [Fact] public static void AdditiveIdentityTest() { Assert.Equal((char)0x0000, AdditiveIdentityHelper<char, char>.AdditiveIdentity); } [Fact] public static void MinValueTest() { Assert.Equal((char)0x0000, MinMaxValueHelper<char>.MinValue); } [Fact] public static void MaxValueTest() { Assert.Equal((char)0xFFFF, MinMaxValueHelper<char>.MaxValue); } [Fact] public static void MultiplicativeIdentityTest() { Assert.Equal((char)0x0001, MultiplicativeIdentityHelper<char, char>.MultiplicativeIdentity); } [Fact] public static void OneTest() { Assert.Equal((char)0x0001, NumberHelper<char>.One); } [Fact] public static void ZeroTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Zero); } [Fact] public static void op_AdditionTest() { Assert.Equal((char)0x0001, AdditionOperatorsHelper<char, char, char>.op_Addition((char)0x0000, (char)1)); Assert.Equal((char)0x0002, AdditionOperatorsHelper<char, char, char>.op_Addition((char)0x0001, (char)1)); Assert.Equal((char)0x8000, AdditionOperatorsHelper<char, char, char>.op_Addition((char)0x7FFF, (char)1)); Assert.Equal((char)0x8001, AdditionOperatorsHelper<char, char, char>.op_Addition((char)0x8000, (char)1)); Assert.Equal((char)0x0000, AdditionOperatorsHelper<char, char, char>.op_Addition((char)0xFFFF, (char)1)); } [Fact] public static void LeadingZeroCountTest() { Assert.Equal((char)0x0010, BinaryIntegerHelper<char>.LeadingZeroCount((char)0x0000)); Assert.Equal((char)0x000F, BinaryIntegerHelper<char>.LeadingZeroCount((char)0x0001)); Assert.Equal((char)0x0001, BinaryIntegerHelper<char>.LeadingZeroCount((char)0x7FFF)); Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.LeadingZeroCount((char)0x8000)); Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.LeadingZeroCount((char)0xFFFF)); } [Fact] public static void PopCountTest() { Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.PopCount((char)0x0000)); Assert.Equal((char)0x0001, BinaryIntegerHelper<char>.PopCount((char)0x0001)); Assert.Equal((char)0x000F, BinaryIntegerHelper<char>.PopCount((char)0x7FFF)); Assert.Equal((char)0x0001, BinaryIntegerHelper<char>.PopCount((char)0x8000)); Assert.Equal((char)0x0010, BinaryIntegerHelper<char>.PopCount((char)0xFFFF)); } [Fact] public static void RotateLeftTest() { Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.RotateLeft((char)0x0000, 1)); Assert.Equal((char)0x0002, BinaryIntegerHelper<char>.RotateLeft((char)0x0001, 1)); Assert.Equal((char)0xFFFE, BinaryIntegerHelper<char>.RotateLeft((char)0x7FFF, 1)); Assert.Equal((char)0x0001, BinaryIntegerHelper<char>.RotateLeft((char)0x8000, 1)); Assert.Equal((char)0xFFFF, BinaryIntegerHelper<char>.RotateLeft((char)0xFFFF, 1)); } [Fact] public static void RotateRightTest() { Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.RotateRight((char)0x0000, 1)); Assert.Equal((char)0x8000, BinaryIntegerHelper<char>.RotateRight((char)0x0001, 1)); Assert.Equal((char)0xBFFF, BinaryIntegerHelper<char>.RotateRight((char)0x7FFF, 1)); Assert.Equal((char)0x4000, BinaryIntegerHelper<char>.RotateRight((char)0x8000, 1)); Assert.Equal((char)0xFFFF, BinaryIntegerHelper<char>.RotateRight((char)0xFFFF, 1)); } [Fact] public static void TrailingZeroCountTest() { Assert.Equal((char)0x0010, BinaryIntegerHelper<char>.TrailingZeroCount((char)0x0000)); Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.TrailingZeroCount((char)0x0001)); Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.TrailingZeroCount((char)0x7FFF)); Assert.Equal((char)0x000F, BinaryIntegerHelper<char>.TrailingZeroCount((char)0x8000)); Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.TrailingZeroCount((char)0xFFFF)); } [Fact] public static void IsPow2Test() { Assert.False(BinaryNumberHelper<char>.IsPow2((char)0x0000)); Assert.True(BinaryNumberHelper<char>.IsPow2((char)0x0001)); Assert.False(BinaryNumberHelper<char>.IsPow2((char)0x7FFF)); Assert.True(BinaryNumberHelper<char>.IsPow2((char)0x8000)); Assert.False(BinaryNumberHelper<char>.IsPow2((char)0xFFFF)); } [Fact] public static void Log2Test() { Assert.Equal((char)0x0000, BinaryNumberHelper<char>.Log2((char)0x0000)); Assert.Equal((char)0x0000, BinaryNumberHelper<char>.Log2((char)0x0001)); Assert.Equal((char)0x000E, BinaryNumberHelper<char>.Log2((char)0x7FFF)); Assert.Equal((char)0x000F, BinaryNumberHelper<char>.Log2((char)0x8000)); Assert.Equal((char)0x000F, BinaryNumberHelper<char>.Log2((char)0xFFFF)); } [Fact] public static void op_BitwiseAndTest() { Assert.Equal((char)0x0000, BitwiseOperatorsHelper<char, char, char>.op_BitwiseAnd((char)0x0000, (char)1)); Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseAnd((char)0x0001, (char)1)); Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseAnd((char)0x7FFF, (char)1)); Assert.Equal((char)0x0000, BitwiseOperatorsHelper<char, char, char>.op_BitwiseAnd((char)0x8000, (char)1)); Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseAnd((char)0xFFFF, (char)1)); } [Fact] public static void op_BitwiseOrTest() { Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseOr((char)0x0000, (char)1)); Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseOr((char)0x0001, (char)1)); Assert.Equal((char)0x7FFF, BitwiseOperatorsHelper<char, char, char>.op_BitwiseOr((char)0x7FFF, (char)1)); Assert.Equal((char)0x8001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseOr((char)0x8000, (char)1)); Assert.Equal((char)0xFFFF, BitwiseOperatorsHelper<char, char, char>.op_BitwiseOr((char)0xFFFF, (char)1)); } [Fact] public static void op_ExclusiveOrTest() { Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_ExclusiveOr((char)0x0000, (char)1)); Assert.Equal((char)0x0000, BitwiseOperatorsHelper<char, char, char>.op_ExclusiveOr((char)0x0001, (char)1)); Assert.Equal((char)0x7FFE, BitwiseOperatorsHelper<char, char, char>.op_ExclusiveOr((char)0x7FFF, (char)1)); Assert.Equal((char)0x8001, BitwiseOperatorsHelper<char, char, char>.op_ExclusiveOr((char)0x8000, (char)1)); Assert.Equal((char)0xFFFE, BitwiseOperatorsHelper<char, char, char>.op_ExclusiveOr((char)0xFFFF, (char)1)); } [Fact] public static void op_OnesComplementTest() { Assert.Equal((char)0xFFFF, BitwiseOperatorsHelper<char, char, char>.op_OnesComplement((char)0x0000)); Assert.Equal((char)0xFFFE, BitwiseOperatorsHelper<char, char, char>.op_OnesComplement((char)0x0001)); Assert.Equal((char)0x8000, BitwiseOperatorsHelper<char, char, char>.op_OnesComplement((char)0x7FFF)); Assert.Equal((char)0x7FFF, BitwiseOperatorsHelper<char, char, char>.op_OnesComplement((char)0x8000)); Assert.Equal((char)0x0000, BitwiseOperatorsHelper<char, char, char>.op_OnesComplement((char)0xFFFF)); } [Fact] public static void op_LessThanTest() { Assert.True(ComparisonOperatorsHelper<char, char>.op_LessThan((char)0x0000, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThan((char)0x0001, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThan((char)0x7FFF, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThan((char)0x8000, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThan((char)0xFFFF, (char)1)); } [Fact] public static void op_LessThanOrEqualTest() { Assert.True(ComparisonOperatorsHelper<char, char>.op_LessThanOrEqual((char)0x0000, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_LessThanOrEqual((char)0x0001, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThanOrEqual((char)0x7FFF, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThanOrEqual((char)0x8000, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThanOrEqual((char)0xFFFF, (char)1)); } [Fact] public static void op_GreaterThanTest() { Assert.False(ComparisonOperatorsHelper<char, char>.op_GreaterThan((char)0x0000, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_GreaterThan((char)0x0001, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThan((char)0x7FFF, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThan((char)0x8000, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThan((char)0xFFFF, (char)1)); } [Fact] public static void op_GreaterThanOrEqualTest() { Assert.False(ComparisonOperatorsHelper<char, char>.op_GreaterThanOrEqual((char)0x0000, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThanOrEqual((char)0x0001, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThanOrEqual((char)0x7FFF, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThanOrEqual((char)0x8000, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThanOrEqual((char)0xFFFF, (char)1)); } [Fact] public static void op_DecrementTest() { Assert.Equal((char)0xFFFF, DecrementOperatorsHelper<char>.op_Decrement((char)0x0000)); Assert.Equal((char)0x0000, DecrementOperatorsHelper<char>.op_Decrement((char)0x0001)); Assert.Equal((char)0x7FFE, DecrementOperatorsHelper<char>.op_Decrement((char)0x7FFF)); Assert.Equal((char)0x7FFF, DecrementOperatorsHelper<char>.op_Decrement((char)0x8000)); Assert.Equal((char)0xFFFE, DecrementOperatorsHelper<char>.op_Decrement((char)0xFFFF)); } [Fact] public static void op_DivisionTest() { Assert.Equal((char)0x0000, DivisionOperatorsHelper<char, char, char>.op_Division((char)0x0000, (char)2)); Assert.Equal((char)0x0000, DivisionOperatorsHelper<char, char, char>.op_Division((char)0x0001, (char)2)); Assert.Equal((char)0x3FFF, DivisionOperatorsHelper<char, char, char>.op_Division((char)0x7FFF, (char)2)); Assert.Equal((char)0x4000, DivisionOperatorsHelper<char, char, char>.op_Division((char)0x8000, (char)2)); Assert.Equal((char)0x7FFF, DivisionOperatorsHelper<char, char, char>.op_Division((char)0xFFFF, (char)2)); } [Fact] public static void op_EqualityTest() { Assert.False(EqualityOperatorsHelper<char, char>.op_Equality((char)0x0000, (char)1)); Assert.True(EqualityOperatorsHelper<char, char>.op_Equality((char)0x0001, (char)1)); Assert.False(EqualityOperatorsHelper<char, char>.op_Equality((char)0x7FFF, (char)1)); Assert.False(EqualityOperatorsHelper<char, char>.op_Equality((char)0x8000, (char)1)); Assert.False(EqualityOperatorsHelper<char, char>.op_Equality((char)0xFFFF, (char)1)); } [Fact] public static void op_InequalityTest() { Assert.True(EqualityOperatorsHelper<char, char>.op_Inequality((char)0x0000, (char)1)); Assert.False(EqualityOperatorsHelper<char, char>.op_Inequality((char)0x0001, (char)1)); Assert.True(EqualityOperatorsHelper<char, char>.op_Inequality((char)0x7FFF, (char)1)); Assert.True(EqualityOperatorsHelper<char, char>.op_Inequality((char)0x8000, (char)1)); Assert.True(EqualityOperatorsHelper<char, char>.op_Inequality((char)0xFFFF, (char)1)); } [Fact] public static void op_IncrementTest() { Assert.Equal((char)0x0001, IncrementOperatorsHelper<char>.op_Increment((char)0x0000)); Assert.Equal((char)0x0002, IncrementOperatorsHelper<char>.op_Increment((char)0x0001)); Assert.Equal((char)0x8000, IncrementOperatorsHelper<char>.op_Increment((char)0x7FFF)); Assert.Equal((char)0x8001, IncrementOperatorsHelper<char>.op_Increment((char)0x8000)); Assert.Equal((char)0x0000, IncrementOperatorsHelper<char>.op_Increment((char)0xFFFF)); } [Fact] public static void op_ModulusTest() { Assert.Equal((char)0x0000, ModulusOperatorsHelper<char, char, char>.op_Modulus((char)0x0000, (char)2)); Assert.Equal((char)0x0001, ModulusOperatorsHelper<char, char, char>.op_Modulus((char)0x0001, (char)2)); Assert.Equal((char)0x0001, ModulusOperatorsHelper<char, char, char>.op_Modulus((char)0x7FFF, (char)2)); Assert.Equal((char)0x0000, ModulusOperatorsHelper<char, char, char>.op_Modulus((char)0x8000, (char)2)); Assert.Equal((char)0x0001, ModulusOperatorsHelper<char, char, char>.op_Modulus((char)0xFFFF, (char)2)); } [Fact] public static void op_MultiplyTest() { Assert.Equal((char)0x0000, MultiplyOperatorsHelper<char, char, char>.op_Multiply((char)0x0000, (char)2)); Assert.Equal((char)0x0002, MultiplyOperatorsHelper<char, char, char>.op_Multiply((char)0x0001, (char)2)); Assert.Equal((char)0xFFFE, MultiplyOperatorsHelper<char, char, char>.op_Multiply((char)0x7FFF, (char)2)); Assert.Equal((char)0x0000, MultiplyOperatorsHelper<char, char, char>.op_Multiply((char)0x8000, (char)2)); Assert.Equal((char)0xFFFE, MultiplyOperatorsHelper<char, char, char>.op_Multiply((char)0xFFFF, (char)2)); } [Fact] public static void AbsTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Abs((char)0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.Abs((char)0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.Abs((char)0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.Abs((char)0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.Abs((char)0xFFFF)); } [Fact] public static void ClampTest() { Assert.Equal((char)0x0001, NumberHelper<char>.Clamp((char)0x0000, (char)0x0001, (char)0x003F)); Assert.Equal((char)0x0001, NumberHelper<char>.Clamp((char)0x0001, (char)0x0001, (char)0x003F)); Assert.Equal((char)0x003F, NumberHelper<char>.Clamp((char)0x7FFF, (char)0x0001, (char)0x003F)); Assert.Equal((char)0x003F, NumberHelper<char>.Clamp((char)0x8000, (char)0x0001, (char)0x003F)); Assert.Equal((char)0x003F, NumberHelper<char>.Clamp((char)0xFFFF, (char)0x0001, (char)0x003F)); } [Fact] public static void CreateFromByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<byte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<byte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.Create<byte>(0x7F)); Assert.Equal((char)0x0080, NumberHelper<char>.Create<byte>(0x80)); Assert.Equal((char)0x00FF, NumberHelper<char>.Create<byte>(0xFF)); } [Fact] public static void CreateFromCharTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<char>((char)0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<char>((char)0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.Create<char>((char)0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.Create<char>((char)0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.Create<char>((char)0xFFFF)); } [Fact] public static void CreateFromInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<short>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<short>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.Create<short>(0x7FFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<short>(unchecked((short)0x8000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<short>(unchecked((short)0xFFFF))); } [Fact] public static void CreateFromInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<int>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<int>(0x00000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<int>(0x7FFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<int>(unchecked((int)0x80000000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<int>(unchecked((int)0xFFFFFFFF))); } [Fact] public static void CreateFromInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<long>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<long>(0x0000000000000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<long>(0x7FFFFFFFFFFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<long>(unchecked((long)0x8000000000000000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<long>(unchecked((long)0xFFFFFFFFFFFFFFFF))); } [Fact] public static void CreateFromIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.Create<nint>(unchecked((nint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.Create<nint>(unchecked((nint)0x0000000000000001))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>(unchecked((nint)0x7FFFFFFFFFFFFFFF))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>(unchecked((nint)0x8000000000000000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>(unchecked((nint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.Create<nint>((nint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<nint>((nint)0x00000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>((nint)0x7FFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>(unchecked((nint)0x80000000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>(unchecked((nint)0xFFFFFFFF))); } } [Fact] public static void CreateFromSByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<sbyte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<sbyte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.Create<sbyte>(0x7F)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<sbyte>(unchecked((sbyte)0x80))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<sbyte>(unchecked((sbyte)0xFF))); } [Fact] public static void CreateFromUInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<ushort>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<ushort>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.Create<ushort>(0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.Create<ushort>(0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.Create<ushort>(0xFFFF)); } [Fact] public static void CreateFromUInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<uint>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<uint>(0x00000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<uint>(0x7FFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<uint>(0x80000000)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<uint>(0xFFFFFFFF)); } [Fact] public static void CreateFromUInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<ulong>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<ulong>(0x0000000000000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<ulong>(0x7FFFFFFFFFFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<ulong>(0x8000000000000000)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<ulong>(0xFFFFFFFFFFFFFFFF)); } [Fact] public static void CreateFromUIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.Create<nuint>(unchecked((nuint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.Create<nuint>(unchecked((nuint)0x0000000000000001))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>(unchecked((nuint)0x7FFFFFFFFFFFFFFF))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>(unchecked((nuint)0x8000000000000000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>(unchecked((nuint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.Create<nuint>((nuint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<nuint>((nuint)0x00000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>((nuint)0x7FFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>((nuint)0x80000000)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>((nuint)0xFFFFFFFF)); } } [Fact] public static void CreateSaturatingFromByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<byte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<byte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.CreateSaturating<byte>(0x7F)); Assert.Equal((char)0x0080, NumberHelper<char>.CreateSaturating<byte>(0x80)); Assert.Equal((char)0x00FF, NumberHelper<char>.CreateSaturating<byte>(0xFF)); } [Fact] public static void CreateSaturatingFromCharTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<char>((char)0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<char>((char)0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateSaturating<char>((char)0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.CreateSaturating<char>((char)0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<char>((char)0xFFFF)); } [Fact] public static void CreateSaturatingFromInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<short>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<short>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateSaturating<short>(0x7FFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<short>(unchecked((short)0x8000))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<short>(unchecked((short)0xFFFF))); } [Fact] public static void CreateSaturatingFromInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<int>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<int>(0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<int>(0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<int>(unchecked((int)0x80000000))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<int>(unchecked((int)0xFFFFFFFF))); } [Fact] public static void CreateSaturatingFromInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<long>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<long>(0x0000000000000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<long>(0x7FFFFFFFFFFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<long>(unchecked((long)0x8000000000000000))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<long>(unchecked((long)0xFFFFFFFFFFFFFFFF))); } [Fact] public static void CreateSaturatingFromIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0x0000000000000001))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0x7FFFFFFFFFFFFFFF))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0x8000000000000000))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>((nint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<nint>((nint)0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nint>((nint)0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0x80000000))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0xFFFFFFFF))); } } [Fact] public static void CreateSaturatingFromSByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<sbyte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<sbyte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.CreateSaturating<sbyte>(0x7F)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<sbyte>(unchecked((sbyte)0x80))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<sbyte>(unchecked((sbyte)0xFF))); } [Fact] public static void CreateSaturatingFromUInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<ushort>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<ushort>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateSaturating<ushort>(0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.CreateSaturating<ushort>(0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<ushort>(0xFFFF)); } [Fact] public static void CreateSaturatingFromUInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<uint>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<uint>(0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<uint>(0x7FFFFFFF)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<uint>(0x80000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<uint>(0xFFFFFFFF)); } [Fact] public static void CreateSaturatingFromUInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<ulong>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<ulong>(0x0000000000000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<ulong>(0x7FFFFFFFFFFFFFFF)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<ulong>(0x8000000000000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<ulong>(0xFFFFFFFFFFFFFFFF)); } [Fact] public static void CreateSaturatingFromUIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nuint>(unchecked((nuint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<nuint>(unchecked((nuint)0x0000000000000001))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>(unchecked((nuint)0x7FFFFFFFFFFFFFFF))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>(unchecked((nuint)0x8000000000000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>(unchecked((nuint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nuint>((nuint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<nuint>((nuint)0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>((nuint)0x7FFFFFFF)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>((nuint)0x80000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>((nuint)0xFFFFFFFF)); } } [Fact] public static void CreateTruncatingFromByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<byte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<byte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.CreateTruncating<byte>(0x7F)); Assert.Equal((char)0x0080, NumberHelper<char>.CreateTruncating<byte>(0x80)); Assert.Equal((char)0x00FF, NumberHelper<char>.CreateTruncating<byte>(0xFF)); } [Fact] public static void CreateTruncatingFromCharTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<char>((char)0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<char>((char)0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateTruncating<char>((char)0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.CreateTruncating<char>((char)0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<char>((char)0xFFFF)); } [Fact] public static void CreateTruncatingFromInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<short>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<short>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateTruncating<short>(0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.CreateTruncating<short>(unchecked((short)0x8000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<short>(unchecked((short)0xFFFF))); } [Fact] public static void CreateTruncatingFromInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<int>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<int>(0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<int>(0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<int>(unchecked((int)0x80000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<int>(unchecked((int)0xFFFFFFFF))); } [Fact] public static void CreateTruncatingFromInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<long>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<long>(0x0000000000000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<long>(0x7FFFFFFFFFFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<long>(unchecked((long)0x8000000000000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<long>(unchecked((long)0xFFFFFFFFFFFFFFFF))); } [Fact] public static void CreateTruncatingFromIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0x0000000000000001))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0x7FFFFFFFFFFFFFFF))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0x8000000000000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nint>((nint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<nint>((nint)0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nint>((nint)0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0x80000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0xFFFFFFFF))); } } [Fact] public static void CreateTruncatingFromSByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<sbyte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<sbyte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.CreateTruncating<sbyte>(0x7F)); Assert.Equal((char)0xFF80, NumberHelper<char>.CreateTruncating<sbyte>(unchecked((sbyte)0x80))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<sbyte>(unchecked((sbyte)0xFF))); } [Fact] public static void CreateTruncatingFromUInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<ushort>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<ushort>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateTruncating<ushort>(0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.CreateTruncating<ushort>(0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<ushort>(0xFFFF)); } [Fact] public static void CreateTruncatingFromUInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<uint>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<uint>(0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<uint>(0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<uint>(0x80000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<uint>(0xFFFFFFFF)); } [Fact] public static void CreateTruncatingFromUInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<ulong>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<ulong>(0x0000000000000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<ulong>(0x7FFFFFFFFFFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<ulong>(0x8000000000000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<ulong>(0xFFFFFFFFFFFFFFFF)); } [Fact] public static void CreateTruncatingFromUIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nuint>(unchecked((nuint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<nuint>(unchecked((nuint)0x0000000000000001))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nuint>(unchecked((nuint)0x7FFFFFFFFFFFFFFF))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nuint>(unchecked((nuint)0x8000000000000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nuint>(unchecked((nuint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nuint>((nuint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<nuint>((nuint)0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nuint>((nuint)0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nuint>((nuint)0x80000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nuint>((nuint)0xFFFFFFFF)); } } [Fact] public static void DivRemTest() { Assert.Equal(((char)0x0000, (char)0x0000), NumberHelper<char>.DivRem((char)0x0000, (char)2)); Assert.Equal(((char)0x0000, (char)0x0001), NumberHelper<char>.DivRem((char)0x0001, (char)2)); Assert.Equal(((char)0x3FFF, (char)0x0001), NumberHelper<char>.DivRem((char)0x7FFF, (char)2)); Assert.Equal(((char)0x4000, (char)0x0000), NumberHelper<char>.DivRem((char)0x8000, (char)2)); Assert.Equal(((char)0x7FFF, (char)0x0001), NumberHelper<char>.DivRem((char)0xFFFF, (char)2)); } [Fact] public static void MaxTest() { Assert.Equal((char)0x0001, NumberHelper<char>.Max((char)0x0000, (char)1)); Assert.Equal((char)0x0001, NumberHelper<char>.Max((char)0x0001, (char)1)); Assert.Equal((char)0x7FFF, NumberHelper<char>.Max((char)0x7FFF, (char)1)); Assert.Equal((char)0x8000, NumberHelper<char>.Max((char)0x8000, (char)1)); Assert.Equal((char)0xFFFF, NumberHelper<char>.Max((char)0xFFFF, (char)1)); } [Fact] public static void MinTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Min((char)0x0000, (char)1)); Assert.Equal((char)0x0001, NumberHelper<char>.Min((char)0x0001, (char)1)); Assert.Equal((char)0x0001, NumberHelper<char>.Min((char)0x7FFF, (char)1)); Assert.Equal((char)0x0001, NumberHelper<char>.Min((char)0x8000, (char)1)); Assert.Equal((char)0x0001, NumberHelper<char>.Min((char)0xFFFF, (char)1)); } [Fact] public static void SignTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Sign((char)0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.Sign((char)0x0001)); Assert.Equal((char)0x0001, NumberHelper<char>.Sign((char)0x7FFF)); Assert.Equal((char)0x0001, NumberHelper<char>.Sign((char)0x8000)); Assert.Equal((char)0x0001, NumberHelper<char>.Sign((char)0xFFFF)); } [Fact] public static void TryCreateFromByteTest() { char result; Assert.True(NumberHelper<char>.TryCreate<byte>(0x00, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<byte>(0x01, out result)); Assert.Equal((char)0x0001, result); Assert.True(NumberHelper<char>.TryCreate<byte>(0x7F, out result)); Assert.Equal((char)0x007F, result); Assert.True(NumberHelper<char>.TryCreate<byte>(0x80, out result)); Assert.Equal((char)0x0080, result); Assert.True(NumberHelper<char>.TryCreate<byte>(0xFF, out result)); Assert.Equal((char)0x00FF, result); } [Fact] public static void TryCreateFromCharTest() { char result; Assert.True(NumberHelper<char>.TryCreate<char>((char)0x0000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<char>((char)0x0001, out result)); Assert.Equal((char)0x0001, result); Assert.True(NumberHelper<char>.TryCreate<char>((char)0x7FFF, out result)); Assert.Equal((char)0x7FFF, result); Assert.True(NumberHelper<char>.TryCreate<char>((char)0x8000, out result)); Assert.Equal((char)0x8000, result); Assert.True(NumberHelper<char>.TryCreate<char>((char)0xFFFF, out result)); Assert.Equal((char)0xFFFF, result); } [Fact] public static void TryCreateFromInt16Test() { char result; Assert.True(NumberHelper<char>.TryCreate<short>(0x0000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<short>(0x0001, out result)); Assert.Equal((char)0x0001, result); Assert.True(NumberHelper<char>.TryCreate<short>(0x7FFF, out result)); Assert.Equal((char)0x7FFF, result); Assert.False(NumberHelper<char>.TryCreate<short>(unchecked((short)0x8000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<short>(unchecked((short)0xFFFF), out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromInt32Test() { char result; Assert.True(NumberHelper<char>.TryCreate<int>(0x00000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<int>(0x00000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<int>(0x7FFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<int>(unchecked((int)0x80000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<int>(unchecked((int)0xFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromInt64Test() { char result; Assert.True(NumberHelper<char>.TryCreate<long>(0x0000000000000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<long>(0x0000000000000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<long>(0x7FFFFFFFFFFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<long>(unchecked((long)0x8000000000000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<long>(unchecked((long)0xFFFFFFFFFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromIntPtrTest() { char result; if (Environment.Is64BitProcess) { Assert.True(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0x0000000000000000), out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0x0000000000000001), out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0x7FFFFFFFFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0x8000000000000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0xFFFFFFFFFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } else { Assert.True(NumberHelper<char>.TryCreate<nint>((nint)0x00000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<nint>((nint)0x00000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<nint>((nint)0x7FFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0x80000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0xFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } } [Fact] public static void TryCreateFromSByteTest() { char result; Assert.True(NumberHelper<char>.TryCreate<sbyte>(0x00, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<sbyte>(0x01, out result)); Assert.Equal((char)0x0001, result); Assert.True(NumberHelper<char>.TryCreate<sbyte>(0x7F, out result)); Assert.Equal((char)0x007F, result); Assert.False(NumberHelper<char>.TryCreate<sbyte>(unchecked((sbyte)0x80), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<sbyte>(unchecked((sbyte)0xFF), out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromUInt16Test() { char result; Assert.True(NumberHelper<char>.TryCreate<ushort>(0x0000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<ushort>(0x0001, out result)); Assert.Equal((char)0x0001, result); Assert.True(NumberHelper<char>.TryCreate<ushort>(0x7FFF, out result)); Assert.Equal((char)0x7FFF, result); Assert.True(NumberHelper<char>.TryCreate<ushort>(0x8000, out result)); Assert.Equal((char)0x8000, result); Assert.True(NumberHelper<char>.TryCreate<ushort>(0xFFFF, out result)); Assert.Equal((char)0xFFFF, result); } [Fact] public static void TryCreateFromUInt32Test() { char result; Assert.True(NumberHelper<char>.TryCreate<uint>(0x00000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<uint>(0x00000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<uint>(0x7FFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<uint>(0x80000000, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<uint>(0xFFFFFFFF, out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromUInt64Test() { char result; Assert.True(NumberHelper<char>.TryCreate<ulong>(0x0000000000000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<ulong>(0x0000000000000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<ulong>(0x7FFFFFFFFFFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<ulong>(0x8000000000000000, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<ulong>(0xFFFFFFFFFFFFFFFF, out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromUIntPtrTest() { char result; if (Environment.Is64BitProcess) { Assert.True(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0x0000000000000000), out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0x0000000000000001), out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0x7FFFFFFFFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0x8000000000000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0xFFFFFFFFFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } else { Assert.True(NumberHelper<char>.TryCreate<nuint>((nuint)0x00000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<nuint>((nuint)0x00000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<nuint>((nuint)0x7FFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0x80000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0xFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } } [Fact] public static void op_LeftShiftTest() { Assert.Equal((char)0x0000, ShiftOperatorsHelper<char, char>.op_LeftShift((char)0x0000, 1)); Assert.Equal((char)0x0002, ShiftOperatorsHelper<char, char>.op_LeftShift((char)0x0001, 1)); Assert.Equal((char)0xFFFE, ShiftOperatorsHelper<char, char>.op_LeftShift((char)0x7FFF, 1)); Assert.Equal((char)0x0000, ShiftOperatorsHelper<char, char>.op_LeftShift((char)0x8000, 1)); Assert.Equal((char)0xFFFE, ShiftOperatorsHelper<char, char>.op_LeftShift((char)0xFFFF, 1)); } [Fact] public static void op_RightShiftTest() { Assert.Equal((char)0x0000, ShiftOperatorsHelper<char, char>.op_RightShift((char)0x0000, 1)); Assert.Equal((char)0x0000, ShiftOperatorsHelper<char, char>.op_RightShift((char)0x0001, 1)); Assert.Equal((char)0x3FFF, ShiftOperatorsHelper<char, char>.op_RightShift((char)0x7FFF, 1)); Assert.Equal((char)0x4000, ShiftOperatorsHelper<char, char>.op_RightShift((char)0x8000, 1)); Assert.Equal((char)0x7FFF, ShiftOperatorsHelper<char, char>.op_RightShift((char)0xFFFF, 1)); } [Fact] public static void op_SubtractionTest() { Assert.Equal((char)0xFFFF, SubtractionOperatorsHelper<char, char, char>.op_Subtraction((char)0x0000, (char)1)); Assert.Equal((char)0x0000, SubtractionOperatorsHelper<char, char, char>.op_Subtraction((char)0x0001, (char)1)); Assert.Equal((char)0x7FFE, SubtractionOperatorsHelper<char, char, char>.op_Subtraction((char)0x7FFF, (char)1)); Assert.Equal((char)0x7FFF, SubtractionOperatorsHelper<char, char, char>.op_Subtraction((char)0x8000, (char)1)); Assert.Equal((char)0xFFFE, SubtractionOperatorsHelper<char, char, char>.op_Subtraction((char)0xFFFF, (char)1)); } [Fact] public static void op_UnaryNegationTest() { Assert.Equal((char)0x0000, UnaryNegationOperatorsHelper<char, char>.op_UnaryNegation((char)0x0000)); Assert.Equal((char)0xFFFF, UnaryNegationOperatorsHelper<char, char>.op_UnaryNegation((char)0x0001)); Assert.Equal((char)0x8001, UnaryNegationOperatorsHelper<char, char>.op_UnaryNegation((char)0x7FFF)); Assert.Equal((char)0x8000, UnaryNegationOperatorsHelper<char, char>.op_UnaryNegation((char)0x8000)); Assert.Equal((char)0x0001, UnaryNegationOperatorsHelper<char, char>.op_UnaryNegation((char)0xFFFF)); } [Fact] public static void op_UnaryPlusTest() { Assert.Equal((char)0x0000, UnaryPlusOperatorsHelper<char, char>.op_UnaryPlus((char)0x0000)); Assert.Equal((char)0x0001, UnaryPlusOperatorsHelper<char, char>.op_UnaryPlus((char)0x0001)); Assert.Equal((char)0x7FFF, UnaryPlusOperatorsHelper<char, char>.op_UnaryPlus((char)0x7FFF)); Assert.Equal((char)0x8000, UnaryPlusOperatorsHelper<char, char>.op_UnaryPlus((char)0x8000)); Assert.Equal((char)0xFFFF, UnaryPlusOperatorsHelper<char, char>.op_UnaryPlus((char)0xFFFF)); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Runtime.Versioning; using Xunit; namespace System.Tests { [RequiresPreviewFeaturesAttribute] public class CharTests_GenericMath { [Fact] public static void AdditiveIdentityTest() { Assert.Equal((char)0x0000, AdditiveIdentityHelper<char, char>.AdditiveIdentity); } [Fact] public static void MinValueTest() { Assert.Equal((char)0x0000, MinMaxValueHelper<char>.MinValue); } [Fact] public static void MaxValueTest() { Assert.Equal((char)0xFFFF, MinMaxValueHelper<char>.MaxValue); } [Fact] public static void MultiplicativeIdentityTest() { Assert.Equal((char)0x0001, MultiplicativeIdentityHelper<char, char>.MultiplicativeIdentity); } [Fact] public static void OneTest() { Assert.Equal((char)0x0001, NumberHelper<char>.One); } [Fact] public static void ZeroTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Zero); } [Fact] public static void op_AdditionTest() { Assert.Equal((char)0x0001, AdditionOperatorsHelper<char, char, char>.op_Addition((char)0x0000, (char)1)); Assert.Equal((char)0x0002, AdditionOperatorsHelper<char, char, char>.op_Addition((char)0x0001, (char)1)); Assert.Equal((char)0x8000, AdditionOperatorsHelper<char, char, char>.op_Addition((char)0x7FFF, (char)1)); Assert.Equal((char)0x8001, AdditionOperatorsHelper<char, char, char>.op_Addition((char)0x8000, (char)1)); Assert.Equal((char)0x0000, AdditionOperatorsHelper<char, char, char>.op_Addition((char)0xFFFF, (char)1)); } [Fact] public static void LeadingZeroCountTest() { Assert.Equal((char)0x0010, BinaryIntegerHelper<char>.LeadingZeroCount((char)0x0000)); Assert.Equal((char)0x000F, BinaryIntegerHelper<char>.LeadingZeroCount((char)0x0001)); Assert.Equal((char)0x0001, BinaryIntegerHelper<char>.LeadingZeroCount((char)0x7FFF)); Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.LeadingZeroCount((char)0x8000)); Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.LeadingZeroCount((char)0xFFFF)); } [Fact] public static void PopCountTest() { Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.PopCount((char)0x0000)); Assert.Equal((char)0x0001, BinaryIntegerHelper<char>.PopCount((char)0x0001)); Assert.Equal((char)0x000F, BinaryIntegerHelper<char>.PopCount((char)0x7FFF)); Assert.Equal((char)0x0001, BinaryIntegerHelper<char>.PopCount((char)0x8000)); Assert.Equal((char)0x0010, BinaryIntegerHelper<char>.PopCount((char)0xFFFF)); } [Fact] public static void RotateLeftTest() { Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.RotateLeft((char)0x0000, 1)); Assert.Equal((char)0x0002, BinaryIntegerHelper<char>.RotateLeft((char)0x0001, 1)); Assert.Equal((char)0xFFFE, BinaryIntegerHelper<char>.RotateLeft((char)0x7FFF, 1)); Assert.Equal((char)0x0001, BinaryIntegerHelper<char>.RotateLeft((char)0x8000, 1)); Assert.Equal((char)0xFFFF, BinaryIntegerHelper<char>.RotateLeft((char)0xFFFF, 1)); } [Fact] public static void RotateRightTest() { Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.RotateRight((char)0x0000, 1)); Assert.Equal((char)0x8000, BinaryIntegerHelper<char>.RotateRight((char)0x0001, 1)); Assert.Equal((char)0xBFFF, BinaryIntegerHelper<char>.RotateRight((char)0x7FFF, 1)); Assert.Equal((char)0x4000, BinaryIntegerHelper<char>.RotateRight((char)0x8000, 1)); Assert.Equal((char)0xFFFF, BinaryIntegerHelper<char>.RotateRight((char)0xFFFF, 1)); } [Fact] public static void TrailingZeroCountTest() { Assert.Equal((char)0x0010, BinaryIntegerHelper<char>.TrailingZeroCount((char)0x0000)); Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.TrailingZeroCount((char)0x0001)); Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.TrailingZeroCount((char)0x7FFF)); Assert.Equal((char)0x000F, BinaryIntegerHelper<char>.TrailingZeroCount((char)0x8000)); Assert.Equal((char)0x0000, BinaryIntegerHelper<char>.TrailingZeroCount((char)0xFFFF)); } [Fact] public static void IsPow2Test() { Assert.False(BinaryNumberHelper<char>.IsPow2((char)0x0000)); Assert.True(BinaryNumberHelper<char>.IsPow2((char)0x0001)); Assert.False(BinaryNumberHelper<char>.IsPow2((char)0x7FFF)); Assert.True(BinaryNumberHelper<char>.IsPow2((char)0x8000)); Assert.False(BinaryNumberHelper<char>.IsPow2((char)0xFFFF)); } [Fact] public static void Log2Test() { Assert.Equal((char)0x0000, BinaryNumberHelper<char>.Log2((char)0x0000)); Assert.Equal((char)0x0000, BinaryNumberHelper<char>.Log2((char)0x0001)); Assert.Equal((char)0x000E, BinaryNumberHelper<char>.Log2((char)0x7FFF)); Assert.Equal((char)0x000F, BinaryNumberHelper<char>.Log2((char)0x8000)); Assert.Equal((char)0x000F, BinaryNumberHelper<char>.Log2((char)0xFFFF)); } [Fact] public static void op_BitwiseAndTest() { Assert.Equal((char)0x0000, BitwiseOperatorsHelper<char, char, char>.op_BitwiseAnd((char)0x0000, (char)1)); Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseAnd((char)0x0001, (char)1)); Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseAnd((char)0x7FFF, (char)1)); Assert.Equal((char)0x0000, BitwiseOperatorsHelper<char, char, char>.op_BitwiseAnd((char)0x8000, (char)1)); Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseAnd((char)0xFFFF, (char)1)); } [Fact] public static void op_BitwiseOrTest() { Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseOr((char)0x0000, (char)1)); Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseOr((char)0x0001, (char)1)); Assert.Equal((char)0x7FFF, BitwiseOperatorsHelper<char, char, char>.op_BitwiseOr((char)0x7FFF, (char)1)); Assert.Equal((char)0x8001, BitwiseOperatorsHelper<char, char, char>.op_BitwiseOr((char)0x8000, (char)1)); Assert.Equal((char)0xFFFF, BitwiseOperatorsHelper<char, char, char>.op_BitwiseOr((char)0xFFFF, (char)1)); } [Fact] public static void op_ExclusiveOrTest() { Assert.Equal((char)0x0001, BitwiseOperatorsHelper<char, char, char>.op_ExclusiveOr((char)0x0000, (char)1)); Assert.Equal((char)0x0000, BitwiseOperatorsHelper<char, char, char>.op_ExclusiveOr((char)0x0001, (char)1)); Assert.Equal((char)0x7FFE, BitwiseOperatorsHelper<char, char, char>.op_ExclusiveOr((char)0x7FFF, (char)1)); Assert.Equal((char)0x8001, BitwiseOperatorsHelper<char, char, char>.op_ExclusiveOr((char)0x8000, (char)1)); Assert.Equal((char)0xFFFE, BitwiseOperatorsHelper<char, char, char>.op_ExclusiveOr((char)0xFFFF, (char)1)); } [Fact] public static void op_OnesComplementTest() { Assert.Equal((char)0xFFFF, BitwiseOperatorsHelper<char, char, char>.op_OnesComplement((char)0x0000)); Assert.Equal((char)0xFFFE, BitwiseOperatorsHelper<char, char, char>.op_OnesComplement((char)0x0001)); Assert.Equal((char)0x8000, BitwiseOperatorsHelper<char, char, char>.op_OnesComplement((char)0x7FFF)); Assert.Equal((char)0x7FFF, BitwiseOperatorsHelper<char, char, char>.op_OnesComplement((char)0x8000)); Assert.Equal((char)0x0000, BitwiseOperatorsHelper<char, char, char>.op_OnesComplement((char)0xFFFF)); } [Fact] public static void op_LessThanTest() { Assert.True(ComparisonOperatorsHelper<char, char>.op_LessThan((char)0x0000, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThan((char)0x0001, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThan((char)0x7FFF, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThan((char)0x8000, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThan((char)0xFFFF, (char)1)); } [Fact] public static void op_LessThanOrEqualTest() { Assert.True(ComparisonOperatorsHelper<char, char>.op_LessThanOrEqual((char)0x0000, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_LessThanOrEqual((char)0x0001, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThanOrEqual((char)0x7FFF, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThanOrEqual((char)0x8000, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_LessThanOrEqual((char)0xFFFF, (char)1)); } [Fact] public static void op_GreaterThanTest() { Assert.False(ComparisonOperatorsHelper<char, char>.op_GreaterThan((char)0x0000, (char)1)); Assert.False(ComparisonOperatorsHelper<char, char>.op_GreaterThan((char)0x0001, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThan((char)0x7FFF, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThan((char)0x8000, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThan((char)0xFFFF, (char)1)); } [Fact] public static void op_GreaterThanOrEqualTest() { Assert.False(ComparisonOperatorsHelper<char, char>.op_GreaterThanOrEqual((char)0x0000, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThanOrEqual((char)0x0001, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThanOrEqual((char)0x7FFF, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThanOrEqual((char)0x8000, (char)1)); Assert.True(ComparisonOperatorsHelper<char, char>.op_GreaterThanOrEqual((char)0xFFFF, (char)1)); } [Fact] public static void op_DecrementTest() { Assert.Equal((char)0xFFFF, DecrementOperatorsHelper<char>.op_Decrement((char)0x0000)); Assert.Equal((char)0x0000, DecrementOperatorsHelper<char>.op_Decrement((char)0x0001)); Assert.Equal((char)0x7FFE, DecrementOperatorsHelper<char>.op_Decrement((char)0x7FFF)); Assert.Equal((char)0x7FFF, DecrementOperatorsHelper<char>.op_Decrement((char)0x8000)); Assert.Equal((char)0xFFFE, DecrementOperatorsHelper<char>.op_Decrement((char)0xFFFF)); } [Fact] public static void op_DivisionTest() { Assert.Equal((char)0x0000, DivisionOperatorsHelper<char, char, char>.op_Division((char)0x0000, (char)2)); Assert.Equal((char)0x0000, DivisionOperatorsHelper<char, char, char>.op_Division((char)0x0001, (char)2)); Assert.Equal((char)0x3FFF, DivisionOperatorsHelper<char, char, char>.op_Division((char)0x7FFF, (char)2)); Assert.Equal((char)0x4000, DivisionOperatorsHelper<char, char, char>.op_Division((char)0x8000, (char)2)); Assert.Equal((char)0x7FFF, DivisionOperatorsHelper<char, char, char>.op_Division((char)0xFFFF, (char)2)); } [Fact] public static void op_EqualityTest() { Assert.False(EqualityOperatorsHelper<char, char>.op_Equality((char)0x0000, (char)1)); Assert.True(EqualityOperatorsHelper<char, char>.op_Equality((char)0x0001, (char)1)); Assert.False(EqualityOperatorsHelper<char, char>.op_Equality((char)0x7FFF, (char)1)); Assert.False(EqualityOperatorsHelper<char, char>.op_Equality((char)0x8000, (char)1)); Assert.False(EqualityOperatorsHelper<char, char>.op_Equality((char)0xFFFF, (char)1)); } [Fact] public static void op_InequalityTest() { Assert.True(EqualityOperatorsHelper<char, char>.op_Inequality((char)0x0000, (char)1)); Assert.False(EqualityOperatorsHelper<char, char>.op_Inequality((char)0x0001, (char)1)); Assert.True(EqualityOperatorsHelper<char, char>.op_Inequality((char)0x7FFF, (char)1)); Assert.True(EqualityOperatorsHelper<char, char>.op_Inequality((char)0x8000, (char)1)); Assert.True(EqualityOperatorsHelper<char, char>.op_Inequality((char)0xFFFF, (char)1)); } [Fact] public static void op_IncrementTest() { Assert.Equal((char)0x0001, IncrementOperatorsHelper<char>.op_Increment((char)0x0000)); Assert.Equal((char)0x0002, IncrementOperatorsHelper<char>.op_Increment((char)0x0001)); Assert.Equal((char)0x8000, IncrementOperatorsHelper<char>.op_Increment((char)0x7FFF)); Assert.Equal((char)0x8001, IncrementOperatorsHelper<char>.op_Increment((char)0x8000)); Assert.Equal((char)0x0000, IncrementOperatorsHelper<char>.op_Increment((char)0xFFFF)); } [Fact] public static void op_ModulusTest() { Assert.Equal((char)0x0000, ModulusOperatorsHelper<char, char, char>.op_Modulus((char)0x0000, (char)2)); Assert.Equal((char)0x0001, ModulusOperatorsHelper<char, char, char>.op_Modulus((char)0x0001, (char)2)); Assert.Equal((char)0x0001, ModulusOperatorsHelper<char, char, char>.op_Modulus((char)0x7FFF, (char)2)); Assert.Equal((char)0x0000, ModulusOperatorsHelper<char, char, char>.op_Modulus((char)0x8000, (char)2)); Assert.Equal((char)0x0001, ModulusOperatorsHelper<char, char, char>.op_Modulus((char)0xFFFF, (char)2)); } [Fact] public static void op_MultiplyTest() { Assert.Equal((char)0x0000, MultiplyOperatorsHelper<char, char, char>.op_Multiply((char)0x0000, (char)2)); Assert.Equal((char)0x0002, MultiplyOperatorsHelper<char, char, char>.op_Multiply((char)0x0001, (char)2)); Assert.Equal((char)0xFFFE, MultiplyOperatorsHelper<char, char, char>.op_Multiply((char)0x7FFF, (char)2)); Assert.Equal((char)0x0000, MultiplyOperatorsHelper<char, char, char>.op_Multiply((char)0x8000, (char)2)); Assert.Equal((char)0xFFFE, MultiplyOperatorsHelper<char, char, char>.op_Multiply((char)0xFFFF, (char)2)); } [Fact] public static void AbsTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Abs((char)0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.Abs((char)0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.Abs((char)0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.Abs((char)0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.Abs((char)0xFFFF)); } [Fact] public static void ClampTest() { Assert.Equal((char)0x0001, NumberHelper<char>.Clamp((char)0x0000, (char)0x0001, (char)0x003F)); Assert.Equal((char)0x0001, NumberHelper<char>.Clamp((char)0x0001, (char)0x0001, (char)0x003F)); Assert.Equal((char)0x003F, NumberHelper<char>.Clamp((char)0x7FFF, (char)0x0001, (char)0x003F)); Assert.Equal((char)0x003F, NumberHelper<char>.Clamp((char)0x8000, (char)0x0001, (char)0x003F)); Assert.Equal((char)0x003F, NumberHelper<char>.Clamp((char)0xFFFF, (char)0x0001, (char)0x003F)); } [Fact] public static void CreateFromByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<byte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<byte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.Create<byte>(0x7F)); Assert.Equal((char)0x0080, NumberHelper<char>.Create<byte>(0x80)); Assert.Equal((char)0x00FF, NumberHelper<char>.Create<byte>(0xFF)); } [Fact] public static void CreateFromCharTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<char>((char)0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<char>((char)0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.Create<char>((char)0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.Create<char>((char)0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.Create<char>((char)0xFFFF)); } [Fact] public static void CreateFromInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<short>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<short>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.Create<short>(0x7FFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<short>(unchecked((short)0x8000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<short>(unchecked((short)0xFFFF))); } [Fact] public static void CreateFromInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<int>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<int>(0x00000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<int>(0x7FFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<int>(unchecked((int)0x80000000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<int>(unchecked((int)0xFFFFFFFF))); } [Fact] public static void CreateFromInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<long>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<long>(0x0000000000000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<long>(0x7FFFFFFFFFFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<long>(unchecked((long)0x8000000000000000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<long>(unchecked((long)0xFFFFFFFFFFFFFFFF))); } [Fact] public static void CreateFromIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.Create<nint>(unchecked((nint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.Create<nint>(unchecked((nint)0x0000000000000001))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>(unchecked((nint)0x7FFFFFFFFFFFFFFF))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>(unchecked((nint)0x8000000000000000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>(unchecked((nint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.Create<nint>((nint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<nint>((nint)0x00000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>((nint)0x7FFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>(unchecked((nint)0x80000000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nint>(unchecked((nint)0xFFFFFFFF))); } } [Fact] public static void CreateFromSByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<sbyte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<sbyte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.Create<sbyte>(0x7F)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<sbyte>(unchecked((sbyte)0x80))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<sbyte>(unchecked((sbyte)0xFF))); } [Fact] public static void CreateFromUInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<ushort>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<ushort>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.Create<ushort>(0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.Create<ushort>(0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.Create<ushort>(0xFFFF)); } [Fact] public static void CreateFromUInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<uint>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<uint>(0x00000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<uint>(0x7FFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<uint>(0x80000000)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<uint>(0xFFFFFFFF)); } [Fact] public static void CreateFromUInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.Create<ulong>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<ulong>(0x0000000000000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<ulong>(0x7FFFFFFFFFFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<ulong>(0x8000000000000000)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<ulong>(0xFFFFFFFFFFFFFFFF)); } [Fact] public static void CreateFromUIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.Create<nuint>(unchecked((nuint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.Create<nuint>(unchecked((nuint)0x0000000000000001))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>(unchecked((nuint)0x7FFFFFFFFFFFFFFF))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>(unchecked((nuint)0x8000000000000000))); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>(unchecked((nuint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.Create<nuint>((nuint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.Create<nuint>((nuint)0x00000001)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>((nuint)0x7FFFFFFF)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>((nuint)0x80000000)); Assert.Throws<OverflowException>(() => NumberHelper<char>.Create<nuint>((nuint)0xFFFFFFFF)); } } [Fact] public static void CreateSaturatingFromByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<byte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<byte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.CreateSaturating<byte>(0x7F)); Assert.Equal((char)0x0080, NumberHelper<char>.CreateSaturating<byte>(0x80)); Assert.Equal((char)0x00FF, NumberHelper<char>.CreateSaturating<byte>(0xFF)); } [Fact] public static void CreateSaturatingFromCharTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<char>((char)0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<char>((char)0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateSaturating<char>((char)0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.CreateSaturating<char>((char)0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<char>((char)0xFFFF)); } [Fact] public static void CreateSaturatingFromInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<short>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<short>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateSaturating<short>(0x7FFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<short>(unchecked((short)0x8000))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<short>(unchecked((short)0xFFFF))); } [Fact] public static void CreateSaturatingFromInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<int>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<int>(0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<int>(0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<int>(unchecked((int)0x80000000))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<int>(unchecked((int)0xFFFFFFFF))); } [Fact] public static void CreateSaturatingFromInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<long>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<long>(0x0000000000000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<long>(0x7FFFFFFFFFFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<long>(unchecked((long)0x8000000000000000))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<long>(unchecked((long)0xFFFFFFFFFFFFFFFF))); } [Fact] public static void CreateSaturatingFromIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0x0000000000000001))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0x7FFFFFFFFFFFFFFF))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0x8000000000000000))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>((nint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<nint>((nint)0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nint>((nint)0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0x80000000))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nint>(unchecked((nint)0xFFFFFFFF))); } } [Fact] public static void CreateSaturatingFromSByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<sbyte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<sbyte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.CreateSaturating<sbyte>(0x7F)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<sbyte>(unchecked((sbyte)0x80))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<sbyte>(unchecked((sbyte)0xFF))); } [Fact] public static void CreateSaturatingFromUInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<ushort>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<ushort>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateSaturating<ushort>(0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.CreateSaturating<ushort>(0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<ushort>(0xFFFF)); } [Fact] public static void CreateSaturatingFromUInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<uint>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<uint>(0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<uint>(0x7FFFFFFF)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<uint>(0x80000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<uint>(0xFFFFFFFF)); } [Fact] public static void CreateSaturatingFromUInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<ulong>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<ulong>(0x0000000000000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<ulong>(0x7FFFFFFFFFFFFFFF)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<ulong>(0x8000000000000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<ulong>(0xFFFFFFFFFFFFFFFF)); } [Fact] public static void CreateSaturatingFromUIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nuint>(unchecked((nuint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<nuint>(unchecked((nuint)0x0000000000000001))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>(unchecked((nuint)0x7FFFFFFFFFFFFFFF))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>(unchecked((nuint)0x8000000000000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>(unchecked((nuint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.CreateSaturating<nuint>((nuint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateSaturating<nuint>((nuint)0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>((nuint)0x7FFFFFFF)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>((nuint)0x80000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateSaturating<nuint>((nuint)0xFFFFFFFF)); } } [Fact] public static void CreateTruncatingFromByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<byte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<byte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.CreateTruncating<byte>(0x7F)); Assert.Equal((char)0x0080, NumberHelper<char>.CreateTruncating<byte>(0x80)); Assert.Equal((char)0x00FF, NumberHelper<char>.CreateTruncating<byte>(0xFF)); } [Fact] public static void CreateTruncatingFromCharTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<char>((char)0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<char>((char)0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateTruncating<char>((char)0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.CreateTruncating<char>((char)0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<char>((char)0xFFFF)); } [Fact] public static void CreateTruncatingFromInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<short>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<short>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateTruncating<short>(0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.CreateTruncating<short>(unchecked((short)0x8000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<short>(unchecked((short)0xFFFF))); } [Fact] public static void CreateTruncatingFromInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<int>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<int>(0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<int>(0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<int>(unchecked((int)0x80000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<int>(unchecked((int)0xFFFFFFFF))); } [Fact] public static void CreateTruncatingFromInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<long>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<long>(0x0000000000000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<long>(0x7FFFFFFFFFFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<long>(unchecked((long)0x8000000000000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<long>(unchecked((long)0xFFFFFFFFFFFFFFFF))); } [Fact] public static void CreateTruncatingFromIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0x0000000000000001))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0x7FFFFFFFFFFFFFFF))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0x8000000000000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nint>((nint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<nint>((nint)0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nint>((nint)0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0x80000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nint>(unchecked((nint)0xFFFFFFFF))); } } [Fact] public static void CreateTruncatingFromSByteTest() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<sbyte>(0x00)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<sbyte>(0x01)); Assert.Equal((char)0x007F, NumberHelper<char>.CreateTruncating<sbyte>(0x7F)); Assert.Equal((char)0xFF80, NumberHelper<char>.CreateTruncating<sbyte>(unchecked((sbyte)0x80))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<sbyte>(unchecked((sbyte)0xFF))); } [Fact] public static void CreateTruncatingFromUInt16Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<ushort>(0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<ushort>(0x0001)); Assert.Equal((char)0x7FFF, NumberHelper<char>.CreateTruncating<ushort>(0x7FFF)); Assert.Equal((char)0x8000, NumberHelper<char>.CreateTruncating<ushort>(0x8000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<ushort>(0xFFFF)); } [Fact] public static void CreateTruncatingFromUInt32Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<uint>(0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<uint>(0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<uint>(0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<uint>(0x80000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<uint>(0xFFFFFFFF)); } [Fact] public static void CreateTruncatingFromUInt64Test() { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<ulong>(0x0000000000000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<ulong>(0x0000000000000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<ulong>(0x7FFFFFFFFFFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<ulong>(0x8000000000000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<ulong>(0xFFFFFFFFFFFFFFFF)); } [Fact] public static void CreateTruncatingFromUIntPtrTest() { if (Environment.Is64BitProcess) { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nuint>(unchecked((nuint)0x0000000000000000))); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<nuint>(unchecked((nuint)0x0000000000000001))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nuint>(unchecked((nuint)0x7FFFFFFFFFFFFFFF))); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nuint>(unchecked((nuint)0x8000000000000000))); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nuint>(unchecked((nuint)0xFFFFFFFFFFFFFFFF))); } else { Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nuint>((nuint)0x00000000)); Assert.Equal((char)0x0001, NumberHelper<char>.CreateTruncating<nuint>((nuint)0x00000001)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nuint>((nuint)0x7FFFFFFF)); Assert.Equal((char)0x0000, NumberHelper<char>.CreateTruncating<nuint>((nuint)0x80000000)); Assert.Equal((char)0xFFFF, NumberHelper<char>.CreateTruncating<nuint>((nuint)0xFFFFFFFF)); } } [Fact] public static void DivRemTest() { Assert.Equal(((char)0x0000, (char)0x0000), NumberHelper<char>.DivRem((char)0x0000, (char)2)); Assert.Equal(((char)0x0000, (char)0x0001), NumberHelper<char>.DivRem((char)0x0001, (char)2)); Assert.Equal(((char)0x3FFF, (char)0x0001), NumberHelper<char>.DivRem((char)0x7FFF, (char)2)); Assert.Equal(((char)0x4000, (char)0x0000), NumberHelper<char>.DivRem((char)0x8000, (char)2)); Assert.Equal(((char)0x7FFF, (char)0x0001), NumberHelper<char>.DivRem((char)0xFFFF, (char)2)); } [Fact] public static void MaxTest() { Assert.Equal((char)0x0001, NumberHelper<char>.Max((char)0x0000, (char)1)); Assert.Equal((char)0x0001, NumberHelper<char>.Max((char)0x0001, (char)1)); Assert.Equal((char)0x7FFF, NumberHelper<char>.Max((char)0x7FFF, (char)1)); Assert.Equal((char)0x8000, NumberHelper<char>.Max((char)0x8000, (char)1)); Assert.Equal((char)0xFFFF, NumberHelper<char>.Max((char)0xFFFF, (char)1)); } [Fact] public static void MinTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Min((char)0x0000, (char)1)); Assert.Equal((char)0x0001, NumberHelper<char>.Min((char)0x0001, (char)1)); Assert.Equal((char)0x0001, NumberHelper<char>.Min((char)0x7FFF, (char)1)); Assert.Equal((char)0x0001, NumberHelper<char>.Min((char)0x8000, (char)1)); Assert.Equal((char)0x0001, NumberHelper<char>.Min((char)0xFFFF, (char)1)); } [Fact] public static void SignTest() { Assert.Equal((char)0x0000, NumberHelper<char>.Sign((char)0x0000)); Assert.Equal((char)0x0001, NumberHelper<char>.Sign((char)0x0001)); Assert.Equal((char)0x0001, NumberHelper<char>.Sign((char)0x7FFF)); Assert.Equal((char)0x0001, NumberHelper<char>.Sign((char)0x8000)); Assert.Equal((char)0x0001, NumberHelper<char>.Sign((char)0xFFFF)); } [Fact] public static void TryCreateFromByteTest() { char result; Assert.True(NumberHelper<char>.TryCreate<byte>(0x00, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<byte>(0x01, out result)); Assert.Equal((char)0x0001, result); Assert.True(NumberHelper<char>.TryCreate<byte>(0x7F, out result)); Assert.Equal((char)0x007F, result); Assert.True(NumberHelper<char>.TryCreate<byte>(0x80, out result)); Assert.Equal((char)0x0080, result); Assert.True(NumberHelper<char>.TryCreate<byte>(0xFF, out result)); Assert.Equal((char)0x00FF, result); } [Fact] public static void TryCreateFromCharTest() { char result; Assert.True(NumberHelper<char>.TryCreate<char>((char)0x0000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<char>((char)0x0001, out result)); Assert.Equal((char)0x0001, result); Assert.True(NumberHelper<char>.TryCreate<char>((char)0x7FFF, out result)); Assert.Equal((char)0x7FFF, result); Assert.True(NumberHelper<char>.TryCreate<char>((char)0x8000, out result)); Assert.Equal((char)0x8000, result); Assert.True(NumberHelper<char>.TryCreate<char>((char)0xFFFF, out result)); Assert.Equal((char)0xFFFF, result); } [Fact] public static void TryCreateFromInt16Test() { char result; Assert.True(NumberHelper<char>.TryCreate<short>(0x0000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<short>(0x0001, out result)); Assert.Equal((char)0x0001, result); Assert.True(NumberHelper<char>.TryCreate<short>(0x7FFF, out result)); Assert.Equal((char)0x7FFF, result); Assert.False(NumberHelper<char>.TryCreate<short>(unchecked((short)0x8000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<short>(unchecked((short)0xFFFF), out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromInt32Test() { char result; Assert.True(NumberHelper<char>.TryCreate<int>(0x00000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<int>(0x00000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<int>(0x7FFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<int>(unchecked((int)0x80000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<int>(unchecked((int)0xFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromInt64Test() { char result; Assert.True(NumberHelper<char>.TryCreate<long>(0x0000000000000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<long>(0x0000000000000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<long>(0x7FFFFFFFFFFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<long>(unchecked((long)0x8000000000000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<long>(unchecked((long)0xFFFFFFFFFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromIntPtrTest() { char result; if (Environment.Is64BitProcess) { Assert.True(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0x0000000000000000), out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0x0000000000000001), out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0x7FFFFFFFFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0x8000000000000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0xFFFFFFFFFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } else { Assert.True(NumberHelper<char>.TryCreate<nint>((nint)0x00000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<nint>((nint)0x00000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<nint>((nint)0x7FFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0x80000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nint>(unchecked((nint)0xFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } } [Fact] public static void TryCreateFromSByteTest() { char result; Assert.True(NumberHelper<char>.TryCreate<sbyte>(0x00, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<sbyte>(0x01, out result)); Assert.Equal((char)0x0001, result); Assert.True(NumberHelper<char>.TryCreate<sbyte>(0x7F, out result)); Assert.Equal((char)0x007F, result); Assert.False(NumberHelper<char>.TryCreate<sbyte>(unchecked((sbyte)0x80), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<sbyte>(unchecked((sbyte)0xFF), out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromUInt16Test() { char result; Assert.True(NumberHelper<char>.TryCreate<ushort>(0x0000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<ushort>(0x0001, out result)); Assert.Equal((char)0x0001, result); Assert.True(NumberHelper<char>.TryCreate<ushort>(0x7FFF, out result)); Assert.Equal((char)0x7FFF, result); Assert.True(NumberHelper<char>.TryCreate<ushort>(0x8000, out result)); Assert.Equal((char)0x8000, result); Assert.True(NumberHelper<char>.TryCreate<ushort>(0xFFFF, out result)); Assert.Equal((char)0xFFFF, result); } [Fact] public static void TryCreateFromUInt32Test() { char result; Assert.True(NumberHelper<char>.TryCreate<uint>(0x00000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<uint>(0x00000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<uint>(0x7FFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<uint>(0x80000000, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<uint>(0xFFFFFFFF, out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromUInt64Test() { char result; Assert.True(NumberHelper<char>.TryCreate<ulong>(0x0000000000000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<ulong>(0x0000000000000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<ulong>(0x7FFFFFFFFFFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<ulong>(0x8000000000000000, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<ulong>(0xFFFFFFFFFFFFFFFF, out result)); Assert.Equal((char)0x0000, result); } [Fact] public static void TryCreateFromUIntPtrTest() { char result; if (Environment.Is64BitProcess) { Assert.True(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0x0000000000000000), out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0x0000000000000001), out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0x7FFFFFFFFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0x8000000000000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0xFFFFFFFFFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } else { Assert.True(NumberHelper<char>.TryCreate<nuint>((nuint)0x00000000, out result)); Assert.Equal((char)0x0000, result); Assert.True(NumberHelper<char>.TryCreate<nuint>((nuint)0x00000001, out result)); Assert.Equal((char)0x0001, result); Assert.False(NumberHelper<char>.TryCreate<nuint>((nuint)0x7FFFFFFF, out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0x80000000), out result)); Assert.Equal((char)0x0000, result); Assert.False(NumberHelper<char>.TryCreate<nuint>(unchecked((nuint)0xFFFFFFFF), out result)); Assert.Equal((char)0x0000, result); } } [Fact] public static void op_LeftShiftTest() { Assert.Equal((char)0x0000, ShiftOperatorsHelper<char, char>.op_LeftShift((char)0x0000, 1)); Assert.Equal((char)0x0002, ShiftOperatorsHelper<char, char>.op_LeftShift((char)0x0001, 1)); Assert.Equal((char)0xFFFE, ShiftOperatorsHelper<char, char>.op_LeftShift((char)0x7FFF, 1)); Assert.Equal((char)0x0000, ShiftOperatorsHelper<char, char>.op_LeftShift((char)0x8000, 1)); Assert.Equal((char)0xFFFE, ShiftOperatorsHelper<char, char>.op_LeftShift((char)0xFFFF, 1)); } [Fact] public static void op_RightShiftTest() { Assert.Equal((char)0x0000, ShiftOperatorsHelper<char, char>.op_RightShift((char)0x0000, 1)); Assert.Equal((char)0x0000, ShiftOperatorsHelper<char, char>.op_RightShift((char)0x0001, 1)); Assert.Equal((char)0x3FFF, ShiftOperatorsHelper<char, char>.op_RightShift((char)0x7FFF, 1)); Assert.Equal((char)0x4000, ShiftOperatorsHelper<char, char>.op_RightShift((char)0x8000, 1)); Assert.Equal((char)0x7FFF, ShiftOperatorsHelper<char, char>.op_RightShift((char)0xFFFF, 1)); } [Fact] public static void op_SubtractionTest() { Assert.Equal((char)0xFFFF, SubtractionOperatorsHelper<char, char, char>.op_Subtraction((char)0x0000, (char)1)); Assert.Equal((char)0x0000, SubtractionOperatorsHelper<char, char, char>.op_Subtraction((char)0x0001, (char)1)); Assert.Equal((char)0x7FFE, SubtractionOperatorsHelper<char, char, char>.op_Subtraction((char)0x7FFF, (char)1)); Assert.Equal((char)0x7FFF, SubtractionOperatorsHelper<char, char, char>.op_Subtraction((char)0x8000, (char)1)); Assert.Equal((char)0xFFFE, SubtractionOperatorsHelper<char, char, char>.op_Subtraction((char)0xFFFF, (char)1)); } [Fact] public static void op_UnaryNegationTest() { Assert.Equal((char)0x0000, UnaryNegationOperatorsHelper<char, char>.op_UnaryNegation((char)0x0000)); Assert.Equal((char)0xFFFF, UnaryNegationOperatorsHelper<char, char>.op_UnaryNegation((char)0x0001)); Assert.Equal((char)0x8001, UnaryNegationOperatorsHelper<char, char>.op_UnaryNegation((char)0x7FFF)); Assert.Equal((char)0x8000, UnaryNegationOperatorsHelper<char, char>.op_UnaryNegation((char)0x8000)); Assert.Equal((char)0x0001, UnaryNegationOperatorsHelper<char, char>.op_UnaryNegation((char)0xFFFF)); } [Fact] public static void op_UnaryPlusTest() { Assert.Equal((char)0x0000, UnaryPlusOperatorsHelper<char, char>.op_UnaryPlus((char)0x0000)); Assert.Equal((char)0x0001, UnaryPlusOperatorsHelper<char, char>.op_UnaryPlus((char)0x0001)); Assert.Equal((char)0x7FFF, UnaryPlusOperatorsHelper<char, char>.op_UnaryPlus((char)0x7FFF)); Assert.Equal((char)0x8000, UnaryPlusOperatorsHelper<char, char>.op_UnaryPlus((char)0x8000)); Assert.Equal((char)0xFFFF, UnaryPlusOperatorsHelper<char, char>.op_UnaryPlus((char)0xFFFF)); } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Private.CoreLib/src/System/Globalization/Normalization.Icu.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; namespace System.Globalization { internal static partial class Normalization { private static unsafe bool IcuIsNormalized(string strInput, NormalizationForm normalizationForm) { Debug.Assert(!GlobalizationMode.Invariant); Debug.Assert(!GlobalizationMode.UseNls); ValidateArguments(strInput, normalizationForm); int ret; fixed (char* pInput = strInput) { ret = Interop.Globalization.IsNormalized(normalizationForm, pInput, strInput.Length); } if (ret == -1) { throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); } return ret == 1; } private static unsafe string IcuNormalize(string strInput, NormalizationForm normalizationForm) { Debug.Assert(!GlobalizationMode.Invariant); Debug.Assert(!GlobalizationMode.UseNls); ValidateArguments(strInput, normalizationForm); char[]? toReturn = null; try { const int StackallocThreshold = 512; Span<char> buffer = strInput.Length <= StackallocThreshold ? stackalloc char[StackallocThreshold] : (toReturn = ArrayPool<char>.Shared.Rent(strInput.Length)); for (int attempt = 0; attempt < 2; attempt++) { int realLen; fixed (char* pInput = strInput) fixed (char* pDest = &MemoryMarshal.GetReference(buffer)) { realLen = Interop.Globalization.NormalizeString(normalizationForm, pInput, strInput.Length, pDest, buffer.Length); } if (realLen == -1) { throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); } if (realLen <= buffer.Length) { ReadOnlySpan<char> result = buffer.Slice(0, realLen); return result.SequenceEqual(strInput) ? strInput : new string(result); } Debug.Assert(realLen > StackallocThreshold); if (attempt == 0) { if (toReturn != null) { // Clear toReturn first to ensure we don't return the same buffer twice char[] temp = toReturn; toReturn = null; ArrayPool<char>.Shared.Return(temp); } buffer = toReturn = ArrayPool<char>.Shared.Rent(realLen); } } throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); } finally { if (toReturn != null) { ArrayPool<char>.Shared.Return(toReturn); } } } private static void ValidateArguments(string strInput, NormalizationForm normalizationForm) { Debug.Assert(strInput != null); if (OperatingSystem.IsBrowser() && (normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD)) { // Browser's ICU doesn't contain data needed for FormKC and FormKD throw new PlatformNotSupportedException(); } if (normalizationForm != NormalizationForm.FormC && normalizationForm != NormalizationForm.FormD && normalizationForm != NormalizationForm.FormKC && normalizationForm != NormalizationForm.FormKD) { throw new ArgumentException(SR.Argument_InvalidNormalizationForm, nameof(normalizationForm)); } if (HasInvalidUnicodeSequence(strInput)) { throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); } } /// <summary> /// ICU does not signal an error during normalization if the input string has invalid unicode, /// unlike Windows (which uses the ERROR_NO_UNICODE_TRANSLATION error value to signal an error). /// /// We walk the string ourselves looking for these bad sequences so we can continue to throw /// ArgumentException in these cases. /// </summary> private static bool HasInvalidUnicodeSequence(string s) { for (int i = 0; i < s.Length; i++) { char c = s[i]; if (c < '\ud800') { continue; } if (c == '\uFFFE') { return true; } // If we see low surrogate before a high one, the string is invalid. if (char.IsLowSurrogate(c)) { return true; } if (char.IsHighSurrogate(c)) { if (i + 1 >= s.Length || !char.IsLowSurrogate(s[i + 1])) { // A high surrogate at the end of the string or a high surrogate // not followed by a low surrogate return true; } else { i++; // consume the low surrogate. continue; } } } return false; } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Buffers; using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; namespace System.Globalization { internal static partial class Normalization { private static unsafe bool IcuIsNormalized(string strInput, NormalizationForm normalizationForm) { Debug.Assert(!GlobalizationMode.Invariant); Debug.Assert(!GlobalizationMode.UseNls); ValidateArguments(strInput, normalizationForm); int ret; fixed (char* pInput = strInput) { ret = Interop.Globalization.IsNormalized(normalizationForm, pInput, strInput.Length); } if (ret == -1) { throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); } return ret == 1; } private static unsafe string IcuNormalize(string strInput, NormalizationForm normalizationForm) { Debug.Assert(!GlobalizationMode.Invariant); Debug.Assert(!GlobalizationMode.UseNls); ValidateArguments(strInput, normalizationForm); char[]? toReturn = null; try { const int StackallocThreshold = 512; Span<char> buffer = strInput.Length <= StackallocThreshold ? stackalloc char[StackallocThreshold] : (toReturn = ArrayPool<char>.Shared.Rent(strInput.Length)); for (int attempt = 0; attempt < 2; attempt++) { int realLen; fixed (char* pInput = strInput) fixed (char* pDest = &MemoryMarshal.GetReference(buffer)) { realLen = Interop.Globalization.NormalizeString(normalizationForm, pInput, strInput.Length, pDest, buffer.Length); } if (realLen == -1) { throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); } if (realLen <= buffer.Length) { ReadOnlySpan<char> result = buffer.Slice(0, realLen); return result.SequenceEqual(strInput) ? strInput : new string(result); } Debug.Assert(realLen > StackallocThreshold); if (attempt == 0) { if (toReturn != null) { // Clear toReturn first to ensure we don't return the same buffer twice char[] temp = toReturn; toReturn = null; ArrayPool<char>.Shared.Return(temp); } buffer = toReturn = ArrayPool<char>.Shared.Rent(realLen); } } throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); } finally { if (toReturn != null) { ArrayPool<char>.Shared.Return(toReturn); } } } private static void ValidateArguments(string strInput, NormalizationForm normalizationForm) { Debug.Assert(strInput != null); if (OperatingSystem.IsBrowser() && (normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD)) { // Browser's ICU doesn't contain data needed for FormKC and FormKD throw new PlatformNotSupportedException(); } if (normalizationForm != NormalizationForm.FormC && normalizationForm != NormalizationForm.FormD && normalizationForm != NormalizationForm.FormKC && normalizationForm != NormalizationForm.FormKD) { throw new ArgumentException(SR.Argument_InvalidNormalizationForm, nameof(normalizationForm)); } if (HasInvalidUnicodeSequence(strInput)) { throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); } } /// <summary> /// ICU does not signal an error during normalization if the input string has invalid unicode, /// unlike Windows (which uses the ERROR_NO_UNICODE_TRANSLATION error value to signal an error). /// /// We walk the string ourselves looking for these bad sequences so we can continue to throw /// ArgumentException in these cases. /// </summary> private static bool HasInvalidUnicodeSequence(string s) { for (int i = 0; i < s.Length; i++) { char c = s[i]; if (c < '\ud800') { continue; } if (c == '\uFFFE') { return true; } // If we see low surrogate before a high one, the string is invalid. if (char.IsLowSurrogate(c)) { return true; } if (char.IsHighSurrogate(c)) { if (i + 1 >= s.Length || !char.IsLowSurrogate(s[i + 1])) { // A high surrogate at the end of the string or a high surrogate // not followed by a low surrogate return true; } else { i++; // consume the low surrogate. continue; } } } return false; } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/mono/mono/tests/abort-cctor-2.cs
using System; using System.Threading; public class Critical { static Critical () { Program.mre1.Set (); Program.mre2.WaitOne (); try { throw new Exception (); } catch (Exception) { Console.WriteLine ("Catched exception in cctor"); Program.catched_exception = true; } } } public class Program { public static ManualResetEvent mre1 = new ManualResetEvent (false); public static ManualResetEvent mre2 = new ManualResetEvent (false); public static bool catched_exception, catched_abort; public static int Main (string[] args) { Thread thread = new Thread (DoStuff); thread.Start (); mre1.WaitOne (); thread.Abort (); mre2.Set (); thread.Join (); if (!catched_exception) Environment.Exit (1); if (!catched_abort) Environment.Exit (2); Console.WriteLine ("done, all things good"); return 0; } public static void DoStuff () { try { new Critical (); } catch (ThreadAbortException) { Console.WriteLine ("Catched thread abort"); Program.catched_abort = true; } } }
using System; using System.Threading; public class Critical { static Critical () { Program.mre1.Set (); Program.mre2.WaitOne (); try { throw new Exception (); } catch (Exception) { Console.WriteLine ("Catched exception in cctor"); Program.catched_exception = true; } } } public class Program { public static ManualResetEvent mre1 = new ManualResetEvent (false); public static ManualResetEvent mre2 = new ManualResetEvent (false); public static bool catched_exception, catched_abort; public static int Main (string[] args) { Thread thread = new Thread (DoStuff); thread.Start (); mre1.WaitOne (); thread.Abort (); mre2.Set (); thread.Join (); if (!catched_exception) Environment.Exit (1); if (!catched_abort) Environment.Exit (2); Console.WriteLine ("done, all things good"); return 0; } public static void DoStuff () { try { new Critical (); } catch (ThreadAbortException) { Console.WriteLine ("Catched thread abort"); Program.catched_abort = true; } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/tests/Loader/classloader/DefaultInterfaceMethods/regressions/github58394.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.CompilerServices; namespace GenericDimValuetypeBug { class Program { static int Main() { if (RunOne() != 17) return 1; if (RunTwo() != 23) return 2; return 100; } [MethodImpl(MethodImplOptions.NoInlining)] public static int RunOne() { return (new Foo() { x = 17 } as IFoo).NoCrash(); } [MethodImpl(MethodImplOptions.NoInlining)] public static int RunTwo() { return (new Foo() { x = 23 } as IFoo).Crash<int>(); } } interface IFoo { int Crash<T>() => Bla(); int NoCrash() => Bla(); int Bla(); } struct Foo: IFoo { public int x; public int Bla() => x; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.CompilerServices; namespace GenericDimValuetypeBug { class Program { static int Main() { if (RunOne() != 17) return 1; if (RunTwo() != 23) return 2; return 100; } [MethodImpl(MethodImplOptions.NoInlining)] public static int RunOne() { return (new Foo() { x = 17 } as IFoo).NoCrash(); } [MethodImpl(MethodImplOptions.NoInlining)] public static int RunTwo() { return (new Foo() { x = 23 } as IFoo).Crash<int>(); } } interface IFoo { int Crash<T>() => Bla(); int NoCrash() => Bla(); int Bla(); } struct Foo: IFoo { public int x; public int Bla() => x; } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/mono/mono/tests/reflection-prop.cs
using System.Reflection; using System; namespace Test { public class T { public static int Main(string[] args) { string name = "System.String"; if (args.Length > 0) name = args [0]; Type t = Type.GetType (name); PropertyInfo[] ms = t.GetProperties(); foreach (PropertyInfo m in ms) { if (m.CanRead) Console.Write ("Type "+m.PropertyType.Name+" "); Console.WriteLine (m.Name); } return 0; } } }
using System.Reflection; using System; namespace Test { public class T { public static int Main(string[] args) { string name = "System.String"; if (args.Length > 0) name = args [0]; Type t = Type.GetType (name); PropertyInfo[] ms = t.GetProperties(); foreach (PropertyInfo m in ms) { if (m.CanRead) Console.Write ("Type "+m.PropertyType.Name+" "); Console.WriteLine (m.Name); } return 0; } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/CompareGreaterThanOrEqual.Vector64.Byte.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.Arm; namespace JIT.HardwareIntrinsics.Arm { public static partial class Program { private static void CompareGreaterThanOrEqual_Vector64_Byte() { var test = new SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); } // Validates passing a static member works test.RunClsVarScenario(); if (AdvSimd.IsSupported) { // Validates passing a static member works, using pinning and Load test.RunClsVarScenario_Load(); } // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local class works, using pinning and Load test.RunClassLclFldScenario_Load(); } // Validates passing an instance member of a class works test.RunClassFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a class works, using pinning and Load test.RunClassFldScenario_Load(); } // Validates passing the field of a local struct works test.RunStructLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local struct works, using pinning and Load test.RunStructLclFldScenario_Load(); } // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a struct works, using pinning and Load test.RunStructFldScenario_Load(); } } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; private ulong alignment; public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Byte>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Byte>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Byte>(); if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Byte, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Byte, byte>(ref inArray2[0]), (uint)sizeOfinArray2); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector64<Byte> _fld1; public Vector64<Byte> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref testStruct._fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref testStruct._fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); return testStruct; } public void RunStructFldScenario(SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte testClass) { var result = AdvSimd.CompareGreaterThanOrEqual(_fld1, _fld2); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } public void RunStructFldScenario_Load(SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte testClass) { fixed (Vector64<Byte>* pFld1 = &_fld1) fixed (Vector64<Byte>* pFld2 = &_fld2) { var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(pFld1)), AdvSimd.LoadVector64((Byte*)(pFld2)) ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } } private static readonly int LargestVectorSize = 8; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Byte>>() / sizeof(Byte); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Byte>>() / sizeof(Byte); private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Byte>>() / sizeof(Byte); private static Byte[] _data1 = new Byte[Op1ElementCount]; private static Byte[] _data2 = new Byte[Op2ElementCount]; private static Vector64<Byte> _clsVar1; private static Vector64<Byte> _clsVar2; private Vector64<Byte> _fld1; private Vector64<Byte> _fld2; private DataTable _dataTable; static SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _clsVar1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _clsVar2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); } public SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); } public bool IsSupported => AdvSimd.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = AdvSimd.CompareGreaterThanOrEqual( Unsafe.Read<Vector64<Byte>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<Byte>>(_dataTable.inArray2Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.CompareGreaterThanOrEqual), new Type[] { typeof(Vector64<Byte>), typeof(Vector64<Byte>) }) .Invoke(null, new object[] { Unsafe.Read<Vector64<Byte>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<Byte>>(_dataTable.inArray2Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Byte>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.CompareGreaterThanOrEqual), new Type[] { typeof(Vector64<Byte>), typeof(Vector64<Byte>) }) .Invoke(null, new object[] { AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Byte>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = AdvSimd.CompareGreaterThanOrEqual( _clsVar1, _clsVar2 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunClsVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); fixed (Vector64<Byte>* pClsVar1 = &_clsVar1) fixed (Vector64<Byte>* pClsVar2 = &_clsVar2) { var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(pClsVar1)), AdvSimd.LoadVector64((Byte*)(pClsVar2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector64<Byte>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector64<Byte>>(_dataTable.inArray2Ptr); var result = AdvSimd.CompareGreaterThanOrEqual(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var op1 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)); var op2 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)); var result = AdvSimd.CompareGreaterThanOrEqual(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte(); var result = AdvSimd.CompareGreaterThanOrEqual(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); var test = new SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte(); fixed (Vector64<Byte>* pFld1 = &test._fld1) fixed (Vector64<Byte>* pFld2 = &test._fld2) { var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(pFld1)), AdvSimd.LoadVector64((Byte*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = AdvSimd.CompareGreaterThanOrEqual(_fld1, _fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); fixed (Vector64<Byte>* pFld1 = &_fld1) fixed (Vector64<Byte>* pFld2 = &_fld2) { var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(pFld1)), AdvSimd.LoadVector64((Byte*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = AdvSimd.CompareGreaterThanOrEqual(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); var test = TestStruct.Create(); var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(&test._fld1)), AdvSimd.LoadVector64((Byte*)(&test._fld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunStructFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); var test = TestStruct.Create(); test.RunStructFldScenario_Load(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult(Vector64<Byte> op1, Vector64<Byte> op2, void* result, [CallerMemberName] string method = "") { Byte[] inArray1 = new Byte[Op1ElementCount]; Byte[] inArray2 = new Byte[Op2ElementCount]; Byte[] outArray = new Byte[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), op2); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Byte>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") { Byte[] inArray1 = new Byte[Op1ElementCount]; Byte[] inArray2 = new Byte[Op2ElementCount]; Byte[] outArray = new Byte[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Byte>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Byte>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Byte>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") { bool succeeded = true; for (var i = 0; i < RetElementCount; i++) { if (Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]) { succeeded = false; break; } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.CompareGreaterThanOrEqual)}<Byte>(Vector64<Byte>, Vector64<Byte>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.Arm; namespace JIT.HardwareIntrinsics.Arm { public static partial class Program { private static void CompareGreaterThanOrEqual_Vector64_Byte() { var test = new SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); } // Validates passing a static member works test.RunClsVarScenario(); if (AdvSimd.IsSupported) { // Validates passing a static member works, using pinning and Load test.RunClsVarScenario_Load(); } // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local class works, using pinning and Load test.RunClassLclFldScenario_Load(); } // Validates passing an instance member of a class works test.RunClassFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a class works, using pinning and Load test.RunClassFldScenario_Load(); } // Validates passing the field of a local struct works test.RunStructLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local struct works, using pinning and Load test.RunStructLclFldScenario_Load(); } // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a struct works, using pinning and Load test.RunStructFldScenario_Load(); } } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; private ulong alignment; public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Byte>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Byte>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Byte>(); if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Byte, byte>(ref inArray1[0]), (uint)sizeOfinArray1); Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Byte, byte>(ref inArray2[0]), (uint)sizeOfinArray2); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector64<Byte> _fld1; public Vector64<Byte> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref testStruct._fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref testStruct._fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); return testStruct; } public void RunStructFldScenario(SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte testClass) { var result = AdvSimd.CompareGreaterThanOrEqual(_fld1, _fld2); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } public void RunStructFldScenario_Load(SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte testClass) { fixed (Vector64<Byte>* pFld1 = &_fld1) fixed (Vector64<Byte>* pFld2 = &_fld2) { var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(pFld1)), AdvSimd.LoadVector64((Byte*)(pFld2)) ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } } private static readonly int LargestVectorSize = 8; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Byte>>() / sizeof(Byte); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Byte>>() / sizeof(Byte); private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Byte>>() / sizeof(Byte); private static Byte[] _data1 = new Byte[Op1ElementCount]; private static Byte[] _data2 = new Byte[Op2ElementCount]; private static Vector64<Byte> _clsVar1; private static Vector64<Byte> _clsVar2; private Vector64<Byte> _fld1; private Vector64<Byte> _fld2; private DataTable _dataTable; static SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _clsVar1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _clsVar2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); } public SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Byte>, byte>(ref _fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Byte>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); } _dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize); } public bool IsSupported => AdvSimd.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = AdvSimd.CompareGreaterThanOrEqual( Unsafe.Read<Vector64<Byte>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<Byte>>(_dataTable.inArray2Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.CompareGreaterThanOrEqual), new Type[] { typeof(Vector64<Byte>), typeof(Vector64<Byte>) }) .Invoke(null, new object[] { Unsafe.Read<Vector64<Byte>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector64<Byte>>(_dataTable.inArray2Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Byte>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.CompareGreaterThanOrEqual), new Type[] { typeof(Vector64<Byte>), typeof(Vector64<Byte>) }) .Invoke(null, new object[] { AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Byte>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = AdvSimd.CompareGreaterThanOrEqual( _clsVar1, _clsVar2 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunClsVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); fixed (Vector64<Byte>* pClsVar1 = &_clsVar1) fixed (Vector64<Byte>* pClsVar2 = &_clsVar2) { var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(pClsVar1)), AdvSimd.LoadVector64((Byte*)(pClsVar2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector64<Byte>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector64<Byte>>(_dataTable.inArray2Ptr); var result = AdvSimd.CompareGreaterThanOrEqual(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var op1 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray1Ptr)); var op2 = AdvSimd.LoadVector64((Byte*)(_dataTable.inArray2Ptr)); var result = AdvSimd.CompareGreaterThanOrEqual(op1, op2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte(); var result = AdvSimd.CompareGreaterThanOrEqual(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); var test = new SimpleBinaryOpTest__CompareGreaterThanOrEqual_Vector64_Byte(); fixed (Vector64<Byte>* pFld1 = &test._fld1) fixed (Vector64<Byte>* pFld2 = &test._fld2) { var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(pFld1)), AdvSimd.LoadVector64((Byte*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = AdvSimd.CompareGreaterThanOrEqual(_fld1, _fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); fixed (Vector64<Byte>* pFld1 = &_fld1) fixed (Vector64<Byte>* pFld2 = &_fld2) { var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(pFld1)), AdvSimd.LoadVector64((Byte*)(pFld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = AdvSimd.CompareGreaterThanOrEqual(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); var test = TestStruct.Create(); var result = AdvSimd.CompareGreaterThanOrEqual( AdvSimd.LoadVector64((Byte*)(&test._fld1)), AdvSimd.LoadVector64((Byte*)(&test._fld2)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunStructFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); var test = TestStruct.Create(); test.RunStructFldScenario_Load(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult(Vector64<Byte> op1, Vector64<Byte> op2, void* result, [CallerMemberName] string method = "") { Byte[] inArray1 = new Byte[Op1ElementCount]; Byte[] inArray2 = new Byte[Op2ElementCount]; Byte[] outArray = new Byte[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), op1); Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), op2); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Byte>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "") { Byte[] inArray1 = new Byte[Op1ElementCount]; Byte[] inArray2 = new Byte[Op2ElementCount]; Byte[] outArray = new Byte[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Byte>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Byte>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Byte>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "") { bool succeeded = true; for (var i = 0; i < RetElementCount; i++) { if (Helpers.CompareGreaterThanOrEqual(left[i], right[i]) != result[i]) { succeeded = false; break; } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.CompareGreaterThanOrEqual)}<Byte>(Vector64<Byte>, Vector64<Byte>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/ListInitExpression.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; using System.Reflection; using System.Runtime.CompilerServices; namespace System.Linq.Expressions { /// <summary> /// Represents a constructor call that has a collection initializer. /// </summary> /// <remarks> /// Use the <see cref="Expression.ListInit(NewExpression, Expression[])"/> factory methods to create a ListInitExpression. /// The value of the <see cref="NodeType" /> property of a ListInitExpression is ListInit. /// </remarks> [DebuggerTypeProxy(typeof(ListInitExpressionProxy))] public sealed class ListInitExpression : Expression { internal ListInitExpression(NewExpression newExpression, ReadOnlyCollection<ElementInit> initializers) { NewExpression = newExpression; Initializers = initializers; } /// <summary> /// Returns the node type of this <see cref="Expression"/>. (Inherited from <see cref="Expression"/>.) /// </summary> /// <returns>The <see cref="ExpressionType"/> that represents this expression.</returns> public sealed override ExpressionType NodeType => ExpressionType.ListInit; /// <summary> /// Gets the static type of the expression that this <see cref="Expression"/> represents. (Inherited from <see cref="Expression"/>.) /// </summary> /// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> public sealed override Type Type => NewExpression.Type; /// <summary> /// Gets a value that indicates whether the expression tree node can be reduced. /// </summary> public override bool CanReduce => true; /// <summary> /// Gets the expression that contains a call to the constructor of a collection type. /// </summary> public NewExpression NewExpression { get; } /// <summary> /// Gets the element initializers that are used to initialize a collection. /// </summary> public ReadOnlyCollection<ElementInit> Initializers { get; } /// <summary> /// Dispatches to the specific visit method for this node type. /// </summary> protected internal override Expression Accept(ExpressionVisitor visitor) { return visitor.VisitListInit(this); } /// <summary> /// Reduces the binary expression node to a simpler expression. /// If CanReduce returns true, this should return a valid expression. /// This method is allowed to return another node which itself /// must be reduced. /// </summary> /// <returns>The reduced expression.</returns> public override Expression Reduce() { return MemberInitExpression.ReduceListInit(NewExpression, Initializers, keepOnStack: true); } /// <summary> /// Creates a new expression that is like this one, but using the /// supplied children. If all of the children are the same, it will /// return this expression. /// </summary> /// <param name="newExpression">The <see cref="NewExpression"/> property of the result.</param> /// <param name="initializers">The <see cref="Initializers"/> property of the result.</param> /// <returns>This expression if no children changed, or an expression with the updated children.</returns> public ListInitExpression Update(NewExpression newExpression, IEnumerable<ElementInit> initializers) { if (newExpression == NewExpression && initializers != null) { if (ExpressionUtils.SameElements(ref initializers!, Initializers)) { return this; } } return ListInit(newExpression, initializers!); } } public partial class Expression { /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses a method named "Add" to add elements to a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="initializers">An array of <see cref="Expression"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param> /// <returns>A <see cref="ListInitExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.ListInit"/> and the <see cref="ListInitExpression.NewExpression"/> property set to the specified value.</returns> [RequiresUnreferencedCode(ExpressionRequiresUnreferencedCode)] public static ListInitExpression ListInit(NewExpression newExpression, params Expression[] initializers) { return ListInit(newExpression, initializers as IEnumerable<Expression>); } /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses a method named "Add" to add elements to a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="initializers">An <see cref="IEnumerable{T}"/> that contains <see cref="Expressions.ElementInit"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param> /// <returns>A <see cref="ListInitExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.ListInit"/> and the <see cref="ListInitExpression.NewExpression"/> property set to the specified value.</returns> [RequiresUnreferencedCode(ExpressionRequiresUnreferencedCode)] public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable<Expression> initializers) { ContractUtils.RequiresNotNull(newExpression, nameof(newExpression)); ContractUtils.RequiresNotNull(initializers, nameof(initializers)); ReadOnlyCollection<Expression> initializerlist = initializers.ToReadOnly(); if (initializerlist.Count == 0) { return new ListInitExpression(newExpression, EmptyReadOnlyCollection<ElementInit>.Instance); } MethodInfo? addMethod = FindMethod(newExpression.Type, "Add", null, new Expression[] { initializerlist[0] }, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); return ListInit(newExpression, addMethod, initializerlist); } /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses a specified method to add elements to a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="addMethod">A <see cref="MethodInfo"/> that represents an instance method named "Add" (case insensitive), that adds an element to a collection.</param> /// <param name="initializers">An array of <see cref="Expression"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param> /// <returns>A <see cref="ListInitExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.ListInit"/> and the <see cref="ListInitExpression.NewExpression"/> property set to the specified value.</returns> [RequiresUnreferencedCode(ExpressionRequiresUnreferencedCode)] public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo? addMethod, params Expression[] initializers) { return ListInit(newExpression, addMethod, initializers as IEnumerable<Expression>); } /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses a specified method to add elements to a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="addMethod">A <see cref="MethodInfo"/> that represents an instance method named "Add" (case insensitive), that adds an element to a collection.</param> /// <param name="initializers">An <see cref="IEnumerable{T}"/> that contains <see cref="Expression"/> objects to use to populate the Initializers collection.</param> /// <returns>A <see cref="ListInitExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.ListInit"/> and the <see cref="ListInitExpression.NewExpression"/> property set to the specified value.</returns> [RequiresUnreferencedCode(ExpressionRequiresUnreferencedCode)] public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo? addMethod, IEnumerable<Expression> initializers) { if (addMethod == null) { return ListInit(newExpression, initializers); } ContractUtils.RequiresNotNull(newExpression, nameof(newExpression)); ContractUtils.RequiresNotNull(initializers, nameof(initializers)); ReadOnlyCollection<Expression> initializerlist = initializers.ToReadOnly(); ElementInit[] initList = new ElementInit[initializerlist.Count]; for (int i = 0; i < initializerlist.Count; i++) { initList[i] = ElementInit(addMethod, initializerlist[i]); } return ListInit(newExpression, new TrueReadOnlyCollection<ElementInit>(initList)); } /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses specified <see cref="Expressions.ElementInit"/> objects to initialize a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="initializers">An array that contains <see cref="Expressions.ElementInit"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param> /// <returns> /// A <see cref="ListInitExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.ListInit"/> /// and the <see cref="ListInitExpression.NewExpression"/> and <see cref="ListInitExpression.Initializers"/> properties set to the specified values. /// </returns> /// <remarks> /// The <see cref="Type"/> property of <paramref name="newExpression"/> must represent a type that implements <see cref="Collections.IEnumerable"/>. /// The <see cref="Type"/> property of the resulting <see cref="ListInitExpression"/> is equal to <paramref name="newExpression"/>.Type. /// </remarks> public static ListInitExpression ListInit(NewExpression newExpression, params ElementInit[] initializers) { return ListInit(newExpression, (IEnumerable<ElementInit>)initializers); } /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses specified <see cref="Expressions.ElementInit"/> objects to initialize a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="initializers">An <see cref="IEnumerable{T}"/> that contains <see cref="Expressions.ElementInit"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param> /// <returns>An <see cref="IEnumerable{T}"/> that contains <see cref="Expressions.ElementInit"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</returns> /// <remarks> /// The <see cref="Type"/> property of <paramref name="newExpression"/> must represent a type that implements <see cref="Collections.IEnumerable"/>. /// The <see cref="Type"/> property of the resulting <see cref="ListInitExpression"/> is equal to <paramref name="newExpression"/>.Type. /// </remarks> public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable<ElementInit> initializers) { ContractUtils.RequiresNotNull(newExpression, nameof(newExpression)); ContractUtils.RequiresNotNull(initializers, nameof(initializers)); ReadOnlyCollection<ElementInit> initializerlist = initializers.ToReadOnly(); ValidateListInitArgs(newExpression.Type, initializerlist, nameof(newExpression)); return new ListInitExpression(newExpression, initializerlist); } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; using System.Reflection; using System.Runtime.CompilerServices; namespace System.Linq.Expressions { /// <summary> /// Represents a constructor call that has a collection initializer. /// </summary> /// <remarks> /// Use the <see cref="Expression.ListInit(NewExpression, Expression[])"/> factory methods to create a ListInitExpression. /// The value of the <see cref="NodeType" /> property of a ListInitExpression is ListInit. /// </remarks> [DebuggerTypeProxy(typeof(ListInitExpressionProxy))] public sealed class ListInitExpression : Expression { internal ListInitExpression(NewExpression newExpression, ReadOnlyCollection<ElementInit> initializers) { NewExpression = newExpression; Initializers = initializers; } /// <summary> /// Returns the node type of this <see cref="Expression"/>. (Inherited from <see cref="Expression"/>.) /// </summary> /// <returns>The <see cref="ExpressionType"/> that represents this expression.</returns> public sealed override ExpressionType NodeType => ExpressionType.ListInit; /// <summary> /// Gets the static type of the expression that this <see cref="Expression"/> represents. (Inherited from <see cref="Expression"/>.) /// </summary> /// <returns>The <see cref="System.Type"/> that represents the static type of the expression.</returns> public sealed override Type Type => NewExpression.Type; /// <summary> /// Gets a value that indicates whether the expression tree node can be reduced. /// </summary> public override bool CanReduce => true; /// <summary> /// Gets the expression that contains a call to the constructor of a collection type. /// </summary> public NewExpression NewExpression { get; } /// <summary> /// Gets the element initializers that are used to initialize a collection. /// </summary> public ReadOnlyCollection<ElementInit> Initializers { get; } /// <summary> /// Dispatches to the specific visit method for this node type. /// </summary> protected internal override Expression Accept(ExpressionVisitor visitor) { return visitor.VisitListInit(this); } /// <summary> /// Reduces the binary expression node to a simpler expression. /// If CanReduce returns true, this should return a valid expression. /// This method is allowed to return another node which itself /// must be reduced. /// </summary> /// <returns>The reduced expression.</returns> public override Expression Reduce() { return MemberInitExpression.ReduceListInit(NewExpression, Initializers, keepOnStack: true); } /// <summary> /// Creates a new expression that is like this one, but using the /// supplied children. If all of the children are the same, it will /// return this expression. /// </summary> /// <param name="newExpression">The <see cref="NewExpression"/> property of the result.</param> /// <param name="initializers">The <see cref="Initializers"/> property of the result.</param> /// <returns>This expression if no children changed, or an expression with the updated children.</returns> public ListInitExpression Update(NewExpression newExpression, IEnumerable<ElementInit> initializers) { if (newExpression == NewExpression && initializers != null) { if (ExpressionUtils.SameElements(ref initializers!, Initializers)) { return this; } } return ListInit(newExpression, initializers!); } } public partial class Expression { /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses a method named "Add" to add elements to a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="initializers">An array of <see cref="Expression"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param> /// <returns>A <see cref="ListInitExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.ListInit"/> and the <see cref="ListInitExpression.NewExpression"/> property set to the specified value.</returns> [RequiresUnreferencedCode(ExpressionRequiresUnreferencedCode)] public static ListInitExpression ListInit(NewExpression newExpression, params Expression[] initializers) { return ListInit(newExpression, initializers as IEnumerable<Expression>); } /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses a method named "Add" to add elements to a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="initializers">An <see cref="IEnumerable{T}"/> that contains <see cref="Expressions.ElementInit"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param> /// <returns>A <see cref="ListInitExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.ListInit"/> and the <see cref="ListInitExpression.NewExpression"/> property set to the specified value.</returns> [RequiresUnreferencedCode(ExpressionRequiresUnreferencedCode)] public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable<Expression> initializers) { ContractUtils.RequiresNotNull(newExpression, nameof(newExpression)); ContractUtils.RequiresNotNull(initializers, nameof(initializers)); ReadOnlyCollection<Expression> initializerlist = initializers.ToReadOnly(); if (initializerlist.Count == 0) { return new ListInitExpression(newExpression, EmptyReadOnlyCollection<ElementInit>.Instance); } MethodInfo? addMethod = FindMethod(newExpression.Type, "Add", null, new Expression[] { initializerlist[0] }, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); return ListInit(newExpression, addMethod, initializerlist); } /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses a specified method to add elements to a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="addMethod">A <see cref="MethodInfo"/> that represents an instance method named "Add" (case insensitive), that adds an element to a collection.</param> /// <param name="initializers">An array of <see cref="Expression"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param> /// <returns>A <see cref="ListInitExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.ListInit"/> and the <see cref="ListInitExpression.NewExpression"/> property set to the specified value.</returns> [RequiresUnreferencedCode(ExpressionRequiresUnreferencedCode)] public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo? addMethod, params Expression[] initializers) { return ListInit(newExpression, addMethod, initializers as IEnumerable<Expression>); } /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses a specified method to add elements to a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="addMethod">A <see cref="MethodInfo"/> that represents an instance method named "Add" (case insensitive), that adds an element to a collection.</param> /// <param name="initializers">An <see cref="IEnumerable{T}"/> that contains <see cref="Expression"/> objects to use to populate the Initializers collection.</param> /// <returns>A <see cref="ListInitExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.ListInit"/> and the <see cref="ListInitExpression.NewExpression"/> property set to the specified value.</returns> [RequiresUnreferencedCode(ExpressionRequiresUnreferencedCode)] public static ListInitExpression ListInit(NewExpression newExpression, MethodInfo? addMethod, IEnumerable<Expression> initializers) { if (addMethod == null) { return ListInit(newExpression, initializers); } ContractUtils.RequiresNotNull(newExpression, nameof(newExpression)); ContractUtils.RequiresNotNull(initializers, nameof(initializers)); ReadOnlyCollection<Expression> initializerlist = initializers.ToReadOnly(); ElementInit[] initList = new ElementInit[initializerlist.Count]; for (int i = 0; i < initializerlist.Count; i++) { initList[i] = ElementInit(addMethod, initializerlist[i]); } return ListInit(newExpression, new TrueReadOnlyCollection<ElementInit>(initList)); } /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses specified <see cref="Expressions.ElementInit"/> objects to initialize a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="initializers">An array that contains <see cref="Expressions.ElementInit"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param> /// <returns> /// A <see cref="ListInitExpression"/> that has the <see cref="NodeType"/> property equal to <see cref="ExpressionType.ListInit"/> /// and the <see cref="ListInitExpression.NewExpression"/> and <see cref="ListInitExpression.Initializers"/> properties set to the specified values. /// </returns> /// <remarks> /// The <see cref="Type"/> property of <paramref name="newExpression"/> must represent a type that implements <see cref="Collections.IEnumerable"/>. /// The <see cref="Type"/> property of the resulting <see cref="ListInitExpression"/> is equal to <paramref name="newExpression"/>.Type. /// </remarks> public static ListInitExpression ListInit(NewExpression newExpression, params ElementInit[] initializers) { return ListInit(newExpression, (IEnumerable<ElementInit>)initializers); } /// <summary> /// Creates a <see cref="ListInitExpression"/> that uses specified <see cref="Expressions.ElementInit"/> objects to initialize a collection. /// </summary> /// <param name="newExpression">A <see cref="NewExpression"/> to set the <see cref="ListInitExpression.NewExpression"/> property equal to.</param> /// <param name="initializers">An <see cref="IEnumerable{T}"/> that contains <see cref="Expressions.ElementInit"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</param> /// <returns>An <see cref="IEnumerable{T}"/> that contains <see cref="Expressions.ElementInit"/> objects to use to populate the <see cref="ListInitExpression.Initializers"/> collection.</returns> /// <remarks> /// The <see cref="Type"/> property of <paramref name="newExpression"/> must represent a type that implements <see cref="Collections.IEnumerable"/>. /// The <see cref="Type"/> property of the resulting <see cref="ListInitExpression"/> is equal to <paramref name="newExpression"/>.Type. /// </remarks> public static ListInitExpression ListInit(NewExpression newExpression, IEnumerable<ElementInit> initializers) { ContractUtils.RequiresNotNull(newExpression, nameof(newExpression)); ContractUtils.RequiresNotNull(initializers, nameof(initializers)); ReadOnlyCollection<ElementInit> initializerlist = initializers.ToReadOnly(); ValidateListInitArgs(newExpression.Type, initializerlist, nameof(newExpression)); return new ListInitExpression(newExpression, initializerlist); } } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/tests/Interop/PInvoke/SizeParamIndex/ReversePInvoke/PassingByRef/ReversePInvokePassingByRefNative.cpp
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // ReversePInvokePassingByRefNative.cpp : Defines the entry point for the DLL application. #include <xplatform.h> #include <limits.h> #include "platformdefines.h" #include "helper.h" //Func Pointer typedef BOOL (__cdecl *DelByteArrByRefAsCdeclCaller)(BYTE** arrByte, BYTE* arraySize); typedef BOOL (__cdecl *DelSbyteArrByRefAsCdeclCaller)(CHAR* arraySize, CHAR** arrSbyte); typedef BOOL (__cdecl *DelShortArrByRefAsCdeclCaller)(SHORT** arrShort, SHORT* arraySize); typedef BOOL (__cdecl *DelUshortArrByRefAsCdeclCaller)(USHORT** arrUshort, USHORT* arraySize); typedef BOOL (__cdecl *DelInt32ArrByRefAsCdeclCaller)(LONG** arrInt32, LONG* arraySize); typedef BOOL (__cdecl *DelUint32ArrByRefAsCdeclCaller)(ULONG** arrUint32, ULONG* arraySize); typedef BOOL (__cdecl *DelLongArrByRefAsCdeclCaller)(LONGLONG** arrLong, LONGLONG* arraySize); typedef BOOL (__cdecl *DelUlongArrByRefAsCdeclCaller)(ULONGLONG** arrUlong, ULONGLONG* arraySize); typedef BOOL (__cdecl *DelStringArrByRefAsCdeclCaller)(BSTR** arrString, LONG* arraySize); //####################################################### //Test Method //####################################################### //BYTE 0 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalByteArray_AsParam_AsByRef(DelByteArrByRefAsCdeclCaller caller) { BYTE arrSize = 0; BYTE* arrByte = InitArray<BYTE>(arrSize); if(!caller(&arrByte, &arrSize)) { printf("DoCallBack_MarshalByteArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrByte); return FALSE; } return CheckArray(arrByte, arrSize, (BYTE)20); } //CHAR 1 ==> CHAR.Max size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalSbyteArray_AsParam_AsByRef(DelSbyteArrByRefAsCdeclCaller caller) { CHAR arrSize = 1; CHAR* arrSbyte = InitArray<CHAR>((size_t)arrSize); if(!caller(&arrSize, &arrSbyte)) { printf("DoCallBack_MarshalSbyteArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrSbyte); return FALSE; } return CheckArray(arrSbyte, (size_t)arrSize, (CHAR)127); } //SHORT -1 ==> 20 size Array(Actual: 10 ==> 20) extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalShortArray_AsParam_AsByRef(DelShortArrByRefAsCdeclCaller caller) { SHORT arrSize = -1; SHORT* arrShort = InitArray<SHORT>(SHORT(10)); if(!caller(&arrShort, &arrSize)) { printf("DoCallBack_MarshalShortArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrShort); return FALSE; } return CheckArray(arrShort, (size_t)arrSize, (SHORT)20); } //SHORT 10 ==> -1 size Array(Actual: 10 ==> 20) extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByRef(DelShortArrByRefAsCdeclCaller caller) { SHORT arrSize = 10; SHORT* arrShort = InitArray<SHORT>((size_t)arrSize); if(!caller(&arrShort, &arrSize)) { printf("DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrShort); return FALSE; } if(arrSize == -1) return CheckArray(arrShort, (SHORT)20, (SHORT)20); else return FALSE; } //USHORT ushort.Max ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalUshortArray_AsParam_AsByRef(DelUshortArrByRefAsCdeclCaller caller) { USHORT arrSize = 65535; USHORT* arrUshort = InitArray<USHORT>(arrSize); if(!caller(&arrUshort, &arrSize)) { printf("DoCallBack_MarshalUshortArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrUshort); return FALSE; } return CheckArray(arrUshort, arrSize, (USHORT)20); } //Int32 10 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalInt32Array_AsParam_AsByRef(DelInt32ArrByRefAsCdeclCaller caller) { LONG arrSize = 10; LONG* arrInt32 = InitArray<LONG>((size_t)arrSize); if(!caller(&arrInt32, &arrSize)) { printf("DoCallBack_MarshalInt32Array_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrInt32); return FALSE; } return CheckArray(arrInt32, (size_t)arrSize, (LONG)20); } //UInt32 10 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalUint32Array_AsParam_AsByRef(DelUint32ArrByRefAsCdeclCaller caller) { ULONG arrSize = 10; ULONG* arrUint32 = InitArray<ULONG>(arrSize); if(!caller(&arrUint32, &arrSize)) { printf("DoCallBack_MarshalUint32Array_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrUint32); return FALSE; } return CheckArray(arrUint32, arrSize, (ULONG)20); } //LONGLONG 10 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalLongArray_AsParam_AsByRef(DelLongArrByRefAsCdeclCaller caller) { LONGLONG arrSize = 10; LONGLONG* arrLong = InitArray<LONGLONG>(SIZE_T(arrSize)); if(!caller(&arrLong, &arrSize)) { printf("DoCallBack_MarshalLongArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrLong); return FALSE; } return CheckArray(arrLong, (SIZE_T)arrSize, 20); } //ULONGLONG 10 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalUlongArray_AsParam_AsByRef(DelUlongArrByRefAsCdeclCaller caller) { ULONGLONG arrSize = 10; ULONGLONG* arrUlong = InitArray<ULONGLONG>(SIZE_T(arrSize)); if(!caller(&arrUlong, &arrSize)) { printf("DoCallBack_MarshalUlongArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrUlong); return FALSE; } return CheckArray(arrUlong, (SIZE_T)arrSize, 20); } #ifdef _WIN32 //BSTR 10 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalStringArray_AsParam_AsByRef(DelStringArrByRefAsCdeclCaller caller) { LONG arrSize = 10; BSTR* arrString = InitArrayBSTR(arrSize); if(!caller(&arrString, &arrSize)) { printf("DoCallBack_MarshalStringArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrString); return FALSE; } LONG ExpectedArraySize = 20; BSTR* pExpectedArr = (BSTR*)CoreClrAlloc(sizeof(BSTR)*ExpectedArraySize); for(LONG i = 0; i < ExpectedArraySize; ++i) { pExpectedArr[i] = ToBSTR(ExpectedArraySize - 1 - i); } if(!EqualArrayBSTR(arrString, arrSize, pExpectedArr, ExpectedArraySize)) { printf("ManagedtoNative Error in Method: %s!\n",__FUNCTION__); return FALSE; } CoreClrFree(arrString); CoreClrFree(pExpectedArr); return TRUE; } #endif
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // ReversePInvokePassingByRefNative.cpp : Defines the entry point for the DLL application. #include <xplatform.h> #include <limits.h> #include "platformdefines.h" #include "helper.h" //Func Pointer typedef BOOL (__cdecl *DelByteArrByRefAsCdeclCaller)(BYTE** arrByte, BYTE* arraySize); typedef BOOL (__cdecl *DelSbyteArrByRefAsCdeclCaller)(CHAR* arraySize, CHAR** arrSbyte); typedef BOOL (__cdecl *DelShortArrByRefAsCdeclCaller)(SHORT** arrShort, SHORT* arraySize); typedef BOOL (__cdecl *DelUshortArrByRefAsCdeclCaller)(USHORT** arrUshort, USHORT* arraySize); typedef BOOL (__cdecl *DelInt32ArrByRefAsCdeclCaller)(LONG** arrInt32, LONG* arraySize); typedef BOOL (__cdecl *DelUint32ArrByRefAsCdeclCaller)(ULONG** arrUint32, ULONG* arraySize); typedef BOOL (__cdecl *DelLongArrByRefAsCdeclCaller)(LONGLONG** arrLong, LONGLONG* arraySize); typedef BOOL (__cdecl *DelUlongArrByRefAsCdeclCaller)(ULONGLONG** arrUlong, ULONGLONG* arraySize); typedef BOOL (__cdecl *DelStringArrByRefAsCdeclCaller)(BSTR** arrString, LONG* arraySize); //####################################################### //Test Method //####################################################### //BYTE 0 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalByteArray_AsParam_AsByRef(DelByteArrByRefAsCdeclCaller caller) { BYTE arrSize = 0; BYTE* arrByte = InitArray<BYTE>(arrSize); if(!caller(&arrByte, &arrSize)) { printf("DoCallBack_MarshalByteArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrByte); return FALSE; } return CheckArray(arrByte, arrSize, (BYTE)20); } //CHAR 1 ==> CHAR.Max size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalSbyteArray_AsParam_AsByRef(DelSbyteArrByRefAsCdeclCaller caller) { CHAR arrSize = 1; CHAR* arrSbyte = InitArray<CHAR>((size_t)arrSize); if(!caller(&arrSize, &arrSbyte)) { printf("DoCallBack_MarshalSbyteArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrSbyte); return FALSE; } return CheckArray(arrSbyte, (size_t)arrSize, (CHAR)127); } //SHORT -1 ==> 20 size Array(Actual: 10 ==> 20) extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalShortArray_AsParam_AsByRef(DelShortArrByRefAsCdeclCaller caller) { SHORT arrSize = -1; SHORT* arrShort = InitArray<SHORT>(SHORT(10)); if(!caller(&arrShort, &arrSize)) { printf("DoCallBack_MarshalShortArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrShort); return FALSE; } return CheckArray(arrShort, (size_t)arrSize, (SHORT)20); } //SHORT 10 ==> -1 size Array(Actual: 10 ==> 20) extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByRef(DelShortArrByRefAsCdeclCaller caller) { SHORT arrSize = 10; SHORT* arrShort = InitArray<SHORT>((size_t)arrSize); if(!caller(&arrShort, &arrSize)) { printf("DoCallBack_MarshalShortArrayReturnNegativeSize_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrShort); return FALSE; } if(arrSize == -1) return CheckArray(arrShort, (SHORT)20, (SHORT)20); else return FALSE; } //USHORT ushort.Max ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalUshortArray_AsParam_AsByRef(DelUshortArrByRefAsCdeclCaller caller) { USHORT arrSize = 65535; USHORT* arrUshort = InitArray<USHORT>(arrSize); if(!caller(&arrUshort, &arrSize)) { printf("DoCallBack_MarshalUshortArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrUshort); return FALSE; } return CheckArray(arrUshort, arrSize, (USHORT)20); } //Int32 10 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalInt32Array_AsParam_AsByRef(DelInt32ArrByRefAsCdeclCaller caller) { LONG arrSize = 10; LONG* arrInt32 = InitArray<LONG>((size_t)arrSize); if(!caller(&arrInt32, &arrSize)) { printf("DoCallBack_MarshalInt32Array_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrInt32); return FALSE; } return CheckArray(arrInt32, (size_t)arrSize, (LONG)20); } //UInt32 10 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalUint32Array_AsParam_AsByRef(DelUint32ArrByRefAsCdeclCaller caller) { ULONG arrSize = 10; ULONG* arrUint32 = InitArray<ULONG>(arrSize); if(!caller(&arrUint32, &arrSize)) { printf("DoCallBack_MarshalUint32Array_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrUint32); return FALSE; } return CheckArray(arrUint32, arrSize, (ULONG)20); } //LONGLONG 10 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalLongArray_AsParam_AsByRef(DelLongArrByRefAsCdeclCaller caller) { LONGLONG arrSize = 10; LONGLONG* arrLong = InitArray<LONGLONG>(SIZE_T(arrSize)); if(!caller(&arrLong, &arrSize)) { printf("DoCallBack_MarshalLongArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrLong); return FALSE; } return CheckArray(arrLong, (SIZE_T)arrSize, 20); } //ULONGLONG 10 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalUlongArray_AsParam_AsByRef(DelUlongArrByRefAsCdeclCaller caller) { ULONGLONG arrSize = 10; ULONGLONG* arrUlong = InitArray<ULONGLONG>(SIZE_T(arrSize)); if(!caller(&arrUlong, &arrSize)) { printf("DoCallBack_MarshalUlongArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrUlong); return FALSE; } return CheckArray(arrUlong, (SIZE_T)arrSize, 20); } #ifdef _WIN32 //BSTR 10 ==> 20 size Array extern "C" DLL_EXPORT BOOL __cdecl DoCallBack_MarshalStringArray_AsParam_AsByRef(DelStringArrByRefAsCdeclCaller caller) { LONG arrSize = 10; BSTR* arrString = InitArrayBSTR(arrSize); if(!caller(&arrString, &arrSize)) { printf("DoCallBack_MarshalStringArray_AsParam_AsByRef:\n\tThe Caller returns wrong value\n"); CoreClrFree(arrString); return FALSE; } LONG ExpectedArraySize = 20; BSTR* pExpectedArr = (BSTR*)CoreClrAlloc(sizeof(BSTR)*ExpectedArraySize); for(LONG i = 0; i < ExpectedArraySize; ++i) { pExpectedArr[i] = ToBSTR(ExpectedArraySize - 1 - i); } if(!EqualArrayBSTR(arrString, arrSize, pExpectedArr, ExpectedArraySize)) { printf("ManagedtoNative Error in Method: %s!\n",__FUNCTION__); return FALSE; } CoreClrFree(arrString); CoreClrFree(pExpectedArr); return TRUE; } #endif
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/ComTypes/FORMATETC.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; namespace System.Runtime.InteropServices.ComTypes { [EditorBrowsable(EditorBrowsableState.Never)] public struct FORMATETC { [MarshalAs(UnmanagedType.U2)] public short cfFormat; public IntPtr ptd; [MarshalAs(UnmanagedType.U4)] public DVASPECT dwAspect; public int lindex; [MarshalAs(UnmanagedType.U4)] public TYMED tymed; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; namespace System.Runtime.InteropServices.ComTypes { [EditorBrowsable(EditorBrowsableState.Never)] public struct FORMATETC { [MarshalAs(UnmanagedType.U2)] public short cfFormat; public IntPtr ptd; [MarshalAs(UnmanagedType.U4)] public DVASPECT dwAspect; public int lindex; [MarshalAs(UnmanagedType.U4)] public TYMED tymed; } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/tests/baseservices/exceptions/unittests/EHPatternTests.csproj
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="EHPatternTests.cs" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> <CLRTestPriority>1</CLRTestPriority> </PropertyGroup> <ItemGroup> <Compile Include="EHPatternTests.cs" /> </ItemGroup> </Project>
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/mono/mono/tests/verifier/make_prefix_test.sh
#! /bin/sh SED="sed" if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi TEST_NAME=$1 TEST_VALIDITY=$2 TEST_OP=$3 TEST_LOAD_OP=$4 TEST_TYPE=$5 TEST_FILE=`echo ${TEST_VALIDITY}_${TEST_NAME} | $SED -e 's/ /_/g' -e 's/\./_/g' -e 's/&/mp/g' -e 's/\[/_/g' -e 's/\]/_/g'`_generated.il echo $TEST_FILE $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/BEFORE_OP/${TEST_BEFORE_OP}/g" -e "s/LOAD_OP/${TEST_LOAD_OP}/g"> $TEST_FILE <<//EOF .assembly extern mscorlib { .ver 2:0:0:0 .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. } .assembly 'prefix_test' { .hash algorithm 0x00008004 .ver 0:0:0:0 } .module cmmp.exe .class ClassA extends [mscorlib]System.Object { .field public int32 valid .method public hidebysig specialname rtspecialname instance default void .ctor (int32&) cil managed { .maxstack 8 ldarg.0 call instance void object::.ctor() ret } .method public virtual void VirtTest (ClassA& arg) { ret } } .class public Template\`1<T> extends [mscorlib]System.Object { } .class sealed public StructTemplate\`1<T> extends [mscorlib]System.ValueType { .field public !0 t } .class sealed public StructTemplate2\`1<T> extends [mscorlib]System.ValueType { .field public !0 t } .class public auto ansi sealed MyStruct extends [mscorlib]System.ValueType { .field public int32 foo .field public static int32 stFoo .field public native int ptr .method public static void Test () { ret } } .class public auto ansi sealed MyEnum extends [mscorlib]System.Enum { .field public specialname rtspecialname int32 value__ .field public static literal valuetype MyEnum B = int32(0x00000000) .field public static literal valuetype MyEnum C = int32(0x00000001) } .method public static int32 Main () { .entrypoint .maxstack 8 .locals init (TYPE V_0) LOAD_OP OPCODE leave END END: ldc.i4.0 ret } //EOF
#! /bin/sh SED="sed" if [ `which gsed 2> /dev/null` ]; then SED="gsed" fi TEST_NAME=$1 TEST_VALIDITY=$2 TEST_OP=$3 TEST_LOAD_OP=$4 TEST_TYPE=$5 TEST_FILE=`echo ${TEST_VALIDITY}_${TEST_NAME} | $SED -e 's/ /_/g' -e 's/\./_/g' -e 's/&/mp/g' -e 's/\[/_/g' -e 's/\]/_/g'`_generated.il echo $TEST_FILE $SED -e "s/TYPE/${TEST_TYPE}/g" -e "s/OPCODE/${TEST_OP}/g" -e "s/BEFORE_OP/${TEST_BEFORE_OP}/g" -e "s/LOAD_OP/${TEST_LOAD_OP}/g"> $TEST_FILE <<//EOF .assembly extern mscorlib { .ver 2:0:0:0 .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. } .assembly 'prefix_test' { .hash algorithm 0x00008004 .ver 0:0:0:0 } .module cmmp.exe .class ClassA extends [mscorlib]System.Object { .field public int32 valid .method public hidebysig specialname rtspecialname instance default void .ctor (int32&) cil managed { .maxstack 8 ldarg.0 call instance void object::.ctor() ret } .method public virtual void VirtTest (ClassA& arg) { ret } } .class public Template\`1<T> extends [mscorlib]System.Object { } .class sealed public StructTemplate\`1<T> extends [mscorlib]System.ValueType { .field public !0 t } .class sealed public StructTemplate2\`1<T> extends [mscorlib]System.ValueType { .field public !0 t } .class public auto ansi sealed MyStruct extends [mscorlib]System.ValueType { .field public int32 foo .field public static int32 stFoo .field public native int ptr .method public static void Test () { ret } } .class public auto ansi sealed MyEnum extends [mscorlib]System.Enum { .field public specialname rtspecialname int32 value__ .field public static literal valuetype MyEnum B = int32(0x00000000) .field public static literal valuetype MyEnum C = int32(0x00000001) } .method public static int32 Main () { .entrypoint .maxstack 8 .locals init (TYPE V_0) LOAD_OP OPCODE leave END END: ldc.i4.0 ret } //EOF
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/coreclr/debug/di/classfactory.h
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. //***************************************************************************** // ClassFactory.h // // // Class factories are used by the pluming in COM to activate new objects. // This module contains the class factory code to instantiate the debugger // objects described in RSPriv.h. // //***************************************************************************** #ifndef __ClassFactory__h__ #define __ClassFactory__h__ #include "rspriv.h" // This typedef is for a function which will create a new instance of an object. typedef HRESULT (STDMETHODCALLTYPE * PFN_CREATE_OBJ)(REFIID riid, void **ppvObject); //***************************************************************************** // One class factory object satifies all of our clsid's, to reduce overall // code bloat. //***************************************************************************** class CClassFactory : public IClassFactory { CClassFactory() { } // Can't use without data. public: CClassFactory(PFN_CREATE_OBJ pfnCreateObject) : m_cRef(1), m_pfnCreateObject(pfnCreateObject) { } virtual ~CClassFactory() {} // // IUnknown methods. // virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, void **ppvObject); virtual ULONG STDMETHODCALLTYPE AddRef() { return (InterlockedIncrement(&m_cRef)); } virtual ULONG STDMETHODCALLTYPE Release() { LONG cRef = InterlockedDecrement(&m_cRef); if (cRef <= 0) delete this; return (cRef); } // // IClassFactory methods. // virtual HRESULT STDMETHODCALLTYPE CreateInstance( IUnknown *pUnkOuter, REFIID riid, void **ppvObject); virtual HRESULT STDMETHODCALLTYPE LockServer( BOOL fLock); private: LONG m_cRef; // Reference count. PFN_CREATE_OBJ m_pfnCreateObject; // Creation function for an instance. }; #endif // __ClassFactory__h__
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. //***************************************************************************** // ClassFactory.h // // // Class factories are used by the pluming in COM to activate new objects. // This module contains the class factory code to instantiate the debugger // objects described in RSPriv.h. // //***************************************************************************** #ifndef __ClassFactory__h__ #define __ClassFactory__h__ #include "rspriv.h" // This typedef is for a function which will create a new instance of an object. typedef HRESULT (STDMETHODCALLTYPE * PFN_CREATE_OBJ)(REFIID riid, void **ppvObject); //***************************************************************************** // One class factory object satifies all of our clsid's, to reduce overall // code bloat. //***************************************************************************** class CClassFactory : public IClassFactory { CClassFactory() { } // Can't use without data. public: CClassFactory(PFN_CREATE_OBJ pfnCreateObject) : m_cRef(1), m_pfnCreateObject(pfnCreateObject) { } virtual ~CClassFactory() {} // // IUnknown methods. // virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID riid, void **ppvObject); virtual ULONG STDMETHODCALLTYPE AddRef() { return (InterlockedIncrement(&m_cRef)); } virtual ULONG STDMETHODCALLTYPE Release() { LONG cRef = InterlockedDecrement(&m_cRef); if (cRef <= 0) delete this; return (cRef); } // // IClassFactory methods. // virtual HRESULT STDMETHODCALLTYPE CreateInstance( IUnknown *pUnkOuter, REFIID riid, void **ppvObject); virtual HRESULT STDMETHODCALLTYPE LockServer( BOOL fLock); private: LONG m_cRef; // Reference count. PFN_CREATE_OBJ m_pfnCreateObject; // Creation function for an instance. }; #endif // __ClassFactory__h__
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/tests/baseservices/exceptions/generics/try-filter02.il
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // Microsoft (R) .NET Framework IL Disassembler. Version 1.2.2211.0 // Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} .assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } .assembly 'try-filter02' { // --- The following custom attribute is added automatically, do not uncomment ------- // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(bool, // bool) = ( 01 00 00 01 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } // MVID: {76712D77-A992-40B1-9AD0-E58BD9DA334B} .imagebase 0x00400000 .subsystem 0x00000003 .file alignment 512 .corflags 0x00000001 // Image base: 0x02DB0000 // =============== CLASS MEMBERS DECLARATION =================== .class public sequential ansi sealed beforefieldinit ValX0 extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValX0 .class public sequential ansi sealed beforefieldinit ValY0 extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValY0 .class public sequential ansi sealed beforefieldinit ValX1<([mscorlib]System.Object) T> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValX1 .class public sequential ansi sealed beforefieldinit ValY1<([mscorlib]System.Object) T> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValY1 .class public sequential ansi sealed beforefieldinit ValX2<([mscorlib]System.Object) T,([mscorlib]System.Object) U> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValX2 .class public sequential ansi sealed beforefieldinit ValY2<([mscorlib]System.Object) T,([mscorlib]System.Object) U> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValY2 .class public sequential ansi sealed beforefieldinit ValX3<([mscorlib]System.Object) T,([mscorlib]System.Object) U,([mscorlib]System.Object) V> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValX3 .class public sequential ansi sealed beforefieldinit ValY3<([mscorlib]System.Object) T,([mscorlib]System.Object) U,([mscorlib]System.Object) V> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValY3 .class public auto ansi beforefieldinit RefX0 extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefX0::.ctor } // end of class RefX0 .class public auto ansi beforefieldinit RefY0 extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefY0::.ctor } // end of class RefY0 .class public auto ansi beforefieldinit RefX1<([mscorlib]System.Object) T> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefX1::.ctor } // end of class RefX1 .class public auto ansi beforefieldinit RefY1<([mscorlib]System.Object) T> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefY1::.ctor } // end of class RefY1 .class public auto ansi beforefieldinit RefX2<([mscorlib]System.Object) T,([mscorlib]System.Object) U> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefX2::.ctor } // end of class RefX2 .class public auto ansi beforefieldinit RefY2<([mscorlib]System.Object) T,([mscorlib]System.Object) U> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefY2::.ctor } // end of class RefY2 .class public auto ansi beforefieldinit RefX3<([mscorlib]System.Object) T,([mscorlib]System.Object) U,([mscorlib]System.Object) V> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefX3::.ctor } // end of class RefX3 .class public auto ansi beforefieldinit RefY3<([mscorlib]System.Object) T,([mscorlib]System.Object) U,([mscorlib]System.Object) V> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefY3::.ctor } // end of class RefY3 .class public auto ansi beforefieldinit GenException<([mscorlib]System.Object) T> extends [mscorlib]System.Exception { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ret } // end of method GenException::.ctor } // end of class GenException .class public auto ansi beforefieldinit Gen<([mscorlib]System.Object) T> extends [mscorlib]System.Object { .method public hidebysig instance void InternalExceptionTest(bool throwException) cil managed { // Code size 54 (0x36) .maxstack 2 .locals init (string V_0, class [mscorlib]System.Exception V_1, bool V_2) IL_0000: ldtoken class GenException<!0> IL_0005: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) IL_000a: callvirt instance string [mscorlib]System.Type::ToString() IL_000f: stloc.0 .try { ldc.i4.1 stloc.2 IL_0010: ldarg.1 IL_0011: brfalse.s IL_0019 IL_0013: newobj instance void class GenException<!0>::.ctor() IL_0018: throw IL_0019: ldarg.1 IL_001a: brfalse.s IL_0022 IL_001c: ldc.i4.0 IL_001d: call void Test_try_filter02::Eval(bool) IL_0022: leave.s Exit } // end .try filter { stloc.1 ldloc.1 isinst class GenException<!0> ldnull cgt.un call void Test_try_filter02::Eval(bool) ldc.i4.0 endfilter } { pop ldc.i4.0 stloc.2 leave Exit } Exit: ldloc.2 call void Test_try_filter02::Eval(bool) ret } // end of method Gen::InternalExceptionTest .method public hidebysig instance void ExceptionTest(bool throwException) cil managed { // Code size 28 (0x1c) .maxstack 2 .try { IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call instance void class Gen<!0>::InternalExceptionTest(bool) IL_0007: ldarg.1 IL_0008: ldc.i4.0 IL_0009: ceq IL_000b: call void Test_try_filter02::Eval(bool) IL_0010: leave.s IL_001b } // end .try catch [mscorlib]System.Object { IL_0012: pop IL_0013: ldarg.1 IL_0014: call void Test_try_filter02::Eval(bool) IL_0019: leave.s IL_001b } // end handler IL_001b: ret } // end of method Gen::ExceptionTest .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method Gen::.ctor } // end of class Gen .class public auto ansi beforefieldinit Test_try_filter02 extends [mscorlib]System.Object { .field public static int32 counter .field public static bool result .method public hidebysig static void Eval(bool exp) cil managed { // Code size 47 (0x2f) .maxstack 8 IL_0000: ldsfld int32 Test_try_filter02::counter IL_0005: ldc.i4.1 IL_0006: add IL_0007: stsfld int32 Test_try_filter02::counter IL_000c: ldarg.0 IL_000d: brtrue.s IL_002e IL_000f: ldarg.0 IL_0010: stsfld bool Test_try_filter02::result IL_0015: ldstr "Test Failed at location: " IL_001a: ldsfld int32 Test_try_filter02::counter IL_001f: box [mscorlib]System.Int32 IL_0024: call string [mscorlib]System.String::Concat(object, object) IL_0029: call void [System.Console]System.Console::WriteLine(string) IL_002e: ret } // end of method Test::Eval .method public hidebysig static int32 Main() cil managed { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) .entrypoint // Code size 588 (0x24c) .maxstack 2 .locals init (int32 V_0) IL_0000: newobj instance void class Gen<int32>::.ctor() IL_0005: ldc.i4.1 IL_0006: call instance void class Gen<int32>::ExceptionTest(bool) IL_000b: newobj instance void class Gen<float64>::.ctor() IL_0010: ldc.i4.1 IL_0011: call instance void class Gen<float64>::ExceptionTest(bool) IL_0016: newobj instance void class Gen<string>::.ctor() IL_001b: ldc.i4.1 IL_001c: call instance void class Gen<string>::ExceptionTest(bool) IL_0021: newobj instance void class Gen<object>::.ctor() IL_0026: ldc.i4.1 IL_0027: call instance void class Gen<object>::ExceptionTest(bool) IL_002c: newobj instance void class Gen<valuetype [mscorlib]System.Guid>::.ctor() IL_0031: ldc.i4.1 IL_0032: call instance void class Gen<valuetype [mscorlib]System.Guid>::ExceptionTest(bool) IL_0037: newobj instance void class Gen<int32[]>::.ctor() IL_003c: ldc.i4.1 IL_003d: call instance void class Gen<int32[]>::ExceptionTest(bool) IL_0042: newobj instance void class Gen<float64[0...,0...]>::.ctor() IL_0047: ldc.i4.1 IL_0048: call instance void class Gen<float64[0...,0...]>::ExceptionTest(bool) IL_004d: newobj instance void class Gen<string[][][]>::.ctor() IL_0052: ldc.i4.1 IL_0053: call instance void class Gen<string[][][]>::ExceptionTest(bool) IL_0058: newobj instance void class Gen<object[0...,0...,0...,0...]>::.ctor() IL_005d: ldc.i4.1 IL_005e: call instance void class Gen<object[0...,0...,0...,0...]>::ExceptionTest(bool) IL_0063: newobj instance void class Gen<valuetype [mscorlib]System.Guid[][0...,0...,0...,0...][]>::.ctor() IL_0068: ldc.i4.1 IL_0069: call instance void class Gen<valuetype [mscorlib]System.Guid[][0...,0...,0...,0...][]>::ExceptionTest(bool) IL_006e: newobj instance void class Gen<class RefX1<int32>[]>::.ctor() IL_0073: ldc.i4.1 IL_0074: call instance void class Gen<class RefX1<int32>[]>::ExceptionTest(bool) IL_0079: newobj instance void class Gen<class RefX1<float64>[0...,0...]>::.ctor() IL_007e: ldc.i4.1 IL_007f: call instance void class Gen<class RefX1<float64>[0...,0...]>::ExceptionTest(bool) IL_0084: newobj instance void class Gen<class RefX1<string>[][][]>::.ctor() IL_0089: ldc.i4.1 IL_008a: call instance void class Gen<class RefX1<string>[][][]>::ExceptionTest(bool) IL_008f: newobj instance void class Gen<class RefX1<object>[0...,0...,0...,0...]>::.ctor() IL_0094: ldc.i4.1 IL_0095: call instance void class Gen<class RefX1<object>[0...,0...,0...,0...]>::ExceptionTest(bool) IL_009a: newobj instance void class Gen<class RefX1<valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::.ctor() IL_009f: ldc.i4.1 IL_00a0: call instance void class Gen<class RefX1<valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::ExceptionTest(bool) IL_00a5: newobj instance void class Gen<class RefX2<int32,int32>[]>::.ctor() IL_00aa: ldc.i4.1 IL_00ab: call instance void class Gen<class RefX2<int32,int32>[]>::ExceptionTest(bool) IL_00b0: newobj instance void class Gen<class RefX2<float64,float64>[0...,0...]>::.ctor() IL_00b5: ldc.i4.1 IL_00b6: call instance void class Gen<class RefX2<float64,float64>[0...,0...]>::ExceptionTest(bool) IL_00bb: newobj instance void class Gen<class RefX2<string,string>[][][]>::.ctor() IL_00c0: ldc.i4.1 IL_00c1: call instance void class Gen<class RefX2<string,string>[][][]>::ExceptionTest(bool) IL_00c6: newobj instance void class Gen<class RefX2<object,object>[0...,0...,0...,0...]>::.ctor() IL_00cb: ldc.i4.1 IL_00cc: call instance void class Gen<class RefX2<object,object>[0...,0...,0...,0...]>::ExceptionTest(bool) IL_00d1: newobj instance void class Gen<class RefX2<valuetype [mscorlib]System.Guid,valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::.ctor() IL_00d6: ldc.i4.1 IL_00d7: call instance void class Gen<class RefX2<valuetype [mscorlib]System.Guid,valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::ExceptionTest(bool) IL_00dc: newobj instance void class Gen<valuetype ValX1<int32>[]>::.ctor() IL_00e1: ldc.i4.1 IL_00e2: call instance void class Gen<valuetype ValX1<int32>[]>::ExceptionTest(bool) IL_00e7: newobj instance void class Gen<valuetype ValX1<float64>[0...,0...]>::.ctor() IL_00ec: ldc.i4.1 IL_00ed: call instance void class Gen<valuetype ValX1<float64>[0...,0...]>::ExceptionTest(bool) IL_00f2: newobj instance void class Gen<valuetype ValX1<string>[][][]>::.ctor() IL_00f7: ldc.i4.1 IL_00f8: call instance void class Gen<valuetype ValX1<string>[][][]>::ExceptionTest(bool) IL_00fd: newobj instance void class Gen<valuetype ValX1<object>[0...,0...,0...,0...]>::.ctor() IL_0102: ldc.i4.1 IL_0103: call instance void class Gen<valuetype ValX1<object>[0...,0...,0...,0...]>::ExceptionTest(bool) IL_0108: newobj instance void class Gen<valuetype ValX1<valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::.ctor() IL_010d: ldc.i4.1 IL_010e: call instance void class Gen<valuetype ValX1<valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::ExceptionTest(bool) IL_0113: newobj instance void class Gen<valuetype ValX2<int32,int32>[]>::.ctor() IL_0118: ldc.i4.1 IL_0119: call instance void class Gen<valuetype ValX2<int32,int32>[]>::ExceptionTest(bool) IL_011e: newobj instance void class Gen<valuetype ValX2<float64,float64>[0...,0...]>::.ctor() IL_0123: ldc.i4.1 IL_0124: call instance void class Gen<valuetype ValX2<float64,float64>[0...,0...]>::ExceptionTest(bool) IL_0129: newobj instance void class Gen<valuetype ValX2<string,string>[][][]>::.ctor() IL_012e: ldc.i4.1 IL_012f: call instance void class Gen<valuetype ValX2<string,string>[][][]>::ExceptionTest(bool) IL_0134: newobj instance void class Gen<valuetype ValX2<object,object>[0...,0...,0...,0...]>::.ctor() IL_0139: ldc.i4.1 IL_013a: call instance void class Gen<valuetype ValX2<object,object>[0...,0...,0...,0...]>::ExceptionTest(bool) IL_013f: newobj instance void class Gen<valuetype ValX2<valuetype [mscorlib]System.Guid,valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::.ctor() IL_0144: ldc.i4.1 IL_0145: call instance void class Gen<valuetype ValX2<valuetype [mscorlib]System.Guid,valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::ExceptionTest(bool) IL_014a: newobj instance void class Gen<class RefX1<int32>>::.ctor() IL_014f: ldc.i4.1 IL_0150: call instance void class Gen<class RefX1<int32>>::ExceptionTest(bool) IL_0155: newobj instance void class Gen<class RefX1<valuetype ValX1<int32>>>::.ctor() IL_015a: ldc.i4.1 IL_015b: call instance void class Gen<class RefX1<valuetype ValX1<int32>>>::ExceptionTest(bool) IL_0160: newobj instance void class Gen<class RefX2<int32,string>>::.ctor() IL_0165: ldc.i4.1 IL_0166: call instance void class Gen<class RefX2<int32,string>>::ExceptionTest(bool) IL_016b: newobj instance void class Gen<class RefX3<int32,string,valuetype [mscorlib]System.Guid>>::.ctor() IL_0170: ldc.i4.1 IL_0171: call instance void class Gen<class RefX3<int32,string,valuetype [mscorlib]System.Guid>>::ExceptionTest(bool) IL_0176: newobj instance void class Gen<class RefX1<class RefX1<int32>>>::.ctor() IL_017b: ldc.i4.1 IL_017c: call instance void class Gen<class RefX1<class RefX1<int32>>>::ExceptionTest(bool) IL_0181: newobj instance void class Gen<class RefX1<class RefX1<class RefX1<string>>>>::.ctor() IL_0186: ldc.i4.1 IL_0187: call instance void class Gen<class RefX1<class RefX1<class RefX1<string>>>>::ExceptionTest(bool) IL_018c: newobj instance void class Gen<class RefX1<class RefX1<class RefX1<class RefX1<valuetype [mscorlib]System.Guid>>>>>::.ctor() IL_0191: ldc.i4.1 IL_0192: call instance void class Gen<class RefX1<class RefX1<class RefX1<class RefX1<valuetype [mscorlib]System.Guid>>>>>::ExceptionTest(bool) IL_0197: newobj instance void class Gen<class RefX1<class RefX2<int32,string>>>::.ctor() IL_019c: ldc.i4.1 IL_019d: call instance void class Gen<class RefX1<class RefX2<int32,string>>>::ExceptionTest(bool) IL_01a2: newobj instance void class Gen<class RefX2<class RefX2<class RefX1<int32>,class RefX3<int32,string,class RefX1<class RefX2<int32,string>>>>,class RefX2<class RefX1<int32>,class RefX3<int32,string,class RefX1<class RefX2<int32,string>>>>>>::.ctor() IL_01a7: ldc.i4.1 IL_01a8: call instance void class Gen<class RefX2<class RefX2<class RefX1<int32>,class RefX3<int32,string,class RefX1<class RefX2<int32,string>>>>,class RefX2<class RefX1<int32>,class RefX3<int32,string,class RefX1<class RefX2<int32,string>>>>>>::ExceptionTest(bool) IL_01ad: newobj instance void class Gen<class RefX3<class RefX1<int32[0...,0...,0...,0...][]>,class RefX2<object[][][0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][]>,class RefX3<float64[0...,0...,0...,0...,0...,0...,0...,0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][][0...,0...,0...,0...,0...][0...,0...,0...,0...,0...][][][],string[][][][][][][][][][][]>>>::.ctor() IL_01b2: ldc.i4.1 IL_01b3: call instance void class Gen<class RefX3<class RefX1<int32[0...,0...,0...,0...][]>,class RefX2<object[][][0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][]>,class RefX3<float64[0...,0...,0...,0...,0...,0...,0...,0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][][0...,0...,0...,0...,0...][0...,0...,0...,0...,0...][][][],string[][][][][][][][][][][]>>>::ExceptionTest(bool) IL_01b8: newobj instance void class Gen<valuetype ValX1<int32>>::.ctor() IL_01bd: ldc.i4.1 IL_01be: call instance void class Gen<valuetype ValX1<int32>>::ExceptionTest(bool) IL_01c3: newobj instance void class Gen<valuetype ValX1<class RefX1<int32>>>::.ctor() IL_01c8: ldc.i4.1 IL_01c9: call instance void class Gen<valuetype ValX1<class RefX1<int32>>>::ExceptionTest(bool) IL_01ce: newobj instance void class Gen<valuetype ValX2<int32,string>>::.ctor() IL_01d3: ldc.i4.1 IL_01d4: call instance void class Gen<valuetype ValX2<int32,string>>::ExceptionTest(bool) IL_01d9: newobj instance void class Gen<valuetype ValX3<int32,string,valuetype [mscorlib]System.Guid>>::.ctor() IL_01de: ldc.i4.1 IL_01df: call instance void class Gen<valuetype ValX3<int32,string,valuetype [mscorlib]System.Guid>>::ExceptionTest(bool) IL_01e4: newobj instance void class Gen<valuetype ValX1<valuetype ValX1<int32>>>::.ctor() IL_01e9: ldc.i4.1 IL_01ea: call instance void class Gen<valuetype ValX1<valuetype ValX1<int32>>>::ExceptionTest(bool) IL_01ef: newobj instance void class Gen<valuetype ValX1<valuetype ValX1<valuetype ValX1<string>>>>::.ctor() IL_01f4: ldc.i4.1 IL_01f5: call instance void class Gen<valuetype ValX1<valuetype ValX1<valuetype ValX1<string>>>>::ExceptionTest(bool) IL_01fa: newobj instance void class Gen<valuetype ValX1<valuetype ValX1<valuetype ValX1<valuetype ValX1<valuetype [mscorlib]System.Guid>>>>>::.ctor() IL_01ff: ldc.i4.1 IL_0200: call instance void class Gen<valuetype ValX1<valuetype ValX1<valuetype ValX1<valuetype ValX1<valuetype [mscorlib]System.Guid>>>>>::ExceptionTest(bool) IL_0205: newobj instance void class Gen<valuetype ValX1<valuetype ValX2<int32,string>>>::.ctor() IL_020a: ldc.i4.1 IL_020b: call instance void class Gen<valuetype ValX1<valuetype ValX2<int32,string>>>::ExceptionTest(bool) IL_0210: newobj instance void class Gen<valuetype ValX2<valuetype ValX2<valuetype ValX1<int32>,valuetype ValX3<int32,string,valuetype ValX1<valuetype ValX2<int32,string>>>>,valuetype ValX2<valuetype ValX1<int32>,valuetype ValX3<int32,string,valuetype ValX1<valuetype ValX2<int32,string>>>>>>::.ctor() IL_0215: ldc.i4.1 IL_0216: call instance void class Gen<valuetype ValX2<valuetype ValX2<valuetype ValX1<int32>,valuetype ValX3<int32,string,valuetype ValX1<valuetype ValX2<int32,string>>>>,valuetype ValX2<valuetype ValX1<int32>,valuetype ValX3<int32,string,valuetype ValX1<valuetype ValX2<int32,string>>>>>>::ExceptionTest(bool) IL_021b: newobj instance void class Gen<valuetype ValX3<valuetype ValX1<int32[0...,0...,0...,0...][]>,valuetype ValX2<object[][][0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][]>,valuetype ValX3<float64[0...,0...,0...,0...,0...,0...,0...,0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][][0...,0...,0...,0...,0...][0...,0...,0...,0...,0...][][][],string[][][][][][][][][][][]>>>::.ctor() IL_0220: ldc.i4.1 IL_0221: call instance void class Gen<valuetype ValX3<valuetype ValX1<int32[0...,0...,0...,0...][]>,valuetype ValX2<object[][][0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][]>,valuetype ValX3<float64[0...,0...,0...,0...,0...,0...,0...,0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][][0...,0...,0...,0...,0...][0...,0...,0...,0...,0...][][][],string[][][][][][][][][][][]>>>::ExceptionTest(bool) IL_0226: ldsfld bool Test_try_filter02::result IL_022b: brfalse.s IL_023c IL_022d: ldstr "Test Passed" IL_0232: call void [System.Console]System.Console::WriteLine(string) IL_0237: ldc.i4.s 100 IL_0239: stloc.0 IL_023a: br.s IL_024a IL_023c: ldstr "Test Failed" IL_0241: call void [System.Console]System.Console::WriteLine(string) IL_0246: ldc.i4.1 IL_0247: stloc.0 IL_0248: br.s IL_024a IL_024a: ldloc.0 IL_024b: ret } // end of method Test::Main .method private hidebysig specialname rtspecialname static void .cctor() cil managed { // Code size 13 (0xd) .maxstack 8 IL_0000: ldc.i4.0 IL_0001: stsfld int32 Test_try_filter02::counter IL_0006: ldc.i4.1 IL_0007: stsfld bool Test_try_filter02::result IL_000c: ret } // end of method Test::.cctor .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method Test::.ctor } // end of class Test // ============================================================= //*********** DISASSEMBLY COMPLETE *********************** // WARNING: Created Win32 resource file try-filter01.res
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // Microsoft (R) .NET Framework IL Disassembler. Version 1.2.2211.0 // Copyright (C) Microsoft Corporation 1998-2002. All rights reserved. // Metadata version: v1.1.2211 .assembly extern legacy library mscorlib {} .assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } .assembly 'try-filter02' { // --- The following custom attribute is added automatically, do not uncomment ------- // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(bool, // bool) = ( 01 00 00 01 00 00 ) .hash algorithm 0x00008004 .ver 0:0:0:0 } // MVID: {76712D77-A992-40B1-9AD0-E58BD9DA334B} .imagebase 0x00400000 .subsystem 0x00000003 .file alignment 512 .corflags 0x00000001 // Image base: 0x02DB0000 // =============== CLASS MEMBERS DECLARATION =================== .class public sequential ansi sealed beforefieldinit ValX0 extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValX0 .class public sequential ansi sealed beforefieldinit ValY0 extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValY0 .class public sequential ansi sealed beforefieldinit ValX1<([mscorlib]System.Object) T> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValX1 .class public sequential ansi sealed beforefieldinit ValY1<([mscorlib]System.Object) T> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValY1 .class public sequential ansi sealed beforefieldinit ValX2<([mscorlib]System.Object) T,([mscorlib]System.Object) U> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValX2 .class public sequential ansi sealed beforefieldinit ValY2<([mscorlib]System.Object) T,([mscorlib]System.Object) U> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValY2 .class public sequential ansi sealed beforefieldinit ValX3<([mscorlib]System.Object) T,([mscorlib]System.Object) U,([mscorlib]System.Object) V> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValX3 .class public sequential ansi sealed beforefieldinit ValY3<([mscorlib]System.Object) T,([mscorlib]System.Object) U,([mscorlib]System.Object) V> extends [mscorlib]System.ValueType { .pack 0 .size 1 } // end of class ValY3 .class public auto ansi beforefieldinit RefX0 extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefX0::.ctor } // end of class RefX0 .class public auto ansi beforefieldinit RefY0 extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefY0::.ctor } // end of class RefY0 .class public auto ansi beforefieldinit RefX1<([mscorlib]System.Object) T> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefX1::.ctor } // end of class RefX1 .class public auto ansi beforefieldinit RefY1<([mscorlib]System.Object) T> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefY1::.ctor } // end of class RefY1 .class public auto ansi beforefieldinit RefX2<([mscorlib]System.Object) T,([mscorlib]System.Object) U> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefX2::.ctor } // end of class RefX2 .class public auto ansi beforefieldinit RefY2<([mscorlib]System.Object) T,([mscorlib]System.Object) U> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefY2::.ctor } // end of class RefY2 .class public auto ansi beforefieldinit RefX3<([mscorlib]System.Object) T,([mscorlib]System.Object) U,([mscorlib]System.Object) V> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefX3::.ctor } // end of class RefX3 .class public auto ansi beforefieldinit RefY3<([mscorlib]System.Object) T,([mscorlib]System.Object) U,([mscorlib]System.Object) V> extends [mscorlib]System.Object { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method RefY3::.ctor } // end of class RefY3 .class public auto ansi beforefieldinit GenException<([mscorlib]System.Object) T> extends [mscorlib]System.Exception { .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Exception::.ctor() IL_0006: ret } // end of method GenException::.ctor } // end of class GenException .class public auto ansi beforefieldinit Gen<([mscorlib]System.Object) T> extends [mscorlib]System.Object { .method public hidebysig instance void InternalExceptionTest(bool throwException) cil managed { // Code size 54 (0x36) .maxstack 2 .locals init (string V_0, class [mscorlib]System.Exception V_1, bool V_2) IL_0000: ldtoken class GenException<!0> IL_0005: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) IL_000a: callvirt instance string [mscorlib]System.Type::ToString() IL_000f: stloc.0 .try { ldc.i4.1 stloc.2 IL_0010: ldarg.1 IL_0011: brfalse.s IL_0019 IL_0013: newobj instance void class GenException<!0>::.ctor() IL_0018: throw IL_0019: ldarg.1 IL_001a: brfalse.s IL_0022 IL_001c: ldc.i4.0 IL_001d: call void Test_try_filter02::Eval(bool) IL_0022: leave.s Exit } // end .try filter { stloc.1 ldloc.1 isinst class GenException<!0> ldnull cgt.un call void Test_try_filter02::Eval(bool) ldc.i4.0 endfilter } { pop ldc.i4.0 stloc.2 leave Exit } Exit: ldloc.2 call void Test_try_filter02::Eval(bool) ret } // end of method Gen::InternalExceptionTest .method public hidebysig instance void ExceptionTest(bool throwException) cil managed { // Code size 28 (0x1c) .maxstack 2 .try { IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: call instance void class Gen<!0>::InternalExceptionTest(bool) IL_0007: ldarg.1 IL_0008: ldc.i4.0 IL_0009: ceq IL_000b: call void Test_try_filter02::Eval(bool) IL_0010: leave.s IL_001b } // end .try catch [mscorlib]System.Object { IL_0012: pop IL_0013: ldarg.1 IL_0014: call void Test_try_filter02::Eval(bool) IL_0019: leave.s IL_001b } // end handler IL_001b: ret } // end of method Gen::ExceptionTest .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method Gen::.ctor } // end of class Gen .class public auto ansi beforefieldinit Test_try_filter02 extends [mscorlib]System.Object { .field public static int32 counter .field public static bool result .method public hidebysig static void Eval(bool exp) cil managed { // Code size 47 (0x2f) .maxstack 8 IL_0000: ldsfld int32 Test_try_filter02::counter IL_0005: ldc.i4.1 IL_0006: add IL_0007: stsfld int32 Test_try_filter02::counter IL_000c: ldarg.0 IL_000d: brtrue.s IL_002e IL_000f: ldarg.0 IL_0010: stsfld bool Test_try_filter02::result IL_0015: ldstr "Test Failed at location: " IL_001a: ldsfld int32 Test_try_filter02::counter IL_001f: box [mscorlib]System.Int32 IL_0024: call string [mscorlib]System.String::Concat(object, object) IL_0029: call void [System.Console]System.Console::WriteLine(string) IL_002e: ret } // end of method Test::Eval .method public hidebysig static int32 Main() cil managed { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) .entrypoint // Code size 588 (0x24c) .maxstack 2 .locals init (int32 V_0) IL_0000: newobj instance void class Gen<int32>::.ctor() IL_0005: ldc.i4.1 IL_0006: call instance void class Gen<int32>::ExceptionTest(bool) IL_000b: newobj instance void class Gen<float64>::.ctor() IL_0010: ldc.i4.1 IL_0011: call instance void class Gen<float64>::ExceptionTest(bool) IL_0016: newobj instance void class Gen<string>::.ctor() IL_001b: ldc.i4.1 IL_001c: call instance void class Gen<string>::ExceptionTest(bool) IL_0021: newobj instance void class Gen<object>::.ctor() IL_0026: ldc.i4.1 IL_0027: call instance void class Gen<object>::ExceptionTest(bool) IL_002c: newobj instance void class Gen<valuetype [mscorlib]System.Guid>::.ctor() IL_0031: ldc.i4.1 IL_0032: call instance void class Gen<valuetype [mscorlib]System.Guid>::ExceptionTest(bool) IL_0037: newobj instance void class Gen<int32[]>::.ctor() IL_003c: ldc.i4.1 IL_003d: call instance void class Gen<int32[]>::ExceptionTest(bool) IL_0042: newobj instance void class Gen<float64[0...,0...]>::.ctor() IL_0047: ldc.i4.1 IL_0048: call instance void class Gen<float64[0...,0...]>::ExceptionTest(bool) IL_004d: newobj instance void class Gen<string[][][]>::.ctor() IL_0052: ldc.i4.1 IL_0053: call instance void class Gen<string[][][]>::ExceptionTest(bool) IL_0058: newobj instance void class Gen<object[0...,0...,0...,0...]>::.ctor() IL_005d: ldc.i4.1 IL_005e: call instance void class Gen<object[0...,0...,0...,0...]>::ExceptionTest(bool) IL_0063: newobj instance void class Gen<valuetype [mscorlib]System.Guid[][0...,0...,0...,0...][]>::.ctor() IL_0068: ldc.i4.1 IL_0069: call instance void class Gen<valuetype [mscorlib]System.Guid[][0...,0...,0...,0...][]>::ExceptionTest(bool) IL_006e: newobj instance void class Gen<class RefX1<int32>[]>::.ctor() IL_0073: ldc.i4.1 IL_0074: call instance void class Gen<class RefX1<int32>[]>::ExceptionTest(bool) IL_0079: newobj instance void class Gen<class RefX1<float64>[0...,0...]>::.ctor() IL_007e: ldc.i4.1 IL_007f: call instance void class Gen<class RefX1<float64>[0...,0...]>::ExceptionTest(bool) IL_0084: newobj instance void class Gen<class RefX1<string>[][][]>::.ctor() IL_0089: ldc.i4.1 IL_008a: call instance void class Gen<class RefX1<string>[][][]>::ExceptionTest(bool) IL_008f: newobj instance void class Gen<class RefX1<object>[0...,0...,0...,0...]>::.ctor() IL_0094: ldc.i4.1 IL_0095: call instance void class Gen<class RefX1<object>[0...,0...,0...,0...]>::ExceptionTest(bool) IL_009a: newobj instance void class Gen<class RefX1<valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::.ctor() IL_009f: ldc.i4.1 IL_00a0: call instance void class Gen<class RefX1<valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::ExceptionTest(bool) IL_00a5: newobj instance void class Gen<class RefX2<int32,int32>[]>::.ctor() IL_00aa: ldc.i4.1 IL_00ab: call instance void class Gen<class RefX2<int32,int32>[]>::ExceptionTest(bool) IL_00b0: newobj instance void class Gen<class RefX2<float64,float64>[0...,0...]>::.ctor() IL_00b5: ldc.i4.1 IL_00b6: call instance void class Gen<class RefX2<float64,float64>[0...,0...]>::ExceptionTest(bool) IL_00bb: newobj instance void class Gen<class RefX2<string,string>[][][]>::.ctor() IL_00c0: ldc.i4.1 IL_00c1: call instance void class Gen<class RefX2<string,string>[][][]>::ExceptionTest(bool) IL_00c6: newobj instance void class Gen<class RefX2<object,object>[0...,0...,0...,0...]>::.ctor() IL_00cb: ldc.i4.1 IL_00cc: call instance void class Gen<class RefX2<object,object>[0...,0...,0...,0...]>::ExceptionTest(bool) IL_00d1: newobj instance void class Gen<class RefX2<valuetype [mscorlib]System.Guid,valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::.ctor() IL_00d6: ldc.i4.1 IL_00d7: call instance void class Gen<class RefX2<valuetype [mscorlib]System.Guid,valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::ExceptionTest(bool) IL_00dc: newobj instance void class Gen<valuetype ValX1<int32>[]>::.ctor() IL_00e1: ldc.i4.1 IL_00e2: call instance void class Gen<valuetype ValX1<int32>[]>::ExceptionTest(bool) IL_00e7: newobj instance void class Gen<valuetype ValX1<float64>[0...,0...]>::.ctor() IL_00ec: ldc.i4.1 IL_00ed: call instance void class Gen<valuetype ValX1<float64>[0...,0...]>::ExceptionTest(bool) IL_00f2: newobj instance void class Gen<valuetype ValX1<string>[][][]>::.ctor() IL_00f7: ldc.i4.1 IL_00f8: call instance void class Gen<valuetype ValX1<string>[][][]>::ExceptionTest(bool) IL_00fd: newobj instance void class Gen<valuetype ValX1<object>[0...,0...,0...,0...]>::.ctor() IL_0102: ldc.i4.1 IL_0103: call instance void class Gen<valuetype ValX1<object>[0...,0...,0...,0...]>::ExceptionTest(bool) IL_0108: newobj instance void class Gen<valuetype ValX1<valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::.ctor() IL_010d: ldc.i4.1 IL_010e: call instance void class Gen<valuetype ValX1<valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::ExceptionTest(bool) IL_0113: newobj instance void class Gen<valuetype ValX2<int32,int32>[]>::.ctor() IL_0118: ldc.i4.1 IL_0119: call instance void class Gen<valuetype ValX2<int32,int32>[]>::ExceptionTest(bool) IL_011e: newobj instance void class Gen<valuetype ValX2<float64,float64>[0...,0...]>::.ctor() IL_0123: ldc.i4.1 IL_0124: call instance void class Gen<valuetype ValX2<float64,float64>[0...,0...]>::ExceptionTest(bool) IL_0129: newobj instance void class Gen<valuetype ValX2<string,string>[][][]>::.ctor() IL_012e: ldc.i4.1 IL_012f: call instance void class Gen<valuetype ValX2<string,string>[][][]>::ExceptionTest(bool) IL_0134: newobj instance void class Gen<valuetype ValX2<object,object>[0...,0...,0...,0...]>::.ctor() IL_0139: ldc.i4.1 IL_013a: call instance void class Gen<valuetype ValX2<object,object>[0...,0...,0...,0...]>::ExceptionTest(bool) IL_013f: newobj instance void class Gen<valuetype ValX2<valuetype [mscorlib]System.Guid,valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::.ctor() IL_0144: ldc.i4.1 IL_0145: call instance void class Gen<valuetype ValX2<valuetype [mscorlib]System.Guid,valuetype [mscorlib]System.Guid>[][0...,0...,0...,0...][]>::ExceptionTest(bool) IL_014a: newobj instance void class Gen<class RefX1<int32>>::.ctor() IL_014f: ldc.i4.1 IL_0150: call instance void class Gen<class RefX1<int32>>::ExceptionTest(bool) IL_0155: newobj instance void class Gen<class RefX1<valuetype ValX1<int32>>>::.ctor() IL_015a: ldc.i4.1 IL_015b: call instance void class Gen<class RefX1<valuetype ValX1<int32>>>::ExceptionTest(bool) IL_0160: newobj instance void class Gen<class RefX2<int32,string>>::.ctor() IL_0165: ldc.i4.1 IL_0166: call instance void class Gen<class RefX2<int32,string>>::ExceptionTest(bool) IL_016b: newobj instance void class Gen<class RefX3<int32,string,valuetype [mscorlib]System.Guid>>::.ctor() IL_0170: ldc.i4.1 IL_0171: call instance void class Gen<class RefX3<int32,string,valuetype [mscorlib]System.Guid>>::ExceptionTest(bool) IL_0176: newobj instance void class Gen<class RefX1<class RefX1<int32>>>::.ctor() IL_017b: ldc.i4.1 IL_017c: call instance void class Gen<class RefX1<class RefX1<int32>>>::ExceptionTest(bool) IL_0181: newobj instance void class Gen<class RefX1<class RefX1<class RefX1<string>>>>::.ctor() IL_0186: ldc.i4.1 IL_0187: call instance void class Gen<class RefX1<class RefX1<class RefX1<string>>>>::ExceptionTest(bool) IL_018c: newobj instance void class Gen<class RefX1<class RefX1<class RefX1<class RefX1<valuetype [mscorlib]System.Guid>>>>>::.ctor() IL_0191: ldc.i4.1 IL_0192: call instance void class Gen<class RefX1<class RefX1<class RefX1<class RefX1<valuetype [mscorlib]System.Guid>>>>>::ExceptionTest(bool) IL_0197: newobj instance void class Gen<class RefX1<class RefX2<int32,string>>>::.ctor() IL_019c: ldc.i4.1 IL_019d: call instance void class Gen<class RefX1<class RefX2<int32,string>>>::ExceptionTest(bool) IL_01a2: newobj instance void class Gen<class RefX2<class RefX2<class RefX1<int32>,class RefX3<int32,string,class RefX1<class RefX2<int32,string>>>>,class RefX2<class RefX1<int32>,class RefX3<int32,string,class RefX1<class RefX2<int32,string>>>>>>::.ctor() IL_01a7: ldc.i4.1 IL_01a8: call instance void class Gen<class RefX2<class RefX2<class RefX1<int32>,class RefX3<int32,string,class RefX1<class RefX2<int32,string>>>>,class RefX2<class RefX1<int32>,class RefX3<int32,string,class RefX1<class RefX2<int32,string>>>>>>::ExceptionTest(bool) IL_01ad: newobj instance void class Gen<class RefX3<class RefX1<int32[0...,0...,0...,0...][]>,class RefX2<object[][][0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][]>,class RefX3<float64[0...,0...,0...,0...,0...,0...,0...,0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][][0...,0...,0...,0...,0...][0...,0...,0...,0...,0...][][][],string[][][][][][][][][][][]>>>::.ctor() IL_01b2: ldc.i4.1 IL_01b3: call instance void class Gen<class RefX3<class RefX1<int32[0...,0...,0...,0...][]>,class RefX2<object[][][0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][]>,class RefX3<float64[0...,0...,0...,0...,0...,0...,0...,0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][][0...,0...,0...,0...,0...][0...,0...,0...,0...,0...][][][],string[][][][][][][][][][][]>>>::ExceptionTest(bool) IL_01b8: newobj instance void class Gen<valuetype ValX1<int32>>::.ctor() IL_01bd: ldc.i4.1 IL_01be: call instance void class Gen<valuetype ValX1<int32>>::ExceptionTest(bool) IL_01c3: newobj instance void class Gen<valuetype ValX1<class RefX1<int32>>>::.ctor() IL_01c8: ldc.i4.1 IL_01c9: call instance void class Gen<valuetype ValX1<class RefX1<int32>>>::ExceptionTest(bool) IL_01ce: newobj instance void class Gen<valuetype ValX2<int32,string>>::.ctor() IL_01d3: ldc.i4.1 IL_01d4: call instance void class Gen<valuetype ValX2<int32,string>>::ExceptionTest(bool) IL_01d9: newobj instance void class Gen<valuetype ValX3<int32,string,valuetype [mscorlib]System.Guid>>::.ctor() IL_01de: ldc.i4.1 IL_01df: call instance void class Gen<valuetype ValX3<int32,string,valuetype [mscorlib]System.Guid>>::ExceptionTest(bool) IL_01e4: newobj instance void class Gen<valuetype ValX1<valuetype ValX1<int32>>>::.ctor() IL_01e9: ldc.i4.1 IL_01ea: call instance void class Gen<valuetype ValX1<valuetype ValX1<int32>>>::ExceptionTest(bool) IL_01ef: newobj instance void class Gen<valuetype ValX1<valuetype ValX1<valuetype ValX1<string>>>>::.ctor() IL_01f4: ldc.i4.1 IL_01f5: call instance void class Gen<valuetype ValX1<valuetype ValX1<valuetype ValX1<string>>>>::ExceptionTest(bool) IL_01fa: newobj instance void class Gen<valuetype ValX1<valuetype ValX1<valuetype ValX1<valuetype ValX1<valuetype [mscorlib]System.Guid>>>>>::.ctor() IL_01ff: ldc.i4.1 IL_0200: call instance void class Gen<valuetype ValX1<valuetype ValX1<valuetype ValX1<valuetype ValX1<valuetype [mscorlib]System.Guid>>>>>::ExceptionTest(bool) IL_0205: newobj instance void class Gen<valuetype ValX1<valuetype ValX2<int32,string>>>::.ctor() IL_020a: ldc.i4.1 IL_020b: call instance void class Gen<valuetype ValX1<valuetype ValX2<int32,string>>>::ExceptionTest(bool) IL_0210: newobj instance void class Gen<valuetype ValX2<valuetype ValX2<valuetype ValX1<int32>,valuetype ValX3<int32,string,valuetype ValX1<valuetype ValX2<int32,string>>>>,valuetype ValX2<valuetype ValX1<int32>,valuetype ValX3<int32,string,valuetype ValX1<valuetype ValX2<int32,string>>>>>>::.ctor() IL_0215: ldc.i4.1 IL_0216: call instance void class Gen<valuetype ValX2<valuetype ValX2<valuetype ValX1<int32>,valuetype ValX3<int32,string,valuetype ValX1<valuetype ValX2<int32,string>>>>,valuetype ValX2<valuetype ValX1<int32>,valuetype ValX3<int32,string,valuetype ValX1<valuetype ValX2<int32,string>>>>>>::ExceptionTest(bool) IL_021b: newobj instance void class Gen<valuetype ValX3<valuetype ValX1<int32[0...,0...,0...,0...][]>,valuetype ValX2<object[][][0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][]>,valuetype ValX3<float64[0...,0...,0...,0...,0...,0...,0...,0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][][0...,0...,0...,0...,0...][0...,0...,0...,0...,0...][][][],string[][][][][][][][][][][]>>>::.ctor() IL_0220: ldc.i4.1 IL_0221: call instance void class Gen<valuetype ValX3<valuetype ValX1<int32[0...,0...,0...,0...][]>,valuetype ValX2<object[][][0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][]>,valuetype ValX3<float64[0...,0...,0...,0...,0...,0...,0...,0...,0...,0...,0...],valuetype [mscorlib]System.Guid[][][][0...,0...,0...,0...,0...][0...,0...,0...,0...,0...][][][],string[][][][][][][][][][][]>>>::ExceptionTest(bool) IL_0226: ldsfld bool Test_try_filter02::result IL_022b: brfalse.s IL_023c IL_022d: ldstr "Test Passed" IL_0232: call void [System.Console]System.Console::WriteLine(string) IL_0237: ldc.i4.s 100 IL_0239: stloc.0 IL_023a: br.s IL_024a IL_023c: ldstr "Test Failed" IL_0241: call void [System.Console]System.Console::WriteLine(string) IL_0246: ldc.i4.1 IL_0247: stloc.0 IL_0248: br.s IL_024a IL_024a: ldloc.0 IL_024b: ret } // end of method Test::Main .method private hidebysig specialname rtspecialname static void .cctor() cil managed { // Code size 13 (0xd) .maxstack 8 IL_0000: ldc.i4.0 IL_0001: stsfld int32 Test_try_filter02::counter IL_0006: ldc.i4.1 IL_0007: stsfld bool Test_try_filter02::result IL_000c: ret } // end of method Test::.cctor .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method Test::.ctor } // end of class Test // ============================================================= //*********** DISASSEMBLY COMPLETE *********************** // WARNING: Created Win32 resource file try-filter01.res
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/IDesignerEventService.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.ComponentModel.Design { /// <summary> /// Provides global event notifications and the ability to create designers. /// </summary> public interface IDesignerEventService { /// <summary> /// Gets the currently active designer. /// </summary> IDesignerHost? ActiveDesigner { get; } /// <summary> /// Gets or sets a collection of running design documents in the development environment. /// </summary> DesignerCollection Designers { get; } /// <summary> /// Adds an event that will be raised when the currently active designer changes. /// </summary> event ActiveDesignerEventHandler ActiveDesignerChanged; /// <summary> /// Adds an event that will be raised when a designer is created. /// </summary> event DesignerEventHandler DesignerCreated; /// <summary> /// Adds an event that will be raised when a designer is disposed. /// </summary> event DesignerEventHandler DesignerDisposed; /// <summary> /// Adds an event that will be raised when the global selection changes. /// </summary> event EventHandler SelectionChanged; } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.ComponentModel.Design { /// <summary> /// Provides global event notifications and the ability to create designers. /// </summary> public interface IDesignerEventService { /// <summary> /// Gets the currently active designer. /// </summary> IDesignerHost? ActiveDesigner { get; } /// <summary> /// Gets or sets a collection of running design documents in the development environment. /// </summary> DesignerCollection Designers { get; } /// <summary> /// Adds an event that will be raised when the currently active designer changes. /// </summary> event ActiveDesignerEventHandler ActiveDesignerChanged; /// <summary> /// Adds an event that will be raised when a designer is created. /// </summary> event DesignerEventHandler DesignerCreated; /// <summary> /// Adds an event that will be raised when a designer is disposed. /// </summary> event DesignerEventHandler DesignerDisposed; /// <summary> /// Adds an event that will be raised when the global selection changes. /// </summary> event EventHandler SelectionChanged; } }
-1
dotnet/runtime
66,075
Keep CLSCompliantAttribute in sync for src <-> ref
Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
ViktorHofer
2022-03-02T11:40:14Z
2022-03-02T15:17:47Z
58b8de991cd0cb4cbbb9a52f2a3b9734f30a659c
b61687b07672071fb31d1511d1c28d5eac616e6a
Keep CLSCompliantAttribute in sync for src <-> ref. Contributes to https://github.com/dotnet/runtime/issues/58163 Until two years ago, ApiCompat validated the CLSCompliantAttribute but that check was then disabled with a675e1c2c4f46b98ecac1253223649d8f36d5da7. Re-enable it and only disable the check during baseline api compat validation, which is performed in ApiCompat.proj.
./src/libraries/System.Speech/src/Internal/GrammarBuilding/GrammarBuilderRuleRef.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Speech.Internal.SrgsParser; namespace System.Speech.Internal.GrammarBuilding { internal sealed class GrammarBuilderRuleRef : GrammarBuilderBase { #region Constructors internal GrammarBuilderRuleRef(Uri uri, string rule) { _uri = uri.OriginalString + ((rule != null) ? "#" + rule : ""); } private GrammarBuilderRuleRef(string sgrsUri) { _uri = sgrsUri; } #endregion #region Public Methods public override bool Equals(object obj) { GrammarBuilderRuleRef refObj = obj as GrammarBuilderRuleRef; if (refObj == null) { return false; } return _uri == refObj._uri; } public override int GetHashCode() { return _uri.GetHashCode(); } #endregion #region Internal Methods internal override GrammarBuilderBase Clone() { return new GrammarBuilderRuleRef(_uri); } internal override IElement CreateElement(IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { Uri ruleUri = new(_uri, UriKind.RelativeOrAbsolute); return elementFactory.CreateRuleRef(parent, ruleUri, null, null); } #endregion #region Internal Properties internal override string DebugSummary { get { return "#" + _uri; } } #endregion #region Private Fields private readonly string _uri; #endregion } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Speech.Internal.SrgsParser; namespace System.Speech.Internal.GrammarBuilding { internal sealed class GrammarBuilderRuleRef : GrammarBuilderBase { #region Constructors internal GrammarBuilderRuleRef(Uri uri, string rule) { _uri = uri.OriginalString + ((rule != null) ? "#" + rule : ""); } private GrammarBuilderRuleRef(string sgrsUri) { _uri = sgrsUri; } #endregion #region Public Methods public override bool Equals(object obj) { GrammarBuilderRuleRef refObj = obj as GrammarBuilderRuleRef; if (refObj == null) { return false; } return _uri == refObj._uri; } public override int GetHashCode() { return _uri.GetHashCode(); } #endregion #region Internal Methods internal override GrammarBuilderBase Clone() { return new GrammarBuilderRuleRef(_uri); } internal override IElement CreateElement(IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds) { Uri ruleUri = new(_uri, UriKind.RelativeOrAbsolute); return elementFactory.CreateRuleRef(parent, ruleUri, null, null); } #endregion #region Internal Properties internal override string DebugSummary { get { return "#" + _uri; } } #endregion #region Private Fields private readonly string _uri; #endregion } }
-1