Import jit/jit64/valuetype/nullable tests.
authorPat Gavlin <pagavlin@microsoft.com>
Fri, 4 Dec 2015 22:22:14 +0000 (14:22 -0800)
committerPat Gavlin <pagavlin@microsoft.com>
Fri, 4 Dec 2015 23:57:25 +0000 (15:57 -0800)
This includes box/unbox and cast tests. There is also a small change
to jit/config/minimal/project.json to include
the System.Runtime.InteropServices package.

701 files changed:
tests/src/JIT/config/minimal/project.json
tests/src/JIT/config/minimal/project.lock.json
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/structdef.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/app.config [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.cs [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.csproj [new file with mode: 0644]
tests/src/JIT/jit64/valuetypes/nullable/castclass/structdef.cs [new file with mode: 0644]

index 7fad5ff..e242aad 100644 (file)
@@ -2,9 +2,10 @@
   "dependencies": {
     "System.Console": "4.0.0-beta-*",
     "System.Runtime": "4.0.20-beta-*",
-    "System.Runtime.Extensions": "4.0.10-beta-*"
+    "System.Runtime.Extensions": "4.0.10-beta-*",
+    "System.Runtime.InteropServices": "4.0.10-beta-*"
   },
   "frameworks": {
     "dnxcore50": {}
   }
-}
\ No newline at end of file
+}
index 80e7678..f0a6c4a 100644 (file)
           "lib/DNXCore50/System.Private.Uri.dll": {}
         }
       },
+      "System.Reflection/4.0.0-beta-23127": {
+        "type": "package",
+        "dependencies": {
+          "System.IO": "4.0.0-beta-23127",
+          "System.Reflection.Primitives": "4.0.0-beta-23127",
+          "System.Runtime": "4.0.0-beta-23127"
+        },
+        "compile": {
+          "ref/dotnet/System.Reflection.dll": {}
+        }
+      },
+      "System.Reflection.Primitives/4.0.0-beta-23127": {
+        "type": "package",
+        "dependencies": {
+          "System.Runtime": "4.0.0-beta-23127"
+        },
+        "compile": {
+          "ref/dotnet/System.Reflection.Primitives.dll": {}
+        },
+        "runtime": {
+          "lib/DNXCore50/System.Reflection.Primitives.dll": {}
+        }
+      },
       "System.Runtime/4.0.20-beta-23127": {
         "type": "package",
         "dependencies": {
           "lib/DNXCore50/System.Runtime.Extensions.dll": {}
         }
       },
+      "System.Runtime.InteropServices/4.0.10-beta-23127": {
+        "type": "package",
+        "dependencies": {
+          "System.Reflection": "4.0.0-beta-23127",
+          "System.Reflection.Primitives": "4.0.0-beta-23127",
+          "System.Runtime": "4.0.0-beta-23127"
+        },
+        "compile": {
+          "ref/dotnet/System.Runtime.InteropServices.dll": {}
+        }
+      },
       "System.Text.Encoding/4.0.0": {
         "type": "package",
         "dependencies": {
           "lib/DNXCore50/System.Runtime.Extensions.dll": {}
         }
       },
-      "System.Runtime.Handles/4.0.0": {
-        "type": "package",
-        "dependencies": {
-          "System.Runtime": "4.0.0"
-        },
-        "compile": {
-          "ref/dotnet/System.Runtime.Handles.dll": {}
-        },
-        "runtime": {
-          "lib/DNXCore50/System.Runtime.Handles.dll": {}
-        }
-      },
-      "System.Runtime.InteropServices/4.0.20": {
+      "System.Runtime.InteropServices/4.0.10-beta-23127": {
         "type": "package",
         "dependencies": {
-          "System.Reflection": "4.0.0",
-          "System.Reflection.Primitives": "4.0.0",
-          "System.Runtime": "4.0.0",
-          "System.Runtime.Handles": "4.0.0"
+          "System.Reflection": "4.0.0-beta-23127",
+          "System.Reflection.Primitives": "4.0.0-beta-23127",
+          "System.Runtime": "4.0.0-beta-23127"
         },
         "compile": {
           "ref/dotnet/System.Runtime.InteropServices.dll": {}
-        },
-        "runtime": {
-          "lib/DNXCore50/System.Runtime.InteropServices.dll": {}
         }
       },
       "System.Text.Encoding/4.0.10": {
           "lib/DNXCore50/System.Runtime.Extensions.dll": {}
         }
       },
-      "System.Runtime.Handles/4.0.0": {
+      "System.Runtime.InteropServices/4.0.10-beta-23127": {
         "type": "package",
         "dependencies": {
-          "System.Runtime": "4.0.0"
-        },
-        "compile": {
-          "ref/dotnet/System.Runtime.Handles.dll": {}
-        },
-        "runtime": {
-          "lib/DNXCore50/System.Runtime.Handles.dll": {}
-        }
-      },
-      "System.Runtime.InteropServices/4.0.20": {
-        "type": "package",
-        "dependencies": {
-          "System.Reflection": "4.0.0",
-          "System.Reflection.Primitives": "4.0.0",
-          "System.Runtime": "4.0.0",
-          "System.Runtime.Handles": "4.0.0"
+          "System.Reflection": "4.0.0-beta-23127",
+          "System.Reflection.Primitives": "4.0.0-beta-23127",
+          "System.Runtime": "4.0.0-beta-23127"
         },
         "compile": {
           "ref/dotnet/System.Runtime.InteropServices.dll": {}
-        },
-        "runtime": {
-          "lib/DNXCore50/System.Runtime.InteropServices.dll": {}
         }
       },
       "System.Text.Encoding/4.0.10": {
         "System.Private.Uri.nuspec"
       ]
     },
+    "System.Reflection/4.0.0-beta-23127": {
+      "type": "package",
+      "sha512": "C2H07xfQjIbtyFuD5T/g0QYc8sE0rhq3lNpL/LUmlQ7jS8xTm2hxTOvYqyPbmf4pYtBRQ3fS7/8mwRexPdN1wA==",
+      "files": [
+        "lib/MonoAndroid10/_._",
+        "lib/MonoTouch10/_._",
+        "lib/net45/_._",
+        "lib/win8/_._",
+        "lib/wp80/_._",
+        "lib/wpa81/_._",
+        "lib/xamarinios10/_._",
+        "lib/xamarinmac20/_._",
+        "License.rtf",
+        "ref/dotnet/de/System.Reflection.xml",
+        "ref/dotnet/es/System.Reflection.xml",
+        "ref/dotnet/fr/System.Reflection.xml",
+        "ref/dotnet/it/System.Reflection.xml",
+        "ref/dotnet/ja/System.Reflection.xml",
+        "ref/dotnet/ko/System.Reflection.xml",
+        "ref/dotnet/ru/System.Reflection.xml",
+        "ref/dotnet/System.Reflection.dll",
+        "ref/dotnet/System.Reflection.xml",
+        "ref/dotnet/zh-hans/System.Reflection.xml",
+        "ref/dotnet/zh-hant/System.Reflection.xml",
+        "ref/MonoAndroid10/_._",
+        "ref/MonoTouch10/_._",
+        "ref/net45/_._",
+        "ref/netcore50/de/System.Reflection.xml",
+        "ref/netcore50/es/System.Reflection.xml",
+        "ref/netcore50/fr/System.Reflection.xml",
+        "ref/netcore50/it/System.Reflection.xml",
+        "ref/netcore50/ja/System.Reflection.xml",
+        "ref/netcore50/ko/System.Reflection.xml",
+        "ref/netcore50/ru/System.Reflection.xml",
+        "ref/netcore50/System.Reflection.dll",
+        "ref/netcore50/System.Reflection.xml",
+        "ref/netcore50/zh-hans/System.Reflection.xml",
+        "ref/netcore50/zh-hant/System.Reflection.xml",
+        "ref/win8/_._",
+        "ref/wp80/_._",
+        "ref/wpa81/_._",
+        "ref/xamarinios10/_._",
+        "ref/xamarinmac20/_._",
+        "System.Reflection.4.0.0-beta-23127.nupkg",
+        "System.Reflection.4.0.0-beta-23127.nupkg.sha512",
+        "System.Reflection.nuspec"
+      ]
+    },
     "System.Reflection/4.0.0": {
       "type": "package",
       "sha512": "g96Rn8XuG7y4VfxPj/jnXroRJdQ8L3iN3k3zqsuzk4k3Nq4KMXARYiIO4BLW4GwX06uQpuYwRMcAC/aF117knQ==",
         "System.Reflection.nuspec"
       ]
     },
+    "System.Reflection.Primitives/4.0.0-beta-23127": {
+      "type": "package",
+      "serviceable": true,
+      "sha512": "qUjIaT8GBhxh5pyY1xhQd3/Rn5CJMu023GGNWXObr6/I/lX9LWpJD+UJAsPcLMEXOFq3QaKk6+giNjaqIdcf7Q==",
+      "files": [
+        "lib/DNXCore50/System.Reflection.Primitives.dll",
+        "lib/net45/_._",
+        "lib/netcore50/System.Reflection.Primitives.dll",
+        "lib/win8/_._",
+        "lib/wp80/_._",
+        "lib/wpa81/_._",
+        "ref/dotnet/de/System.Reflection.Primitives.xml",
+        "ref/dotnet/es/System.Reflection.Primitives.xml",
+        "ref/dotnet/fr/System.Reflection.Primitives.xml",
+        "ref/dotnet/it/System.Reflection.Primitives.xml",
+        "ref/dotnet/ja/System.Reflection.Primitives.xml",
+        "ref/dotnet/ko/System.Reflection.Primitives.xml",
+        "ref/dotnet/ru/System.Reflection.Primitives.xml",
+        "ref/dotnet/System.Reflection.Primitives.dll",
+        "ref/dotnet/System.Reflection.Primitives.xml",
+        "ref/dotnet/zh-hans/System.Reflection.Primitives.xml",
+        "ref/dotnet/zh-hant/System.Reflection.Primitives.xml",
+        "ref/net45/_._",
+        "ref/netcore50/System.Reflection.Primitives.dll",
+        "ref/netcore50/System.Reflection.Primitives.xml",
+        "ref/win8/_._",
+        "ref/wp80/_._",
+        "ref/wpa81/_._",
+        "runtimes/win8-aot/lib/netcore50/System.Reflection.Primitives.dll",
+        "System.Reflection.Primitives.4.0.0-beta-23127.nupkg",
+        "System.Reflection.Primitives.4.0.0-beta-23127.nupkg.sha512",
+        "System.Reflection.Primitives.nuspec"
+      ]
+    },
     "System.Reflection.Primitives/4.0.0": {
       "type": "package",
       "serviceable": true,
         "System.Runtime.Extensions.nuspec"
       ]
     },
-    "System.Runtime.Handles/4.0.0": {
-      "type": "package",
-      "serviceable": true,
-      "sha512": "638VhpRq63tVcQ6HDb3um3R/J2BtR1Sa96toHo6PcJGPXEPEsleCuqhBgX2gFCz0y0qkutANwW6VPPY5wQu1XQ==",
-      "files": [
-        "lib/DNXCore50/System.Runtime.Handles.dll",
-        "lib/MonoAndroid10/_._",
-        "lib/MonoTouch10/_._",
-        "lib/net46/_._",
-        "lib/netcore50/System.Runtime.Handles.dll",
-        "lib/xamarinios10/_._",
-        "lib/xamarinmac20/_._",
-        "ref/dotnet/de/System.Runtime.Handles.xml",
-        "ref/dotnet/es/System.Runtime.Handles.xml",
-        "ref/dotnet/fr/System.Runtime.Handles.xml",
-        "ref/dotnet/it/System.Runtime.Handles.xml",
-        "ref/dotnet/ja/System.Runtime.Handles.xml",
-        "ref/dotnet/ko/System.Runtime.Handles.xml",
-        "ref/dotnet/ru/System.Runtime.Handles.xml",
-        "ref/dotnet/System.Runtime.Handles.dll",
-        "ref/dotnet/System.Runtime.Handles.xml",
-        "ref/dotnet/zh-hans/System.Runtime.Handles.xml",
-        "ref/dotnet/zh-hant/System.Runtime.Handles.xml",
-        "ref/MonoAndroid10/_._",
-        "ref/MonoTouch10/_._",
-        "ref/net46/_._",
-        "ref/xamarinios10/_._",
-        "ref/xamarinmac20/_._",
-        "runtimes/win8-aot/lib/netcore50/System.Runtime.Handles.dll",
-        "System.Runtime.Handles.4.0.0.nupkg",
-        "System.Runtime.Handles.4.0.0.nupkg.sha512",
-        "System.Runtime.Handles.nuspec"
-      ]
-    },
-    "System.Runtime.InteropServices/4.0.20": {
+    "System.Runtime.InteropServices/4.0.10-beta-23127": {
       "type": "package",
-      "serviceable": true,
-      "sha512": "ZgDyBYfEnjWoz/viS6VOswA6XOkDSH2DzgbpczbW50RywhnCgTl+w3JEvtAiOGyIh8cyx1NJq80jsNBSUr8Pig==",
+      "sha512": "zacN2B2QO20ziz3VvTBcAmcfnVtcO5Wu0tPcKA+5Gok+ZoKD9Ii8oRHSQ2Ou8L2yo5sL5ULh3J+PV4b7JZc4Gg==",
       "files": [
-        "lib/DNXCore50/System.Runtime.InteropServices.dll",
         "lib/MonoAndroid10/_._",
         "lib/MonoTouch10/_._",
-        "lib/net46/_._",
-        "lib/netcore50/System.Runtime.InteropServices.dll",
+        "lib/net451/_._",
+        "lib/win81/_._",
+        "lib/wpa81/_._",
         "lib/xamarinios10/_._",
         "lib/xamarinmac20/_._",
+        "License.rtf",
         "ref/dotnet/de/System.Runtime.InteropServices.xml",
         "ref/dotnet/es/System.Runtime.InteropServices.xml",
         "ref/dotnet/fr/System.Runtime.InteropServices.xml",
         "ref/dotnet/zh-hant/System.Runtime.InteropServices.xml",
         "ref/MonoAndroid10/_._",
         "ref/MonoTouch10/_._",
-        "ref/net46/_._",
+        "ref/net451/_._",
+        "ref/netcore50/de/System.Runtime.InteropServices.xml",
+        "ref/netcore50/es/System.Runtime.InteropServices.xml",
+        "ref/netcore50/fr/System.Runtime.InteropServices.xml",
+        "ref/netcore50/it/System.Runtime.InteropServices.xml",
+        "ref/netcore50/ja/System.Runtime.InteropServices.xml",
+        "ref/netcore50/ko/System.Runtime.InteropServices.xml",
+        "ref/netcore50/ru/System.Runtime.InteropServices.xml",
+        "ref/netcore50/System.Runtime.InteropServices.dll",
+        "ref/netcore50/System.Runtime.InteropServices.xml",
+        "ref/netcore50/zh-hans/System.Runtime.InteropServices.xml",
+        "ref/netcore50/zh-hant/System.Runtime.InteropServices.xml",
+        "ref/win81/_._",
+        "ref/wpa81/_._",
         "ref/xamarinios10/_._",
         "ref/xamarinmac20/_._",
-        "runtimes/win8-aot/lib/netcore50/System.Runtime.InteropServices.dll",
-        "System.Runtime.InteropServices.4.0.20.nupkg",
-        "System.Runtime.InteropServices.4.0.20.nupkg.sha512",
+        "System.Runtime.InteropServices.4.0.10-beta-23127.nupkg",
+        "System.Runtime.InteropServices.4.0.10-beta-23127.nupkg.sha512",
         "System.Runtime.InteropServices.nuspec"
       ]
     },
     "": [
       "System.Console >= 4.0.0-beta-*",
       "System.Runtime >= 4.0.20-beta-*",
-      "System.Runtime.Extensions >= 4.0.10-beta-*"
+      "System.Runtime.Extensions >= 4.0.10-beta-*",
+      "System.Runtime.InteropServices >= 4.0.10-beta-*"
     ],
     "DNXCore,Version=v5.0": []
   }
-}
\ No newline at end of file
+}
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.cs
new file mode 100644 (file)
index 0000000..055705e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((char)o, Helper.Create(default(char)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((char?)o, Helper.Create(default(char)));
+    }
+
+    private static int Main()
+    {
+        char? s = Helper.Create(default(char));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox001.csproj
new file mode 100644 (file)
index 0000000..e66bc7e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.cs
new file mode 100644 (file)
index 0000000..a32522e
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of bool using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((bool)o, Helper.Create(default(bool)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((bool?)o, Helper.Create(default(bool)));
+    }
+
+    private static int Main()
+    {
+        bool? s = Helper.Create(default(bool));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox002.csproj
new file mode 100644 (file)
index 0000000..0c13b89
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.cs
new file mode 100644 (file)
index 0000000..11590f7
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((byte)o, Helper.Create(default(byte)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((byte?)o, Helper.Create(default(byte)));
+    }
+
+    private static int Main()
+    {
+        byte? s = Helper.Create(default(byte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox003.csproj
new file mode 100644 (file)
index 0000000..51c1291
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.cs
new file mode 100644 (file)
index 0000000..1154810
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of sbyte using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((sbyte)o, Helper.Create(default(sbyte)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((sbyte?)o, Helper.Create(default(sbyte)));
+    }
+
+    private static int Main()
+    {
+        sbyte? s = Helper.Create(default(sbyte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox004.csproj
new file mode 100644 (file)
index 0000000..fbded76
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox004.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.cs
new file mode 100644 (file)
index 0000000..09b7739
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((short)o, Helper.Create(default(short)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((short?)o, Helper.Create(default(short)));
+    }
+
+    private static int Main()
+    {
+        short? s = Helper.Create(default(short));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox005.csproj
new file mode 100644 (file)
index 0000000..f197b5e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox005.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.cs
new file mode 100644 (file)
index 0000000..1da64c5
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ushort using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ushort)o, Helper.Create(default(ushort)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ushort?)o, Helper.Create(default(ushort)));
+    }
+
+    private static int Main()
+    {
+        ushort? s = Helper.Create(default(ushort));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox006.csproj
new file mode 100644 (file)
index 0000000..895c6ae
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox006.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.cs
new file mode 100644 (file)
index 0000000..80fc537
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((int)o, Helper.Create(default(int)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((int?)o, Helper.Create(default(int)));
+    }
+
+    private static int Main()
+    {
+        int? s = Helper.Create(default(int));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox007.csproj
new file mode 100644 (file)
index 0000000..7dac143
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox007.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.cs
new file mode 100644 (file)
index 0000000..e82794f
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of uint using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((uint)o, Helper.Create(default(uint)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((uint?)o, Helper.Create(default(uint)));
+    }
+
+    private static int Main()
+    {
+        uint? s = Helper.Create(default(uint));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox008.csproj
new file mode 100644 (file)
index 0000000..d59906b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox008.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.cs
new file mode 100644 (file)
index 0000000..e1b80e5
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((long)o, Helper.Create(default(long)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((long?)o, Helper.Create(default(long)));
+    }
+
+    private static int Main()
+    {
+        long? s = Helper.Create(default(long));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox009.csproj
new file mode 100644 (file)
index 0000000..24a5a70
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox009.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.cs
new file mode 100644 (file)
index 0000000..5b39240
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ulong using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ulong)o, Helper.Create(default(ulong)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ulong?)o, Helper.Create(default(ulong)));
+    }
+
+    private static int Main()
+    {
+        ulong? s = Helper.Create(default(ulong));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox010.csproj
new file mode 100644 (file)
index 0000000..39ac6a2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox010.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.cs
new file mode 100644 (file)
index 0000000..2df4d0b
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((float)o, Helper.Create(default(float)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((float?)o, Helper.Create(default(float)));
+    }
+
+    private static int Main()
+    {
+        float? s = Helper.Create(default(float));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox011.csproj
new file mode 100644 (file)
index 0000000..bec7e50
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox011.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.cs
new file mode 100644 (file)
index 0000000..a4c916f
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of double using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((double)o, Helper.Create(default(double)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((double?)o, Helper.Create(default(double)));
+    }
+
+    private static int Main()
+    {
+        double? s = Helper.Create(default(double));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox012.csproj
new file mode 100644 (file)
index 0000000..c639f9c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox012.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.cs
new file mode 100644 (file)
index 0000000..9f796a7
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((decimal)o, Helper.Create(default(decimal)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((decimal?)o, Helper.Create(default(decimal)));
+    }
+
+    private static int Main()
+    {
+        decimal? s = Helper.Create(default(decimal));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox013.csproj
new file mode 100644 (file)
index 0000000..b0ff6da
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox013.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.cs
new file mode 100644 (file)
index 0000000..5e3fa61
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of IntPtr using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((IntPtr)o, Helper.Create(default(IntPtr)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((IntPtr?)o, Helper.Create(default(IntPtr)));
+    }
+
+    private static int Main()
+    {
+        IntPtr? s = Helper.Create(default(IntPtr));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox014.csproj
new file mode 100644 (file)
index 0000000..bfb2637
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox014.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.cs
new file mode 100644 (file)
index 0000000..db4bd57
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((UIntPtr)o, Helper.Create(default(UIntPtr)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((UIntPtr?)o, Helper.Create(default(UIntPtr)));
+    }
+
+    private static int Main()
+    {
+        UIntPtr? s = Helper.Create(default(UIntPtr));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox015.csproj
new file mode 100644 (file)
index 0000000..987c0d7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox015.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.cs
new file mode 100644 (file)
index 0000000..c390bb2
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of Guid using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((Guid)o, Helper.Create(default(Guid)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((Guid?)o, Helper.Create(default(Guid)));
+    }
+
+    private static int Main()
+    {
+        Guid? s = Helper.Create(default(Guid));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox016.csproj
new file mode 100644 (file)
index 0000000..d4ec66f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox016.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.cs
new file mode 100644 (file)
index 0000000..e7f17e0
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((GCHandle)o, Helper.Create(default(GCHandle)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((GCHandle?)o, Helper.Create(default(GCHandle)));
+    }
+
+    private static int Main()
+    {
+        GCHandle? s = Helper.Create(default(GCHandle));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox017.csproj
new file mode 100644 (file)
index 0000000..e742ab2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox017.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.cs
new file mode 100644 (file)
index 0000000..8864362
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ByteE using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ByteE)o, Helper.Create(default(ByteE)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ByteE?)o, Helper.Create(default(ByteE)));
+    }
+
+    private static int Main()
+    {
+        ByteE? s = Helper.Create(default(ByteE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox018.csproj
new file mode 100644 (file)
index 0000000..e7aebbd
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox018.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.cs
new file mode 100644 (file)
index 0000000..cbbf89d
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((IntE)o, Helper.Create(default(IntE)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((IntE?)o, Helper.Create(default(IntE)));
+    }
+
+    private static int Main()
+    {
+        IntE? s = Helper.Create(default(IntE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox019.csproj
new file mode 100644 (file)
index 0000000..57f5aac
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox019.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.cs
new file mode 100644 (file)
index 0000000..37f29ef
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of LongE using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((LongE)o, Helper.Create(default(LongE)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((LongE?)o, Helper.Create(default(LongE)));
+    }
+
+    private static int Main()
+    {
+        LongE? s = Helper.Create(default(LongE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox020.csproj
new file mode 100644 (file)
index 0000000..547b661
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox020.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.cs
new file mode 100644 (file)
index 0000000..9e16e6e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((EmptyStruct)o, Helper.Create(default(EmptyStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((EmptyStruct?)o, Helper.Create(default(EmptyStruct)));
+    }
+
+    private static int Main()
+    {
+        EmptyStruct? s = Helper.Create(default(EmptyStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox021.csproj
new file mode 100644 (file)
index 0000000..e6e986f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox021.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.cs
new file mode 100644 (file)
index 0000000..4d3398b
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStruct)o, Helper.Create(default(NotEmptyStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStruct?)o, Helper.Create(default(NotEmptyStruct)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox022.csproj
new file mode 100644 (file)
index 0000000..5751686
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox022.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.cs
new file mode 100644 (file)
index 0000000..27f1b38
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructQ)o, Helper.Create(default(NotEmptyStructQ)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructQ?)o, Helper.Create(default(NotEmptyStructQ)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox023.csproj
new file mode 100644 (file)
index 0000000..d0c7523
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox023.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.cs
new file mode 100644 (file)
index 0000000..830295f
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructA using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructA)o, Helper.Create(default(NotEmptyStructA)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructA?)o, Helper.Create(default(NotEmptyStructA)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox024.csproj
new file mode 100644 (file)
index 0000000..4ec7403
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox024.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.cs
new file mode 100644 (file)
index 0000000..85aa2a2
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructQA)o, Helper.Create(default(NotEmptyStructQA)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructQA?)o, Helper.Create(default(NotEmptyStructQA)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox025.csproj
new file mode 100644 (file)
index 0000000..821bda5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox025.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.cs
new file mode 100644 (file)
index 0000000..23e9f84
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of EmptyStructGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((EmptyStructGen<int>)o, Helper.Create(default(EmptyStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((EmptyStructGen<int>?)o, Helper.Create(default(EmptyStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        EmptyStructGen<int>? s = Helper.Create(default(EmptyStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox026.csproj
new file mode 100644 (file)
index 0000000..19e4584
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox026.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.cs
new file mode 100644 (file)
index 0000000..0b079fe
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructGen<int>)o, Helper.Create(default(NotEmptyStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructGen<int>?)o, Helper.Create(default(NotEmptyStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructGen<int>? s = Helper.Create(default(NotEmptyStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox027.csproj
new file mode 100644 (file)
index 0000000..f1db4b7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox027.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.cs
new file mode 100644 (file)
index 0000000..4dfb786
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGen<int>)o, Helper.Create(default(NotEmptyStructConstrainedGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGen<int>?)o, Helper.Create(default(NotEmptyStructConstrainedGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGen<int>? s = Helper.Create(default(NotEmptyStructConstrainedGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox028.csproj
new file mode 100644 (file)
index 0000000..19ee778
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox028.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.cs
new file mode 100644 (file)
index 0000000..18da1ef
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenA<int>)o, Helper.Create(default(NotEmptyStructConstrainedGenA<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenA<int>?)o, Helper.Create(default(NotEmptyStructConstrainedGenA<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenA<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenA<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox029.csproj
new file mode 100644 (file)
index 0000000..e0a761a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox029.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.cs
new file mode 100644 (file)
index 0000000..7ac1ec1
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGenQ<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQ<int>)o, Helper.Create(default(NotEmptyStructConstrainedGenQ<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQ<int>?)o, Helper.Create(default(NotEmptyStructConstrainedGenQ<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQ<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenQ<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox030.csproj
new file mode 100644 (file)
index 0000000..5332b8f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox030.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.cs
new file mode 100644 (file)
index 0000000..03b00fc
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQA<int>)o, Helper.Create(default(NotEmptyStructConstrainedGenQA<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQA<int>?)o, Helper.Create(default(NotEmptyStructConstrainedGenQA<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQA<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenQA<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox031.csproj
new file mode 100644 (file)
index 0000000..6c15fe3
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox031.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.cs
new file mode 100644 (file)
index 0000000..e09d68e
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NestedStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NestedStruct)o, Helper.Create(default(NestedStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NestedStruct?)o, Helper.Create(default(NestedStruct)));
+    }
+
+    private static int Main()
+    {
+        NestedStruct? s = Helper.Create(default(NestedStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox032.csproj
new file mode 100644 (file)
index 0000000..a62be05
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox032.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.cs
new file mode 100644 (file)
index 0000000..ec46775
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NestedStructGen<int>)o, Helper.Create(default(NestedStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NestedStructGen<int>?)o, Helper.Create(default(NestedStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NestedStructGen<int>? s = Helper.Create(default(NestedStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox033.csproj
new file mode 100644 (file)
index 0000000..519edd3
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox033.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.cs
new file mode 100644 (file)
index 0000000..53a3c2c
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ExplicitFieldOffsetStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ExplicitFieldOffsetStruct)o, Helper.Create(default(ExplicitFieldOffsetStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ExplicitFieldOffsetStruct?)o, Helper.Create(default(ExplicitFieldOffsetStruct)));
+    }
+
+    private static int Main()
+    {
+        ExplicitFieldOffsetStruct? s = Helper.Create(default(ExplicitFieldOffsetStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox034.csproj
new file mode 100644 (file)
index 0000000..4318dd4
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox034.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.cs
new file mode 100644 (file)
index 0000000..c55582e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((MarshalAsStruct)o, Helper.Create(default(MarshalAsStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((MarshalAsStruct?)o, Helper.Create(default(MarshalAsStruct)));
+    }
+
+    private static int Main()
+    {
+        MarshalAsStruct? s = Helper.Create(default(MarshalAsStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox037.csproj
new file mode 100644 (file)
index 0000000..bd6fe46
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox037.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.cs
new file mode 100644 (file)
index 0000000..7297206
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterface using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterface)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterface?)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox038.csproj
new file mode 100644 (file)
index 0000000..2b85284
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox038.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.cs
new file mode 100644 (file)
index 0000000..6f409f7
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterface)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterface?)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox039.csproj
new file mode 100644 (file)
index 0000000..f2c72e2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox039.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.cs
new file mode 100644 (file)
index 0000000..58984d1
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterfaceGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>?)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterfaceGen<int>? s = Helper.Create(default(ImplementOneInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox040.csproj
new file mode 100644 (file)
index 0000000..23ccd4c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox040.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.cs
new file mode 100644 (file)
index 0000000..aaa93d1
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>?)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterfaceGen<int>? s = Helper.Create(default(ImplementTwoInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox041.csproj
new file mode 100644 (file)
index 0000000..881db12
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox041.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.cs
new file mode 100644 (file)
index 0000000..dab1a0a
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementAllInterface<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>?)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementAllInterface<int>? s = Helper.Create(default(ImplementAllInterface<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox042.csproj
new file mode 100644 (file)
index 0000000..f7dd626
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox042.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.cs
new file mode 100644 (file)
index 0000000..3e02d8a
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((WithMultipleGCHandleStruct)o, Helper.Create(default(WithMultipleGCHandleStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((WithMultipleGCHandleStruct?)o, Helper.Create(default(WithMultipleGCHandleStruct)));
+    }
+
+    private static int Main()
+    {
+        WithMultipleGCHandleStruct? s = Helper.Create(default(WithMultipleGCHandleStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox043.csproj
new file mode 100644 (file)
index 0000000..e326f20
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox043.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.cs
new file mode 100644 (file)
index 0000000..d1d8067
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of WithOnlyFXTypeStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((WithOnlyFXTypeStruct)o, Helper.Create(default(WithOnlyFXTypeStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((WithOnlyFXTypeStruct?)o, Helper.Create(default(WithOnlyFXTypeStruct)));
+    }
+
+    private static int Main()
+    {
+        WithOnlyFXTypeStruct? s = Helper.Create(default(WithOnlyFXTypeStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox044.csproj
new file mode 100644 (file)
index 0000000..3a7928e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox044.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.cs
new file mode 100644 (file)
index 0000000..b1a403a
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((MixedAllStruct)o, Helper.Create(default(MixedAllStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((MixedAllStruct?)o, Helper.Create(default(MixedAllStruct)));
+    }
+
+    private static int Main()
+    {
+        MixedAllStruct? s = Helper.Create(default(MixedAllStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/box-unbox/box-unbox045.csproj
new file mode 100644 (file)
index 0000000..de5533e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox045.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.cs
new file mode 100644 (file)
index 0000000..30fa5b6
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of IntE using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(Enum o)
+    {
+        return Helper.Compare((IntE)o, Helper.Create(default(IntE)));
+    }
+
+    private static bool BoxUnboxToQ(Enum o)
+    {
+        return Helper.Compare((IntE?)o, Helper.Create(default(IntE)));
+    }
+
+    private static int Main()
+    {
+        IntE? s = Helper.Create(default(IntE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum001.csproj
new file mode 100644 (file)
index 0000000..da35c58
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-enum001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.cs
new file mode 100644 (file)
index 0000000..f089934
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(Enum o)
+    {
+        return Helper.Compare((ByteE)o, Helper.Create(default(ByteE)));
+    }
+
+    private static bool BoxUnboxToQ(Enum o)
+    {
+        return Helper.Compare((ByteE?)o, Helper.Create(default(ByteE)));
+    }
+
+    private static int Main()
+    {
+        ByteE? s = Helper.Create(default(ByteE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum002.csproj
new file mode 100644 (file)
index 0000000..2158e0d
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-enum002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.cs
new file mode 100644 (file)
index 0000000..bd5748e
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of LongE using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(Enum o)
+    {
+        return Helper.Compare((LongE)o, Helper.Create(default(LongE)));
+    }
+
+    private static bool BoxUnboxToQ(Enum o)
+    {
+        return Helper.Compare((LongE?)o, Helper.Create(default(LongE)));
+    }
+
+    private static int Main()
+    {
+        LongE? s = Helper.Create(default(LongE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/enum/box-unbox-enum003.csproj
new file mode 100644 (file)
index 0000000..22fccce
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-enum003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.cs
new file mode 100644 (file)
index 0000000..ab353a5
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((char)(object)o, Helper.Create(default(char)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((char?)(object)o, Helper.Create(default(char)));
+    }
+
+    private static int Main()
+    {
+        char? s = Helper.Create(default(char));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics001.csproj
new file mode 100644 (file)
index 0000000..c9bc47b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.cs
new file mode 100644 (file)
index 0000000..4f7a5fc
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of bool using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((bool)(object)o, Helper.Create(default(bool)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((bool?)(object)o, Helper.Create(default(bool)));
+    }
+
+    private static int Main()
+    {
+        bool? s = Helper.Create(default(bool));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics002.csproj
new file mode 100644 (file)
index 0000000..8df3dd5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.cs
new file mode 100644 (file)
index 0000000..f7f3792
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((byte)(object)o, Helper.Create(default(byte)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((byte?)(object)o, Helper.Create(default(byte)));
+    }
+
+    private static int Main()
+    {
+        byte? s = Helper.Create(default(byte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics003.csproj
new file mode 100644 (file)
index 0000000..f68e841
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.cs
new file mode 100644 (file)
index 0000000..4cd6963
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of sbyte using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((sbyte)(object)o, Helper.Create(default(sbyte)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((sbyte?)(object)o, Helper.Create(default(sbyte)));
+    }
+
+    private static int Main()
+    {
+        sbyte? s = Helper.Create(default(sbyte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics004.csproj
new file mode 100644 (file)
index 0000000..159a1d0
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics004.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.cs
new file mode 100644 (file)
index 0000000..d287dd2
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((short)(object)o, Helper.Create(default(short)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((short?)(object)o, Helper.Create(default(short)));
+    }
+
+    private static int Main()
+    {
+        short? s = Helper.Create(default(short));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics005.csproj
new file mode 100644 (file)
index 0000000..14ab9bd
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics005.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.cs
new file mode 100644 (file)
index 0000000..c01ad7a
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ushort using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ushort)(object)o, Helper.Create(default(ushort)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ushort?)(object)o, Helper.Create(default(ushort)));
+    }
+
+    private static int Main()
+    {
+        ushort? s = Helper.Create(default(ushort));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics006.csproj
new file mode 100644 (file)
index 0000000..364517b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics006.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.cs
new file mode 100644 (file)
index 0000000..0bd8434
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((int)(object)o, Helper.Create(default(int)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((int?)(object)o, Helper.Create(default(int)));
+    }
+
+    private static int Main()
+    {
+        int? s = Helper.Create(default(int));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics007.csproj
new file mode 100644 (file)
index 0000000..8ae3fc1
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics007.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.cs
new file mode 100644 (file)
index 0000000..677de33
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of uint using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((uint)(object)o, Helper.Create(default(uint)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((uint?)(object)o, Helper.Create(default(uint)));
+    }
+
+    private static int Main()
+    {
+        uint? s = Helper.Create(default(uint));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics008.csproj
new file mode 100644 (file)
index 0000000..f7e2878
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics008.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.cs
new file mode 100644 (file)
index 0000000..f0a0926
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((long)(object)o, Helper.Create(default(long)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((long?)(object)o, Helper.Create(default(long)));
+    }
+
+    private static int Main()
+    {
+        long? s = Helper.Create(default(long));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics009.csproj
new file mode 100644 (file)
index 0000000..ed00f69
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics009.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.cs
new file mode 100644 (file)
index 0000000..f959d29
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ulong using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ulong)(object)o, Helper.Create(default(ulong)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ulong?)(object)o, Helper.Create(default(ulong)));
+    }
+
+    private static int Main()
+    {
+        ulong? s = Helper.Create(default(ulong));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics010.csproj
new file mode 100644 (file)
index 0000000..42b8eb5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics010.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.cs
new file mode 100644 (file)
index 0000000..cbf4660
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((float)(object)o, Helper.Create(default(float)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((float?)(object)o, Helper.Create(default(float)));
+    }
+
+    private static int Main()
+    {
+        float? s = Helper.Create(default(float));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics011.csproj
new file mode 100644 (file)
index 0000000..e334cc6
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics011.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.cs
new file mode 100644 (file)
index 0000000..4416220
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of double using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((double)(object)o, Helper.Create(default(double)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((double?)(object)o, Helper.Create(default(double)));
+    }
+
+    private static int Main()
+    {
+        double? s = Helper.Create(default(double));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics012.csproj
new file mode 100644 (file)
index 0000000..23218f6
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics012.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.cs
new file mode 100644 (file)
index 0000000..1e6449e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((decimal)(object)o, Helper.Create(default(decimal)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((decimal?)(object)o, Helper.Create(default(decimal)));
+    }
+
+    private static int Main()
+    {
+        decimal? s = Helper.Create(default(decimal));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics013.csproj
new file mode 100644 (file)
index 0000000..41b944a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics013.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.cs
new file mode 100644 (file)
index 0000000..b74e74d
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of IntPtr using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((IntPtr)(object)o, Helper.Create(default(IntPtr)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((IntPtr?)(object)o, Helper.Create(default(IntPtr)));
+    }
+
+    private static int Main()
+    {
+        IntPtr? s = Helper.Create(default(IntPtr));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics014.csproj
new file mode 100644 (file)
index 0000000..6d2e397
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics014.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.cs
new file mode 100644 (file)
index 0000000..fc0d793
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((UIntPtr)(object)o, Helper.Create(default(UIntPtr)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((UIntPtr?)(object)o, Helper.Create(default(UIntPtr)));
+    }
+
+    private static int Main()
+    {
+        UIntPtr? s = Helper.Create(default(UIntPtr));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics015.csproj
new file mode 100644 (file)
index 0000000..29be0ad
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics015.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.cs
new file mode 100644 (file)
index 0000000..10e0c03
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of Guid using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((Guid)(object)o, Helper.Create(default(Guid)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((Guid?)(object)o, Helper.Create(default(Guid)));
+    }
+
+    private static int Main()
+    {
+        Guid? s = Helper.Create(default(Guid));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics016.csproj
new file mode 100644 (file)
index 0000000..d2c5931
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics016.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.cs
new file mode 100644 (file)
index 0000000..85cabc5
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((GCHandle)(object)o, Helper.Create(default(GCHandle)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((GCHandle?)(object)o, Helper.Create(default(GCHandle)));
+    }
+
+    private static int Main()
+    {
+        GCHandle? s = Helper.Create(default(GCHandle));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics017.csproj
new file mode 100644 (file)
index 0000000..abc935c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics017.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.cs
new file mode 100644 (file)
index 0000000..bef3b25
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ByteE using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ByteE)(object)o, Helper.Create(default(ByteE)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ByteE?)(object)o, Helper.Create(default(ByteE)));
+    }
+
+    private static int Main()
+    {
+        ByteE? s = Helper.Create(default(ByteE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics018.csproj
new file mode 100644 (file)
index 0000000..41aa64b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics018.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.cs
new file mode 100644 (file)
index 0000000..c0b21de
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((IntE)(object)o, Helper.Create(default(IntE)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((IntE?)(object)o, Helper.Create(default(IntE)));
+    }
+
+    private static int Main()
+    {
+        IntE? s = Helper.Create(default(IntE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics019.csproj
new file mode 100644 (file)
index 0000000..8a173b6
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics019.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.cs
new file mode 100644 (file)
index 0000000..86bad94
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of LongE using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((LongE)(object)o, Helper.Create(default(LongE)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((LongE?)(object)o, Helper.Create(default(LongE)));
+    }
+
+    private static int Main()
+    {
+        LongE? s = Helper.Create(default(LongE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics020.csproj
new file mode 100644 (file)
index 0000000..246482a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics020.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.cs
new file mode 100644 (file)
index 0000000..08693ed
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((EmptyStruct)(object)o, Helper.Create(default(EmptyStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((EmptyStruct?)(object)o, Helper.Create(default(EmptyStruct)));
+    }
+
+    private static int Main()
+    {
+        EmptyStruct? s = Helper.Create(default(EmptyStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics021.csproj
new file mode 100644 (file)
index 0000000..d7bcc4e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics021.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.cs
new file mode 100644 (file)
index 0000000..c8619cd
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStruct)(object)o, Helper.Create(default(NotEmptyStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStruct?)(object)o, Helper.Create(default(NotEmptyStruct)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics022.csproj
new file mode 100644 (file)
index 0000000..888a86e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics022.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.cs
new file mode 100644 (file)
index 0000000..958783f
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructQ)(object)o, Helper.Create(default(NotEmptyStructQ)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructQ?)(object)o, Helper.Create(default(NotEmptyStructQ)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics023.csproj
new file mode 100644 (file)
index 0000000..af1a4e0
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics023.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.cs
new file mode 100644 (file)
index 0000000..4cb2bce
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructA using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructA)(object)o, Helper.Create(default(NotEmptyStructA)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructA?)(object)o, Helper.Create(default(NotEmptyStructA)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics024.csproj
new file mode 100644 (file)
index 0000000..7dd245c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics024.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.cs
new file mode 100644 (file)
index 0000000..122a594
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructQA)(object)o, Helper.Create(default(NotEmptyStructQA)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructQA?)(object)o, Helper.Create(default(NotEmptyStructQA)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics025.csproj
new file mode 100644 (file)
index 0000000..30b8826
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics025.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.cs
new file mode 100644 (file)
index 0000000..b456f9c
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of EmptyStructGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((EmptyStructGen<int>)(object)o, Helper.Create(default(EmptyStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((EmptyStructGen<int>?)(object)o, Helper.Create(default(EmptyStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        EmptyStructGen<int>? s = Helper.Create(default(EmptyStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics026.csproj
new file mode 100644 (file)
index 0000000..3d5b4c2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics026.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.cs
new file mode 100644 (file)
index 0000000..422b064
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructGen<int>)(object)o, Helper.Create(default(NotEmptyStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructGen<int>?)(object)o, Helper.Create(default(NotEmptyStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructGen<int>? s = Helper.Create(default(NotEmptyStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics027.csproj
new file mode 100644 (file)
index 0000000..e439a37
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics027.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.cs
new file mode 100644 (file)
index 0000000..e85f1a3
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGen<int>)(object)o, Helper.Create(default(NotEmptyStructConstrainedGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGen<int>?)(object)o, Helper.Create(default(NotEmptyStructConstrainedGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGen<int>? s = Helper.Create(default(NotEmptyStructConstrainedGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics028.csproj
new file mode 100644 (file)
index 0000000..36a3876
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics028.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.cs
new file mode 100644 (file)
index 0000000..9daba67
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenA<int>)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenA<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenA<int>?)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenA<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenA<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenA<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics029.csproj
new file mode 100644 (file)
index 0000000..0c50406
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics029.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.cs
new file mode 100644 (file)
index 0000000..c904e82
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGenQ<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQ<int>)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQ<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQ<int>?)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQ<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQ<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenQ<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics030.csproj
new file mode 100644 (file)
index 0000000..35cd6a9
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics030.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.cs
new file mode 100644 (file)
index 0000000..5863835
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQA<int>)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQA<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQA<int>?)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQA<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQA<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenQA<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics031.csproj
new file mode 100644 (file)
index 0000000..45af06d
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics031.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.cs
new file mode 100644 (file)
index 0000000..da43073
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NestedStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NestedStruct)(object)o, Helper.Create(default(NestedStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NestedStruct?)(object)o, Helper.Create(default(NestedStruct)));
+    }
+
+    private static int Main()
+    {
+        NestedStruct? s = Helper.Create(default(NestedStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics032.csproj
new file mode 100644 (file)
index 0000000..398f8be
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics032.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.cs
new file mode 100644 (file)
index 0000000..5eb0c41
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NestedStructGen<int>)(object)o, Helper.Create(default(NestedStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NestedStructGen<int>?)(object)o, Helper.Create(default(NestedStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NestedStructGen<int>? s = Helper.Create(default(NestedStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics033.csproj
new file mode 100644 (file)
index 0000000..bb8b1a2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics033.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.cs
new file mode 100644 (file)
index 0000000..0609d96
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ExplicitFieldOffsetStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ExplicitFieldOffsetStruct)(object)o, Helper.Create(default(ExplicitFieldOffsetStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ExplicitFieldOffsetStruct?)(object)o, Helper.Create(default(ExplicitFieldOffsetStruct)));
+    }
+
+    private static int Main()
+    {
+        ExplicitFieldOffsetStruct? s = Helper.Create(default(ExplicitFieldOffsetStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics034.csproj
new file mode 100644 (file)
index 0000000..6bb3f61
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics034.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.cs
new file mode 100644 (file)
index 0000000..31e96cc
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((MarshalAsStruct)(object)o, Helper.Create(default(MarshalAsStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((MarshalAsStruct?)(object)o, Helper.Create(default(MarshalAsStruct)));
+    }
+
+    private static int Main()
+    {
+        MarshalAsStruct? s = Helper.Create(default(MarshalAsStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics037.csproj
new file mode 100644 (file)
index 0000000..83f4784
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics037.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.cs
new file mode 100644 (file)
index 0000000..c032132
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterface using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ImplementOneInterface)(object)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ImplementOneInterface?)(object)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics038.csproj
new file mode 100644 (file)
index 0000000..0d46f5f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics038.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.cs
new file mode 100644 (file)
index 0000000..a05b110
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ImplementTwoInterface)(object)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ImplementTwoInterface?)(object)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics039.csproj
new file mode 100644 (file)
index 0000000..eb80698
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics039.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.cs
new file mode 100644 (file)
index 0000000..7c2fcfc
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterfaceGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>)(object)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>?)(object)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterfaceGen<int>? s = Helper.Create(default(ImplementOneInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics040.csproj
new file mode 100644 (file)
index 0000000..bd85395
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics040.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.cs
new file mode 100644 (file)
index 0000000..535a0bd
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>)(object)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>?)(object)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterfaceGen<int>? s = Helper.Create(default(ImplementTwoInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics041.csproj
new file mode 100644 (file)
index 0000000..11128cd
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics041.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.cs
new file mode 100644 (file)
index 0000000..b19d98d
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementAllInterface<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>)(object)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>?)(object)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementAllInterface<int>? s = Helper.Create(default(ImplementAllInterface<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics042.csproj
new file mode 100644 (file)
index 0000000..89673fb
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics042.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.cs
new file mode 100644 (file)
index 0000000..8f34549
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((WithMultipleGCHandleStruct)(object)o, Helper.Create(default(WithMultipleGCHandleStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((WithMultipleGCHandleStruct?)(object)o, Helper.Create(default(WithMultipleGCHandleStruct)));
+    }
+
+    private static int Main()
+    {
+        WithMultipleGCHandleStruct? s = Helper.Create(default(WithMultipleGCHandleStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics043.csproj
new file mode 100644 (file)
index 0000000..82144e6
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics043.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.cs
new file mode 100644 (file)
index 0000000..9fa84b4
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of WithOnlyFXTypeStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((WithOnlyFXTypeStruct)(object)o, Helper.Create(default(WithOnlyFXTypeStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((WithOnlyFXTypeStruct?)(object)o, Helper.Create(default(WithOnlyFXTypeStruct)));
+    }
+
+    private static int Main()
+    {
+        WithOnlyFXTypeStruct? s = Helper.Create(default(WithOnlyFXTypeStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics044.csproj
new file mode 100644 (file)
index 0000000..57d44d9
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics044.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.cs
new file mode 100644 (file)
index 0000000..ef35b7e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((MixedAllStruct)(object)o, Helper.Create(default(MixedAllStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((MixedAllStruct?)(object)o, Helper.Create(default(MixedAllStruct)));
+    }
+
+    private static int Main()
+    {
+        MixedAllStruct? s = Helper.Create(default(MixedAllStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/generics/box-unbox-generics045.csproj
new file mode 100644 (file)
index 0000000..9db3f9a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-generics045.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.cs
new file mode 100644 (file)
index 0000000..3bdeaf2
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterface using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IEmpty o)
+    {
+        return Helper.Compare((ImplementOneInterface)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static bool BoxUnboxToQ(IEmpty o)
+    {
+        return Helper.Compare((ImplementOneInterface?)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface001.csproj
new file mode 100644 (file)
index 0000000..aeb1b77
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.cs
new file mode 100644 (file)
index 0000000..4e77831
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IEmpty o)
+    {
+        return Helper.Compare((ImplementTwoInterface)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static bool BoxUnboxToQ(IEmpty o)
+    {
+        return Helper.Compare((ImplementTwoInterface?)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface002.csproj
new file mode 100644 (file)
index 0000000..2fcd0f1
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.cs
new file mode 100644 (file)
index 0000000..dcad64d
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterfaceGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IEmptyGen<int> o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(IEmptyGen<int> o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>?)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterfaceGen<int>? s = Helper.Create(default(ImplementOneInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface003.csproj
new file mode 100644 (file)
index 0000000..90f1587
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.cs
new file mode 100644 (file)
index 0000000..46bec2b
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IEmptyGen<int> o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(IEmptyGen<int> o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>?)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterfaceGen<int>? s = Helper.Create(default(ImplementTwoInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface004.csproj
new file mode 100644 (file)
index 0000000..c3c2b1b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface004.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.cs
new file mode 100644 (file)
index 0000000..27d813b
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementAllInterface<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IEmpty o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static bool BoxUnboxToQ(IEmpty o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>?)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementAllInterface<int>? s = Helper.Create(default(ImplementAllInterface<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface005.csproj
new file mode 100644 (file)
index 0000000..99cb715
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface005.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.cs
new file mode 100644 (file)
index 0000000..e542b8f
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((char)o, Helper.Create(default(char)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((char?)o, Helper.Create(default(char)));
+    }
+
+    private static int Main()
+    {
+        char? s = Helper.Create(default(char));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface006.csproj
new file mode 100644 (file)
index 0000000..89d39a4
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface006.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.cs
new file mode 100644 (file)
index 0000000..f962e53
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of bool using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((bool)o, Helper.Create(default(bool)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((bool?)o, Helper.Create(default(bool)));
+    }
+
+    private static int Main()
+    {
+        bool? s = Helper.Create(default(bool));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface007.csproj
new file mode 100644 (file)
index 0000000..d7d5b8a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface007.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.cs
new file mode 100644 (file)
index 0000000..8973986
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((byte)o, Helper.Create(default(byte)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((byte?)o, Helper.Create(default(byte)));
+    }
+
+    private static int Main()
+    {
+        byte? s = Helper.Create(default(byte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface008.csproj
new file mode 100644 (file)
index 0000000..0602110
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface008.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.cs
new file mode 100644 (file)
index 0000000..dcfc384
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of sbyte using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((sbyte)o, Helper.Create(default(sbyte)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((sbyte?)o, Helper.Create(default(sbyte)));
+    }
+
+    private static int Main()
+    {
+        sbyte? s = Helper.Create(default(sbyte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface009.csproj
new file mode 100644 (file)
index 0000000..e6e697f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface009.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.cs
new file mode 100644 (file)
index 0000000..1ec8e9f
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((short)o, Helper.Create(default(short)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((short?)o, Helper.Create(default(short)));
+    }
+
+    private static int Main()
+    {
+        short? s = Helper.Create(default(short));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface010.csproj
new file mode 100644 (file)
index 0000000..fd6d193
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface010.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.cs
new file mode 100644 (file)
index 0000000..e06543c
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ushort using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((ushort)o, Helper.Create(default(ushort)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((ushort?)o, Helper.Create(default(ushort)));
+    }
+
+    private static int Main()
+    {
+        ushort? s = Helper.Create(default(ushort));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface011.csproj
new file mode 100644 (file)
index 0000000..4ecd201
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface011.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.cs
new file mode 100644 (file)
index 0000000..58bdc7a
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((int)o, Helper.Create(default(int)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((int?)o, Helper.Create(default(int)));
+    }
+
+    private static int Main()
+    {
+        int? s = Helper.Create(default(int));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface012.csproj
new file mode 100644 (file)
index 0000000..dc86bc3
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface012.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.cs
new file mode 100644 (file)
index 0000000..e39229d
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of uint using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((uint)o, Helper.Create(default(uint)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((uint?)o, Helper.Create(default(uint)));
+    }
+
+    private static int Main()
+    {
+        uint? s = Helper.Create(default(uint));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface013.csproj
new file mode 100644 (file)
index 0000000..a44fac8
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface013.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.cs
new file mode 100644 (file)
index 0000000..2221517
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((long)o, Helper.Create(default(long)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((long?)o, Helper.Create(default(long)));
+    }
+
+    private static int Main()
+    {
+        long? s = Helper.Create(default(long));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface014.csproj
new file mode 100644 (file)
index 0000000..6568ac8
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface014.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.cs
new file mode 100644 (file)
index 0000000..d799174
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ulong using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((ulong)o, Helper.Create(default(ulong)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((ulong?)o, Helper.Create(default(ulong)));
+    }
+
+    private static int Main()
+    {
+        ulong? s = Helper.Create(default(ulong));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface015.csproj
new file mode 100644 (file)
index 0000000..b94ba5f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface015.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.cs
new file mode 100644 (file)
index 0000000..f417010
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((float)o, Helper.Create(default(float)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((float?)o, Helper.Create(default(float)));
+    }
+
+    private static int Main()
+    {
+        float? s = Helper.Create(default(float));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface016.csproj
new file mode 100644 (file)
index 0000000..23198be
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface016.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.cs
new file mode 100644 (file)
index 0000000..ccc826b
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of double using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((double)o, Helper.Create(default(double)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((double?)o, Helper.Create(default(double)));
+    }
+
+    private static int Main()
+    {
+        double? s = Helper.Create(default(double));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface017.csproj
new file mode 100644 (file)
index 0000000..1cd2e37
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface017.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.cs
new file mode 100644 (file)
index 0000000..2152a41
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(IComparable o)
+    {
+        return Helper.Compare((decimal)o, Helper.Create(default(decimal)));
+    }
+
+    private static bool BoxUnboxToQ(IComparable o)
+    {
+        return Helper.Compare((decimal?)o, Helper.Create(default(decimal)));
+    }
+
+    private static int Main()
+    {
+        decimal? s = Helper.Create(default(decimal));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/interface/box-unbox-interface018.csproj
new file mode 100644 (file)
index 0000000..0fbff9b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-interface018.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.cs
new file mode 100644 (file)
index 0000000..7b5640a
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of char using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((char?)o) == null;
+    }
+
+    private static int Main()
+    {
+        char? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null001.csproj
new file mode 100644 (file)
index 0000000..08b70a8
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.cs
new file mode 100644 (file)
index 0000000..25b3b71
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((bool?)o) == null;
+    }
+
+    private static int Main()
+    {
+        bool? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null002.csproj
new file mode 100644 (file)
index 0000000..7015f89
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.cs
new file mode 100644 (file)
index 0000000..c01bcfb
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of byte using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((byte?)o) == null;
+    }
+
+    private static int Main()
+    {
+        byte? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null003.csproj
new file mode 100644 (file)
index 0000000..01b7975
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.cs
new file mode 100644 (file)
index 0000000..20d618f
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((sbyte?)o) == null;
+    }
+
+    private static int Main()
+    {
+        sbyte? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null004.csproj
new file mode 100644 (file)
index 0000000..51a247f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null004.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.cs
new file mode 100644 (file)
index 0000000..a23538e
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of short using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((short?)o) == null;
+    }
+
+    private static int Main()
+    {
+        short? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null005.csproj
new file mode 100644 (file)
index 0000000..34e9ff1
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null005.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.cs
new file mode 100644 (file)
index 0000000..c48103d
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ushort?)o) == null;
+    }
+
+    private static int Main()
+    {
+        ushort? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null006.csproj
new file mode 100644 (file)
index 0000000..4d60875
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null006.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.cs
new file mode 100644 (file)
index 0000000..2935d91
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of int using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((int?)o) == null;
+    }
+
+    private static int Main()
+    {
+        int? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null007.csproj
new file mode 100644 (file)
index 0000000..28c7d56
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null007.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.cs
new file mode 100644 (file)
index 0000000..1980350
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((uint?)o) == null;
+    }
+
+    private static int Main()
+    {
+        uint? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null008.csproj
new file mode 100644 (file)
index 0000000..c0aa858
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null008.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.cs
new file mode 100644 (file)
index 0000000..966f0b1
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of long using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((long?)o) == null;
+    }
+
+    private static int Main()
+    {
+        long? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null009.csproj
new file mode 100644 (file)
index 0000000..5c5269d
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null009.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.cs
new file mode 100644 (file)
index 0000000..8be0349
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ulong?)o) == null;
+    }
+
+    private static int Main()
+    {
+        ulong? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null010.csproj
new file mode 100644 (file)
index 0000000..f9da5c7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null010.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.cs
new file mode 100644 (file)
index 0000000..64fdd76
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of float using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((float?)o) == null;
+    }
+
+    private static int Main()
+    {
+        float? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null011.csproj
new file mode 100644 (file)
index 0000000..edcca66
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null011.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.cs
new file mode 100644 (file)
index 0000000..8de79d9
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((double?)o) == null;
+    }
+
+    private static int Main()
+    {
+        double? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null012.csproj
new file mode 100644 (file)
index 0000000..9cb9c2a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null012.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.cs
new file mode 100644 (file)
index 0000000..21fe428
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of decimal using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((decimal?)o) == null;
+    }
+
+    private static int Main()
+    {
+        decimal? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null013.csproj
new file mode 100644 (file)
index 0000000..0b998f4
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null013.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.cs
new file mode 100644 (file)
index 0000000..b3fffdf
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((IntPtr?)o) == null;
+    }
+
+    private static int Main()
+    {
+        IntPtr? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null014.csproj
new file mode 100644 (file)
index 0000000..1b25624
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null014.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.cs
new file mode 100644 (file)
index 0000000..9aa6923
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of UIntPtr using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((UIntPtr?)o) == null;
+    }
+
+    private static int Main()
+    {
+        UIntPtr? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null015.csproj
new file mode 100644 (file)
index 0000000..c471a87
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null015.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.cs
new file mode 100644 (file)
index 0000000..b57e355
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((Guid?)o) == null;
+    }
+
+    private static int Main()
+    {
+        Guid? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null016.csproj
new file mode 100644 (file)
index 0000000..3084c44
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null016.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.cs
new file mode 100644 (file)
index 0000000..7158b97
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of GCHandle using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((GCHandle?)o) == null;
+    }
+
+    private static int Main()
+    {
+        GCHandle? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null017.csproj
new file mode 100644 (file)
index 0000000..2b93489
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null017.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.cs
new file mode 100644 (file)
index 0000000..e246757
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ByteE?)o) == null;
+    }
+
+    private static int Main()
+    {
+        ByteE? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null018.csproj
new file mode 100644 (file)
index 0000000..f0c01fb
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null018.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.cs
new file mode 100644 (file)
index 0000000..f8a60b8
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of IntE using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((IntE?)o) == null;
+    }
+
+    private static int Main()
+    {
+        IntE? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null019.csproj
new file mode 100644 (file)
index 0000000..eb69488
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null019.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.cs
new file mode 100644 (file)
index 0000000..19f623d
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((LongE?)o) == null;
+    }
+
+    private static int Main()
+    {
+        LongE? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null020.csproj
new file mode 100644 (file)
index 0000000..9c64824
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null020.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.cs
new file mode 100644 (file)
index 0000000..4e7f496
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of EmptyStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((EmptyStruct?)o) == null;
+    }
+
+    private static int Main()
+    {
+        EmptyStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null021.csproj
new file mode 100644 (file)
index 0000000..2ca4c5f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null021.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.cs
new file mode 100644 (file)
index 0000000..4da034e
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStruct?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null022.csproj
new file mode 100644 (file)
index 0000000..6fa2290
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null022.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.cs
new file mode 100644 (file)
index 0000000..da3f017
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructQ using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructQ?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQ? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null023.csproj
new file mode 100644 (file)
index 0000000..6ab6af0
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null023.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.cs
new file mode 100644 (file)
index 0000000..78a9736
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructA?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructA? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null024.csproj
new file mode 100644 (file)
index 0000000..d85b324
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null024.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.cs
new file mode 100644 (file)
index 0000000..413fcd7
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructQA using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructQA?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQA? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null025.csproj
new file mode 100644 (file)
index 0000000..3775e95
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null025.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.cs
new file mode 100644 (file)
index 0000000..ee90cdb
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((EmptyStructGen<int>?)o) == null;
+    }
+
+    private static int Main()
+    {
+        EmptyStructGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null026.csproj
new file mode 100644 (file)
index 0000000..af27a49
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null026.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.cs
new file mode 100644 (file)
index 0000000..5af5df4
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructGen<int>?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null027.csproj
new file mode 100644 (file)
index 0000000..faa3c60
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null027.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.cs
new file mode 100644 (file)
index 0000000..1680934
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructConstrainedGen<int>?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null028.csproj
new file mode 100644 (file)
index 0000000..3edd828
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null028.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.cs
new file mode 100644 (file)
index 0000000..dcea3c1
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGenA<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructConstrainedGenA<int>?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenA<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null029.csproj
new file mode 100644 (file)
index 0000000..56a479e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null029.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.cs
new file mode 100644 (file)
index 0000000..c477ca4
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructConstrainedGenQ<int>?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQ<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null030.csproj
new file mode 100644 (file)
index 0000000..dbdedae
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null030.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.cs
new file mode 100644 (file)
index 0000000..690109c
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGenQA<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructConstrainedGenQA<int>?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQA<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null031.csproj
new file mode 100644 (file)
index 0000000..0fbc1b0
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null031.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.cs
new file mode 100644 (file)
index 0000000..64063eb
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NestedStruct?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NestedStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null032.csproj
new file mode 100644 (file)
index 0000000..1877580
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null032.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.cs
new file mode 100644 (file)
index 0000000..2702116
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NestedStructGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NestedStructGen<int>?)o) == null;
+    }
+
+    private static int Main()
+    {
+        NestedStructGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null033.csproj
new file mode 100644 (file)
index 0000000..eec9f7c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null033.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.cs
new file mode 100644 (file)
index 0000000..3d9a420
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ExplicitFieldOffsetStruct?)o) == null;
+    }
+
+    private static int Main()
+    {
+        ExplicitFieldOffsetStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null034.csproj
new file mode 100644 (file)
index 0000000..c089efa
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null034.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.cs
new file mode 100644 (file)
index 0000000..b9a74df
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of MarshalAsStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((MarshalAsStruct?)o) == null;
+    }
+
+    private static int Main()
+    {
+        MarshalAsStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null037.csproj
new file mode 100644 (file)
index 0000000..464c981
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null037.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.cs
new file mode 100644 (file)
index 0000000..19d8d7e
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ImplementOneInterface?)o) == null;
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterface? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null038.csproj
new file mode 100644 (file)
index 0000000..249e81d
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null038.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.cs
new file mode 100644 (file)
index 0000000..7d8857f
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementTwoInterface using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ImplementTwoInterface?)o) == null;
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterface? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null039.csproj
new file mode 100644 (file)
index 0000000..fc04dfb
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null039.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.cs
new file mode 100644 (file)
index 0000000..7ce67b5
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ImplementOneInterfaceGen<int>?)o) == null;
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterfaceGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null040.csproj
new file mode 100644 (file)
index 0000000..33537bf
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null040.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.cs
new file mode 100644 (file)
index 0000000..1b26d30
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementTwoInterfaceGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ImplementTwoInterfaceGen<int>?)o) == null;
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterfaceGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null041.csproj
new file mode 100644 (file)
index 0000000..6076f62
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null041.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.cs
new file mode 100644 (file)
index 0000000..cd9663c
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ImplementAllInterface<int>?)o) == null;
+    }
+
+    private static int Main()
+    {
+        ImplementAllInterface<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null042.csproj
new file mode 100644 (file)
index 0000000..58d3f1e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null042.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.cs
new file mode 100644 (file)
index 0000000..f87daba
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of WithMultipleGCHandleStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((WithMultipleGCHandleStruct?)o) == null;
+    }
+
+    private static int Main()
+    {
+        WithMultipleGCHandleStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null043.csproj
new file mode 100644 (file)
index 0000000..bb4905c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null043.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.cs
new file mode 100644 (file)
index 0000000..f7580d9
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((WithOnlyFXTypeStruct?)o) == null;
+    }
+
+    private static int Main()
+    {
+        WithOnlyFXTypeStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null044.csproj
new file mode 100644 (file)
index 0000000..9d42784
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null044.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.cs
new file mode 100644 (file)
index 0000000..a28dd4e
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of MixedAllStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return o == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((MixedAllStruct?)o) == null;
+    }
+
+    private static int Main()
+    {
+        MixedAllStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/null/box-unbox-null045.csproj
new file mode 100644 (file)
index 0000000..ab3f99b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-null045.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/structdef.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/structdef.cs
new file mode 100644 (file)
index 0000000..50eb1ce
--- /dev/null
@@ -0,0 +1,402 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+#pragma warning disable 0183 // The given expression is always of the provided ('X') type
+
+using System.Runtime.InteropServices;
+using System;
+//using Microsoft;
+using System.ComponentModel;
+// primitives / CLR Types
+
+// interfaces 
+public interface IEmpty { }
+public interface INotEmpty
+{
+    void DoNothing();
+}
+
+// generic interfaces 
+public interface IEmptyGen<T> { }
+public interface INotEmptyGen<T>
+{
+    void DoNothing();
+}
+
+// struct 
+public struct EmptyStruct { }
+public struct NotEmptyStruct
+{
+    public int Field;
+}
+
+public struct NotEmptyStructQ
+{
+    public int? Field;
+}
+
+public struct NotEmptyStructA
+{
+    public int[] Field;
+}
+
+public struct NotEmptyStructQA
+{
+    public int?[] Field;
+}
+
+// generic structs 
+public struct EmptyStructGen<T> { }
+public struct NotEmptyStructGen<T>
+{
+    public T Field;
+}
+
+public struct NotEmptyStructConstrainedGen<T> where T : struct
+{
+    public T Field;
+}
+
+public struct NotEmptyStructConstrainedGenA<T> where T : struct
+{
+    public T[] Field;
+}
+
+public struct NotEmptyStructConstrainedGenQ<T> where T : struct
+{
+    public T? Field;
+}
+
+public struct NotEmptyStructConstrainedGenQA<T> where T : struct
+{
+    public T?[] Field;
+}
+
+// nested struct 
+public struct NestedStruct
+{
+    public struct Nested { }
+}
+
+public struct NestedStructGen<T>
+{
+    public struct Nested { }
+}
+
+
+// struct with Field Offset
+[StructLayout(LayoutKind.Explicit)]
+public struct ExplicitFieldOffsetStruct
+{
+    [FieldOffset(0)]
+    public int Field00;
+    [FieldOffset(0x0f)]
+    public int Field15;
+}
+
+// struct with Attributes
+internal struct MarshalAsStruct
+{
+    [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
+    public string StringField;
+}
+
+// struct implement interfaces
+internal struct ImplementOneInterface : IEmpty { }
+
+internal struct ImplementTwoInterface : IEmpty, INotEmpty
+{
+    public void DoNothing() { }
+}
+
+internal struct ImplementOneInterfaceGen<T> : IEmptyGen<T> { }
+
+internal struct ImplementTwoInterfaceGen<T> : IEmptyGen<T>, INotEmptyGen<T>
+{
+    public void DoNothing() { }
+}
+
+internal struct ImplementAllInterface<T> : IEmpty, INotEmpty, IEmptyGen<T>, INotEmptyGen<T>
+{
+    public void DoNothing() { }
+    void INotEmptyGen<T>.DoNothing() { }
+}
+
+// enums
+public enum IntE { start = 1, }
+public enum ByteE : byte { start = 1, }
+public enum LongE : long { start = 1, }
+
+
+// other intersting structs
+public struct WithMultipleGCHandleStruct
+{
+    public GCHandle H1;
+    public GCHandle H2;
+    public GCHandle H3;
+    public GCHandle H4;
+    public GCHandle H5;
+}
+
+public struct WithOnlyFXTypeStruct
+{
+    public Guid GUID;
+    public decimal DECIMAL;
+}
+
+
+public struct MixedAllStruct
+{
+    public int INT;
+    public int? IntQ;
+    public int?[] IntQA;
+    public string STRING;
+    public IntE INTE;
+    public EmptyClass EMPTYCLASS;
+    public IEmpty IEMPTY;
+    public EmptyStruct EMPTYSTRUCT;
+    public IEmptyGen<int> IEMPTYGEN;
+    public EmptyStructGen<int> EMPTYSTRUCTGEN;
+    public WithOnlyFXTypeStruct WITHONLYFXTYPESTRUCT;
+    public GCHandle GCHANDLE;
+}
+
+
+// other types
+public struct EmptyClass { }
+public struct NotEmptyClass
+{
+    public int Field;
+}
+
+public struct EmptyClassGen<T> { }
+public struct NotEmptyClassGen<T>
+{
+    public T Field;
+}
+
+public struct NotEmptyClassConstrainedGen<T> where T : class
+{
+    public T Field;
+}
+public struct NestedClass
+{
+    public struct Nested { }
+}
+
+public struct NestedClassGen<T>
+{
+    public struct Nested { }
+}
+
+internal class ImplementOneInterfaceC : IEmpty { }
+
+internal class ImplementTwoInterfaceC : IEmpty, INotEmpty
+{
+    public void DoNothing() { }
+}
+
+internal class ImplementOneInterfaceGenC<T> : IEmptyGen<T> { }
+
+internal class ImplementTwoInterfaceGenC<T> : IEmptyGen<T>, INotEmptyGen<T>
+{
+    public void DoNothing() { }
+}
+
+internal class ImplementAllInterfaceC<T> : IEmpty, INotEmpty, IEmptyGen<T>, INotEmptyGen<T>
+{
+    public void DoNothing() { }
+    void INotEmptyGen<T>.DoNothing() { }
+}
+
+public sealed class SealedClass { }
+
+public delegate void SimpleDelegate();
+public delegate void GenericDelegate<T>();
+
+
+// ExitCode
+public static class ExitCode
+{
+    public static int Failed = 101;
+    public static int Passed = 100;
+}
+
+
+// Create Value Instance
+internal static class Helper
+{
+    public static GCHandle GCHANDLE;
+    static Helper()
+    {
+        GCHANDLE = GCHandle.Alloc(System.Console.Out);
+    }
+
+    public static char Create(char val) { return 'c'; }
+    public static bool Create(bool val) { return true; }
+    public static byte Create(byte val) { return 0x08; }
+    public static sbyte Create(sbyte val) { return -0x0e; }
+    public static short Create(short val) { return -0x0f; }
+    public static ushort Create(ushort val) { return 0xff; }
+    public static int Create(int val) { return 100; }
+    public static uint Create(uint val) { return 200; }
+    public static long Create(long val) { return int.MaxValue; }
+    public static ulong Create(ulong val) { return 300; }
+    public static float Create(float val) { return 1.15f; }
+    public static double Create(double val) { return 0.05; }
+    public static decimal Create(decimal val) { return 1.0M; }
+
+    public static IntPtr Create(IntPtr val) { return (IntPtr)1000; }
+    public static UIntPtr Create(UIntPtr val) { return (UIntPtr)2000; }
+    public static Guid Create(Guid val) { return new Guid("00020810-0001-0000-C000-000000000046"); }
+    public static GCHandle Create(GCHandle val) { return GCHANDLE; }
+    public static ByteE Create(ByteE val) { return (ByteE)9; }
+    public static IntE Create(IntE val) { return (IntE)55; }
+    public static LongE Create(LongE val) { return (LongE)34; }
+    public static EmptyStruct Create(EmptyStruct val) { return new EmptyStruct(); }
+    public static NotEmptyStruct Create(NotEmptyStruct val) { NotEmptyStruct ne = new NotEmptyStruct(); ne.Field = 100; return ne; }
+    public static NotEmptyStructQ Create(NotEmptyStructQ val) { NotEmptyStructQ neq = new NotEmptyStructQ(); neq.Field = 101; return neq; }
+    public static NotEmptyStructA Create(NotEmptyStructA val) { NotEmptyStructA nea = new NotEmptyStructA(); nea.Field = new int[] { 10 }; return nea; }
+    public static NotEmptyStructQA Create(NotEmptyStructQA val) { NotEmptyStructQA neq = new NotEmptyStructQA(); neq.Field = new int?[] { 10 }; return neq; }
+    public static EmptyStructGen<int> Create(EmptyStructGen<int> val) { return new EmptyStructGen<int>(); }
+    public static NotEmptyStructGen<int> Create(NotEmptyStructGen<int> val) { NotEmptyStructGen<int> ne = new NotEmptyStructGen<int>(); ne.Field = 88; return ne; }
+    public static NotEmptyStructConstrainedGen<int> Create(NotEmptyStructConstrainedGen<int> val) { NotEmptyStructConstrainedGen<int> ne = new NotEmptyStructConstrainedGen<int>(); ne.Field = 1010; return ne; }
+    public static NotEmptyStructConstrainedGenA<int> Create(NotEmptyStructConstrainedGenA<int> val) { NotEmptyStructConstrainedGenA<int> neq = new NotEmptyStructConstrainedGenA<int>(); neq.Field = new int[] { 11 }; return neq; }
+    public static NotEmptyStructConstrainedGenQ<int> Create(NotEmptyStructConstrainedGenQ<int> val) { NotEmptyStructConstrainedGenQ<int> neq = new NotEmptyStructConstrainedGenQ<int>(); neq.Field = 12; return neq; }
+    public static NotEmptyStructConstrainedGenQA<int> Create(NotEmptyStructConstrainedGenQA<int> val) { NotEmptyStructConstrainedGenQA<int> neq = new NotEmptyStructConstrainedGenQA<int>(); neq.Field = new int?[] { 17 }; return neq; }
+    public static NestedStruct Create(NestedStruct val) { NestedStruct ns = new NestedStruct(); return ns; }
+    public static NestedStructGen<int> Create(NestedStructGen<int> val) { NestedStructGen<int> nsg = new NestedStructGen<int>(); return nsg; }
+    public static ExplicitFieldOffsetStruct Create(ExplicitFieldOffsetStruct val) { ExplicitFieldOffsetStruct epl = new ExplicitFieldOffsetStruct(); epl.Field00 = 40; epl.Field15 = 15; return epl; }
+    public static MarshalAsStruct Create(MarshalAsStruct val) { MarshalAsStruct ma = new MarshalAsStruct(); ma.StringField = "Nullable"; return ma; }
+    public static ImplementOneInterface Create(ImplementOneInterface val) { ImplementOneInterface imp = new ImplementOneInterface(); return imp; }
+    public static ImplementTwoInterface Create(ImplementTwoInterface val) { ImplementTwoInterface imp = new ImplementTwoInterface(); return imp; }
+    public static ImplementOneInterfaceGen<int> Create(ImplementOneInterfaceGen<int> val) { ImplementOneInterfaceGen<int> imp = new ImplementOneInterfaceGen<int>(); return imp; }
+    public static ImplementTwoInterfaceGen<int> Create(ImplementTwoInterfaceGen<int> val) { ImplementTwoInterfaceGen<int> imp = new ImplementTwoInterfaceGen<int>(); return imp; }
+    public static ImplementAllInterface<int> Create(ImplementAllInterface<int> val) { ImplementAllInterface<int> imp = new ImplementAllInterface<int>(); return imp; }
+    public static WithMultipleGCHandleStruct Create(WithMultipleGCHandleStruct val)
+    { WithMultipleGCHandleStruct mgch = new WithMultipleGCHandleStruct(); mgch.H1 = GCHANDLE; mgch.H2 = GCHANDLE; mgch.H3 = GCHANDLE; mgch.H4 = GCHANDLE; mgch.H5 = GCHANDLE; return mgch; }
+    public static WithOnlyFXTypeStruct Create(WithOnlyFXTypeStruct val) { WithOnlyFXTypeStruct wofx = new WithOnlyFXTypeStruct(); wofx.DECIMAL = 50.0m; wofx.GUID = Create(default(Guid)); return wofx; }
+    public static MixedAllStruct Create(MixedAllStruct val)
+    {
+        MixedAllStruct mas;
+        mas.INT = 10;
+        mas.IntQ = null;
+        mas.IntQA = new int?[] { 10 };
+        mas.STRING = "Nullable";
+        mas.INTE = Create(default(IntE));
+        mas.EMPTYCLASS = new EmptyClass();
+        mas.IEMPTY = Create(default(ImplementOneInterface));
+        mas.EMPTYSTRUCT = Create(default(EmptyStruct));
+        mas.IEMPTYGEN = Create(default(ImplementOneInterfaceGen<int>));
+        mas.EMPTYSTRUCTGEN = Create(default(EmptyStructGen<int>));
+        mas.WITHONLYFXTYPESTRUCT = Create(default(WithOnlyFXTypeStruct));
+        mas.GCHANDLE = Create(default(GCHandle));
+
+        return mas;
+    }
+
+    public static bool Compare(char val, char val1) { return val == val1; }
+    public static bool Compare(bool val, bool val1) { return val == val1; }
+    public static bool Compare(byte val, byte val1) { return val == val1; }
+    public static bool Compare(sbyte val, sbyte val1) { return val == val1; }
+    public static bool Compare(short val, short val1) { return val == val1; }
+    public static bool Compare(ushort val, ushort val1) { return val == val1; }
+    public static bool Compare(int val, int val1) { return val == val1; }
+    public static bool Compare(uint val, uint val1) { return val == val1; }
+    public static bool Compare(long val, long val1) { return val == val1; }
+    public static bool Compare(ulong val, ulong val1) { return val == val1; }
+    public static bool Compare(float val, float val1) { return val == val1; }
+    public static bool Compare(double val, double val1) { return val == val1; }
+    public static bool Compare(decimal val, decimal val1) { return val == val1; }
+
+    public static bool Compare(IntPtr val, IntPtr val1) { return val == val1; }
+    public static bool Compare(UIntPtr val, UIntPtr val1) { return val == val1; }
+    public static bool Compare(Guid val, Guid val1) { return val == val1; }
+    public static bool Compare(GCHandle val, GCHandle val1) { return val == val1; }
+    public static bool Compare(ByteE val, ByteE val1) { return val == val1; }
+    public static bool Compare(IntE val, IntE val1) { return val == val1; }
+    public static bool Compare(LongE val, LongE val1) { return val == val1; }
+    public static bool Compare(EmptyStruct val, EmptyStruct val1) { return val.Equals(val1); }
+    public static bool Compare(NotEmptyStruct val, NotEmptyStruct val1) { return val.Field == val1.Field; }
+    public static bool Compare(NotEmptyStructQ val, NotEmptyStructQ val1) { return val.Field == val1.Field; }
+    public static bool Compare(NotEmptyStructA val, NotEmptyStructA val1) { return val.Field[0] == val1.Field[0]; }
+    public static bool Compare(NotEmptyStructQA val, NotEmptyStructQA val1) { return val.Field[0] == val1.Field[0]; }
+    public static bool Compare(EmptyStructGen<int> val, EmptyStructGen<int> val1) { return val.Equals(val1); }
+    public static bool Compare(NotEmptyStructGen<int> val, NotEmptyStructGen<int> val1) { return val.Field == val1.Field; }
+    public static bool Compare(NotEmptyStructConstrainedGen<int> val, NotEmptyStructConstrainedGen<int> val1) { return val.Field == val1.Field; }
+    public static bool Compare(NotEmptyStructConstrainedGenA<int> val, NotEmptyStructConstrainedGenA<int> val1) { return val.Field[0] == val1.Field[0]; }
+    public static bool Compare(NotEmptyStructConstrainedGenQ<int> val, NotEmptyStructConstrainedGenQ<int> val1) { return val.Field == val1.Field; }
+    public static bool Compare(NotEmptyStructConstrainedGenQA<int> val, NotEmptyStructConstrainedGenQA<int> val1) { return val.Field[0] == val1.Field[0]; }
+    public static bool Compare(NestedStruct val, NestedStruct val1) { return val.Equals(val1); }
+    public static bool Compare(NestedStructGen<int> val, NestedStructGen<int> val1) { return val.Equals(val1); }
+    public static bool Compare(ExplicitFieldOffsetStruct val, ExplicitFieldOffsetStruct val1) { return (val.Field00 == val1.Field00) && (val.Field15 == val1.Field15); }
+    public static bool Compare(MarshalAsStruct val, MarshalAsStruct val1) { return val.Equals(val1); }
+    public static bool Compare(ImplementOneInterface val, ImplementOneInterface val1) { return (val is IEmpty) && val.Equals(val1); }
+    public static bool Compare(ImplementTwoInterface val, ImplementTwoInterface val1) { return (val is IEmpty) && val is INotEmpty && val.Equals(val1); }
+    public static bool Compare(ImplementOneInterfaceGen<int> val, ImplementOneInterfaceGen<int> val1) { return val is IEmptyGen<int> && val.Equals(val1); }
+    public static bool Compare(ImplementTwoInterfaceGen<int> val, ImplementTwoInterfaceGen<int> val1) { return val is IEmptyGen<int> && val is INotEmptyGen<int> && val.Equals(val1); }
+    public static bool Compare(ImplementAllInterface<int> val, ImplementAllInterface<int> val1) { return val is IEmpty && val is INotEmpty && val is IEmptyGen<int> && val is INotEmptyGen<int> && val.Equals(val1); }
+    public static bool Compare(WithMultipleGCHandleStruct val, WithMultipleGCHandleStruct val1)
+    { return val.H1 == val1.H1 && val.H2 == val1.H2 && val.H3 == val1.H3 && val.H4 == val1.H4 && val.H5 == val1.H5; }
+    public static bool Compare(WithOnlyFXTypeStruct val, WithOnlyFXTypeStruct val1) { return val.GUID == val1.GUID && val.DECIMAL == val1.DECIMAL; }
+    public static bool Compare(MixedAllStruct val, MixedAllStruct val1)
+    {
+        return val.INT == val1.INT &&
+        val.IntQ == val1.IntQ &&
+        val.IntQA[0] == val1.IntQA[0] &&
+        val.STRING == val1.STRING &&
+        val.INTE == val1.INTE &&
+        val.EMPTYCLASS.Equals(val1.EMPTYCLASS) &&
+        val.IEMPTY.Equals(val1.IEMPTY) &&
+        Compare(val.EMPTYSTRUCT, val1.EMPTYSTRUCT) &&
+        val.IEMPTYGEN.Equals(val1.IEMPTYGEN) &&
+        Compare(val.EMPTYSTRUCTGEN, val1.EMPTYSTRUCTGEN) &&
+        Compare(val.WITHONLYFXTYPESTRUCT, val1.WITHONLYFXTYPESTRUCT) &&
+       Compare(val.GCHANDLE, val1.GCHANDLE);
+    }
+
+    public static bool Compare(char? val, char val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(bool? val, bool val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(byte? val, byte val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(sbyte? val, sbyte val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(short? val, short val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(ushort? val, ushort val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(int? val, int val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(uint? val, uint val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(long? val, long val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(ulong? val, ulong val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(float? val, float val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(double? val, double val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(decimal? val, decimal val1) { return val == null ? false : Compare(val.Value, val1); }
+
+    public static bool Compare(IntPtr? val, IntPtr val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(UIntPtr? val, UIntPtr val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(Guid? val, Guid val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(GCHandle? val, GCHandle val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(ByteE? val, ByteE val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(IntE? val, IntE val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(LongE? val, LongE val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(EmptyStruct? val, EmptyStruct val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStruct? val, NotEmptyStruct val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructQ? val, NotEmptyStructQ val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructA? val, NotEmptyStructA val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructQA? val, NotEmptyStructQA val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(EmptyStructGen<int>? val, EmptyStructGen<int> val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructGen<int>? val, NotEmptyStructGen<int> val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructConstrainedGen<int>? val, NotEmptyStructConstrainedGen<int> val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructConstrainedGenA<int>? val, NotEmptyStructConstrainedGenA<int> val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructConstrainedGenQ<int>? val, NotEmptyStructConstrainedGenQ<int> val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructConstrainedGenQA<int>? val, NotEmptyStructConstrainedGenQA<int> val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NestedStruct? val, NestedStruct val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(NestedStructGen<int>? val, NestedStructGen<int> val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(ExplicitFieldOffsetStruct? val, ExplicitFieldOffsetStruct val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(MarshalAsStruct? val, MarshalAsStruct val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(ImplementOneInterface? val, ImplementOneInterface val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(ImplementTwoInterface? val, ImplementTwoInterface val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(ImplementOneInterfaceGen<int>? val, ImplementOneInterfaceGen<int> val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(ImplementTwoInterfaceGen<int>? val, ImplementTwoInterfaceGen<int> val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(ImplementAllInterface<int>? val, ImplementAllInterface<int> val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(WithMultipleGCHandleStruct? val, WithMultipleGCHandleStruct val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(WithOnlyFXTypeStruct? val, WithOnlyFXTypeStruct val1) { return val == null ? false : Compare(val.Value, val1); }
+    public static bool Compare(MixedAllStruct? val, MixedAllStruct val1) { return val == null ? false : Compare(val.Value, val1); }
+}
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/app.config b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.cs
new file mode 100644 (file)
index 0000000..d439428
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of char using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((char)o, Helper.Create(default(char)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((char?)o, Helper.Create(default(char)));
+    }
+
+    private static int Main()
+    {
+        char? s = Helper.Create(default(char));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value001.csproj
new file mode 100644 (file)
index 0000000..d977170
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.cs
new file mode 100644 (file)
index 0000000..94c402e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((bool)o, Helper.Create(default(bool)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((bool?)o, Helper.Create(default(bool)));
+    }
+
+    private static int Main()
+    {
+        bool? s = Helper.Create(default(bool));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value002.csproj
new file mode 100644 (file)
index 0000000..8b4e7f3
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.cs
new file mode 100644 (file)
index 0000000..54bb9cc
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of byte using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((byte)o, Helper.Create(default(byte)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((byte?)o, Helper.Create(default(byte)));
+    }
+
+    private static int Main()
+    {
+        byte? s = Helper.Create(default(byte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value003.csproj
new file mode 100644 (file)
index 0000000..d4cd7da
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.cs
new file mode 100644 (file)
index 0000000..ba80a63
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((sbyte)o, Helper.Create(default(sbyte)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((sbyte?)o, Helper.Create(default(sbyte)));
+    }
+
+    private static int Main()
+    {
+        sbyte? s = Helper.Create(default(sbyte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value004.csproj
new file mode 100644 (file)
index 0000000..061dd18
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value004.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.cs
new file mode 100644 (file)
index 0000000..b571ca6
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of short using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((short)o, Helper.Create(default(short)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((short?)o, Helper.Create(default(short)));
+    }
+
+    private static int Main()
+    {
+        short? s = Helper.Create(default(short));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value005.csproj
new file mode 100644 (file)
index 0000000..6d67860
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value005.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.cs
new file mode 100644 (file)
index 0000000..153f311
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((ushort)o, Helper.Create(default(ushort)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((ushort?)o, Helper.Create(default(ushort)));
+    }
+
+    private static int Main()
+    {
+        ushort? s = Helper.Create(default(ushort));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value006.csproj
new file mode 100644 (file)
index 0000000..a775ea3
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value006.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.cs
new file mode 100644 (file)
index 0000000..d57b7b3
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of int using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((int)o, Helper.Create(default(int)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((int?)o, Helper.Create(default(int)));
+    }
+
+    private static int Main()
+    {
+        int? s = Helper.Create(default(int));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value007.csproj
new file mode 100644 (file)
index 0000000..99e41e9
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value007.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.cs
new file mode 100644 (file)
index 0000000..14aab70
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((uint)o, Helper.Create(default(uint)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((uint?)o, Helper.Create(default(uint)));
+    }
+
+    private static int Main()
+    {
+        uint? s = Helper.Create(default(uint));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value008.csproj
new file mode 100644 (file)
index 0000000..6cbb6c4
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value008.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.cs
new file mode 100644 (file)
index 0000000..e96ebff
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of long using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((long)o, Helper.Create(default(long)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((long?)o, Helper.Create(default(long)));
+    }
+
+    private static int Main()
+    {
+        long? s = Helper.Create(default(long));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value009.csproj
new file mode 100644 (file)
index 0000000..15bebb3
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value009.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.cs
new file mode 100644 (file)
index 0000000..11d1a86
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((ulong)o, Helper.Create(default(ulong)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((ulong?)o, Helper.Create(default(ulong)));
+    }
+
+    private static int Main()
+    {
+        ulong? s = Helper.Create(default(ulong));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value010.csproj
new file mode 100644 (file)
index 0000000..c1b9759
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value010.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.cs
new file mode 100644 (file)
index 0000000..4bf7b50
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of float using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((float)o, Helper.Create(default(float)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((float?)o, Helper.Create(default(float)));
+    }
+
+    private static int Main()
+    {
+        float? s = Helper.Create(default(float));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value011.csproj
new file mode 100644 (file)
index 0000000..78414c7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value011.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.cs
new file mode 100644 (file)
index 0000000..801d0c3
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((double)o, Helper.Create(default(double)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((double?)o, Helper.Create(default(double)));
+    }
+
+    private static int Main()
+    {
+        double? s = Helper.Create(default(double));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value012.csproj
new file mode 100644 (file)
index 0000000..b4ed69a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value012.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.cs
new file mode 100644 (file)
index 0000000..215bcf5
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of decimal using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((decimal)o, Helper.Create(default(decimal)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((decimal?)o, Helper.Create(default(decimal)));
+    }
+
+    private static int Main()
+    {
+        decimal? s = Helper.Create(default(decimal));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value013.csproj
new file mode 100644 (file)
index 0000000..0d84d08
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value013.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.cs
new file mode 100644 (file)
index 0000000..98d3936
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((IntPtr)o, Helper.Create(default(IntPtr)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((IntPtr?)o, Helper.Create(default(IntPtr)));
+    }
+
+    private static int Main()
+    {
+        IntPtr? s = Helper.Create(default(IntPtr));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value014.csproj
new file mode 100644 (file)
index 0000000..6724b72
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value014.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.cs
new file mode 100644 (file)
index 0000000..c440f08
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of UIntPtr using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((UIntPtr)o, Helper.Create(default(UIntPtr)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((UIntPtr?)o, Helper.Create(default(UIntPtr)));
+    }
+
+    private static int Main()
+    {
+        UIntPtr? s = Helper.Create(default(UIntPtr));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value015.csproj
new file mode 100644 (file)
index 0000000..5c6427e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value015.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.cs
new file mode 100644 (file)
index 0000000..73d8804
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((Guid)o, Helper.Create(default(Guid)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((Guid?)o, Helper.Create(default(Guid)));
+    }
+
+    private static int Main()
+    {
+        Guid? s = Helper.Create(default(Guid));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value016.csproj
new file mode 100644 (file)
index 0000000..ae93a50
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value016.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.cs
new file mode 100644 (file)
index 0000000..a4c9898
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of GCHandle using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((GCHandle)o, Helper.Create(default(GCHandle)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((GCHandle?)o, Helper.Create(default(GCHandle)));
+    }
+
+    private static int Main()
+    {
+        GCHandle? s = Helper.Create(default(GCHandle));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value017.csproj
new file mode 100644 (file)
index 0000000..e1b34d0
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value017.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.cs
new file mode 100644 (file)
index 0000000..37eb5a0
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((ByteE)o, Helper.Create(default(ByteE)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((ByteE?)o, Helper.Create(default(ByteE)));
+    }
+
+    private static int Main()
+    {
+        ByteE? s = Helper.Create(default(ByteE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value018.csproj
new file mode 100644 (file)
index 0000000..e1d7e6e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value018.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.cs
new file mode 100644 (file)
index 0000000..a4dcc45
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of IntE using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((IntE)o, Helper.Create(default(IntE)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((IntE?)o, Helper.Create(default(IntE)));
+    }
+
+    private static int Main()
+    {
+        IntE? s = Helper.Create(default(IntE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value019.csproj
new file mode 100644 (file)
index 0000000..50e698c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value019.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.cs
new file mode 100644 (file)
index 0000000..c6f95c7
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((LongE)o, Helper.Create(default(LongE)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((LongE?)o, Helper.Create(default(LongE)));
+    }
+
+    private static int Main()
+    {
+        LongE? s = Helper.Create(default(LongE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value020.csproj
new file mode 100644 (file)
index 0000000..70efada
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value020.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.cs
new file mode 100644 (file)
index 0000000..750bc0f
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of EmptyStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((EmptyStruct)o, Helper.Create(default(EmptyStruct)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((EmptyStruct?)o, Helper.Create(default(EmptyStruct)));
+    }
+
+    private static int Main()
+    {
+        EmptyStruct? s = Helper.Create(default(EmptyStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value021.csproj
new file mode 100644 (file)
index 0000000..eefd3c5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value021.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.cs
new file mode 100644 (file)
index 0000000..ef940a3
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStruct)o, Helper.Create(default(NotEmptyStruct)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStruct?)o, Helper.Create(default(NotEmptyStruct)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value022.csproj
new file mode 100644 (file)
index 0000000..d8b17cc
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value022.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.cs
new file mode 100644 (file)
index 0000000..6ae51b4
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructQ using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructQ)o, Helper.Create(default(NotEmptyStructQ)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructQ?)o, Helper.Create(default(NotEmptyStructQ)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value023.csproj
new file mode 100644 (file)
index 0000000..392ad1e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value023.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.cs
new file mode 100644 (file)
index 0000000..6023a2a
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructA)o, Helper.Create(default(NotEmptyStructA)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructA?)o, Helper.Create(default(NotEmptyStructA)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value024.csproj
new file mode 100644 (file)
index 0000000..b9c49cf
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value024.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.cs
new file mode 100644 (file)
index 0000000..f2de588
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructQA using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructQA)o, Helper.Create(default(NotEmptyStructQA)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructQA?)o, Helper.Create(default(NotEmptyStructQA)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value025.csproj
new file mode 100644 (file)
index 0000000..6946188
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value025.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.cs
new file mode 100644 (file)
index 0000000..b10570e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((EmptyStructGen<int>)o, Helper.Create(default(EmptyStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((EmptyStructGen<int>?)o, Helper.Create(default(EmptyStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        EmptyStructGen<int>? s = Helper.Create(default(EmptyStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value026.csproj
new file mode 100644 (file)
index 0000000..11fd07c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value026.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.cs
new file mode 100644 (file)
index 0000000..7536471
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructGen<int>)o, Helper.Create(default(NotEmptyStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructGen<int>?)o, Helper.Create(default(NotEmptyStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructGen<int>? s = Helper.Create(default(NotEmptyStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value027.csproj
new file mode 100644 (file)
index 0000000..a94ac3b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value027.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.cs
new file mode 100644 (file)
index 0000000..cb290c7
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGen<int>)o, Helper.Create(default(NotEmptyStructConstrainedGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGen<int>?)o, Helper.Create(default(NotEmptyStructConstrainedGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGen<int>? s = Helper.Create(default(NotEmptyStructConstrainedGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value028.csproj
new file mode 100644 (file)
index 0000000..2d6afa3
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value028.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.cs
new file mode 100644 (file)
index 0000000..bcfcc00
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGenA<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenA<int>)o, Helper.Create(default(NotEmptyStructConstrainedGenA<int>)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenA<int>?)o, Helper.Create(default(NotEmptyStructConstrainedGenA<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenA<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenA<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value029.csproj
new file mode 100644 (file)
index 0000000..15f30df
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value029.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.cs
new file mode 100644 (file)
index 0000000..dd864ad
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQ<int>)o, Helper.Create(default(NotEmptyStructConstrainedGenQ<int>)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQ<int>?)o, Helper.Create(default(NotEmptyStructConstrainedGenQ<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQ<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenQ<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value030.csproj
new file mode 100644 (file)
index 0000000..448c751
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value030.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.cs
new file mode 100644 (file)
index 0000000..222745c
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGenQA<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQA<int>)o, Helper.Create(default(NotEmptyStructConstrainedGenQA<int>)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQA<int>?)o, Helper.Create(default(NotEmptyStructConstrainedGenQA<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQA<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenQA<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value031.csproj
new file mode 100644 (file)
index 0000000..ccbae7d
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value031.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.cs
new file mode 100644 (file)
index 0000000..a17ae71
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NestedStruct)o, Helper.Create(default(NestedStruct)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NestedStruct?)o, Helper.Create(default(NestedStruct)));
+    }
+
+    private static int Main()
+    {
+        NestedStruct? s = Helper.Create(default(NestedStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value032.csproj
new file mode 100644 (file)
index 0000000..1cb35d3
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value032.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.cs
new file mode 100644 (file)
index 0000000..e49168f
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of NestedStructGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((NestedStructGen<int>)o, Helper.Create(default(NestedStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((NestedStructGen<int>?)o, Helper.Create(default(NestedStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NestedStructGen<int>? s = Helper.Create(default(NestedStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value033.csproj
new file mode 100644 (file)
index 0000000..14ec5d7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value033.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.cs
new file mode 100644 (file)
index 0000000..3f67990
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((ExplicitFieldOffsetStruct)o, Helper.Create(default(ExplicitFieldOffsetStruct)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((ExplicitFieldOffsetStruct?)o, Helper.Create(default(ExplicitFieldOffsetStruct)));
+    }
+
+    private static int Main()
+    {
+        ExplicitFieldOffsetStruct? s = Helper.Create(default(ExplicitFieldOffsetStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value034.csproj
new file mode 100644 (file)
index 0000000..cba13d1
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value034.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.cs
new file mode 100644 (file)
index 0000000..59254c6
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of MarshalAsStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((MarshalAsStruct)o, Helper.Create(default(MarshalAsStruct)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((MarshalAsStruct?)o, Helper.Create(default(MarshalAsStruct)));
+    }
+
+    private static int Main()
+    {
+        MarshalAsStruct? s = Helper.Create(default(MarshalAsStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value037.csproj
new file mode 100644 (file)
index 0000000..0f53d77
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value037.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.cs
new file mode 100644 (file)
index 0000000..6f157d8
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((ImplementOneInterface)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((ImplementOneInterface?)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value038.csproj
new file mode 100644 (file)
index 0000000..c430d1e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value038.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.cs
new file mode 100644 (file)
index 0000000..cec5c0f
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementTwoInterface using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((ImplementTwoInterface)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((ImplementTwoInterface?)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value039.csproj
new file mode 100644 (file)
index 0000000..da46f74
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value039.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.cs
new file mode 100644 (file)
index 0000000..c027001
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>?)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterfaceGen<int>? s = Helper.Create(default(ImplementOneInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value040.csproj
new file mode 100644 (file)
index 0000000..ca62a0b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value040.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.cs
new file mode 100644 (file)
index 0000000..ffc3ad3
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of ImplementTwoInterfaceGen<int> using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>?)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterfaceGen<int>? s = Helper.Create(default(ImplementTwoInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value041.csproj
new file mode 100644 (file)
index 0000000..c3fa4e1
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value041.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.cs
new file mode 100644 (file)
index 0000000..387bcdd
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>?)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementAllInterface<int>? s = Helper.Create(default(ImplementAllInterface<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value042.csproj
new file mode 100644 (file)
index 0000000..33ac731
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value042.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.cs
new file mode 100644 (file)
index 0000000..1808491
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of WithMultipleGCHandleStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((WithMultipleGCHandleStruct)o, Helper.Create(default(WithMultipleGCHandleStruct)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((WithMultipleGCHandleStruct?)o, Helper.Create(default(WithMultipleGCHandleStruct)));
+    }
+
+    private static int Main()
+    {
+        WithMultipleGCHandleStruct? s = Helper.Create(default(WithMultipleGCHandleStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value043.csproj
new file mode 100644 (file)
index 0000000..91c79d5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value043.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.cs
new file mode 100644 (file)
index 0000000..a79f299
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((WithOnlyFXTypeStruct)o, Helper.Create(default(WithOnlyFXTypeStruct)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((WithOnlyFXTypeStruct?)o, Helper.Create(default(WithOnlyFXTypeStruct)));
+    }
+
+    private static int Main()
+    {
+        WithOnlyFXTypeStruct? s = Helper.Create(default(WithOnlyFXTypeStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value044.csproj
new file mode 100644 (file)
index 0000000..8761d9c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value044.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.cs b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.cs
new file mode 100644 (file)
index 0000000..351036d
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - Box-Unbox </Area>
+// <Title> Nullable type with unbox box expr  </Title>
+// <Description>  
+// checking type of MixedAllStruct using is operator
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(ValueType o)
+    {
+        return Helper.Compare((MixedAllStruct)o, Helper.Create(default(MixedAllStruct)));
+    }
+
+    private static bool BoxUnboxToQ(ValueType o)
+    {
+        return Helper.Compare((MixedAllStruct?)o, Helper.Create(default(MixedAllStruct)));
+    }
+
+    private static int Main()
+    {
+        MixedAllStruct? s = Helper.Create(default(MixedAllStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/box-unbox/value/box-unbox-value045.csproj
new file mode 100644 (file)
index 0000000..8549fd4
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="box-unbox-value045.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/app.config b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.cs
new file mode 100644 (file)
index 0000000..7c19469
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((char)(ValueType)o, Helper.Create(default(char)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((char?)(ValueType)o, Helper.Create(default(char)));
+    }
+
+    private static int Main()
+    {
+        char? s = Helper.Create(default(char));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass001.csproj
new file mode 100644 (file)
index 0000000..e16f318
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.cs
new file mode 100644 (file)
index 0000000..5376c8d
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of bool using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((bool)(ValueType)o, Helper.Create(default(bool)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((bool?)(ValueType)o, Helper.Create(default(bool)));
+    }
+
+    private static int Main()
+    {
+        bool? s = Helper.Create(default(bool));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass002.csproj
new file mode 100644 (file)
index 0000000..7c6b66c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.cs
new file mode 100644 (file)
index 0000000..8c4e7a7
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((byte)(ValueType)o, Helper.Create(default(byte)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((byte?)(ValueType)o, Helper.Create(default(byte)));
+    }
+
+    private static int Main()
+    {
+        byte? s = Helper.Create(default(byte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.csproj
new file mode 100644 (file)
index 0000000..6f7ee3a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.cs
new file mode 100644 (file)
index 0000000..ba604a9
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of sbyte using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((sbyte)(ValueType)o, Helper.Create(default(sbyte)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((sbyte?)(ValueType)o, Helper.Create(default(sbyte)));
+    }
+
+    private static int Main()
+    {
+        sbyte? s = Helper.Create(default(sbyte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass004.csproj
new file mode 100644 (file)
index 0000000..aa8dde2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass004.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.cs
new file mode 100644 (file)
index 0000000..6fa7126
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((short)(ValueType)o, Helper.Create(default(short)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((short?)(ValueType)o, Helper.Create(default(short)));
+    }
+
+    private static int Main()
+    {
+        short? s = Helper.Create(default(short));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass005.csproj
new file mode 100644 (file)
index 0000000..1de1ced
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass005.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.cs
new file mode 100644 (file)
index 0000000..3927d3b
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ushort using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ushort)(ValueType)o, Helper.Create(default(ushort)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ushort?)(ValueType)o, Helper.Create(default(ushort)));
+    }
+
+    private static int Main()
+    {
+        ushort? s = Helper.Create(default(ushort));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass006.csproj
new file mode 100644 (file)
index 0000000..2131dad
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass006.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.cs
new file mode 100644 (file)
index 0000000..e5b729b
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((int)(ValueType)o, Helper.Create(default(int)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((int?)(ValueType)o, Helper.Create(default(int)));
+    }
+
+    private static int Main()
+    {
+        int? s = Helper.Create(default(int));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass007.csproj
new file mode 100644 (file)
index 0000000..07a1031
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass007.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.cs
new file mode 100644 (file)
index 0000000..72fa78e
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of uint using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((uint)(ValueType)o, Helper.Create(default(uint)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((uint?)(ValueType)o, Helper.Create(default(uint)));
+    }
+
+    private static int Main()
+    {
+        uint? s = Helper.Create(default(uint));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass008.csproj
new file mode 100644 (file)
index 0000000..037ad72
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass008.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.cs
new file mode 100644 (file)
index 0000000..1d6c11b
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((long)(ValueType)o, Helper.Create(default(long)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((long?)(ValueType)o, Helper.Create(default(long)));
+    }
+
+    private static int Main()
+    {
+        long? s = Helper.Create(default(long));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass009.csproj
new file mode 100644 (file)
index 0000000..5cffcc9
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass009.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.cs
new file mode 100644 (file)
index 0000000..be3b723
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ulong using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ulong)(ValueType)o, Helper.Create(default(ulong)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ulong?)(ValueType)o, Helper.Create(default(ulong)));
+    }
+
+    private static int Main()
+    {
+        ulong? s = Helper.Create(default(ulong));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass010.csproj
new file mode 100644 (file)
index 0000000..39c6dd9
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass010.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.cs
new file mode 100644 (file)
index 0000000..be161bf
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((float)(ValueType)o, Helper.Create(default(float)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((float?)(ValueType)o, Helper.Create(default(float)));
+    }
+
+    private static int Main()
+    {
+        float? s = Helper.Create(default(float));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass011.csproj
new file mode 100644 (file)
index 0000000..a909471
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass011.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.cs
new file mode 100644 (file)
index 0000000..1065065
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of double using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((double)(ValueType)o, Helper.Create(default(double)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((double?)(ValueType)o, Helper.Create(default(double)));
+    }
+
+    private static int Main()
+    {
+        double? s = Helper.Create(default(double));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass012.csproj
new file mode 100644 (file)
index 0000000..929e106
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass012.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.cs
new file mode 100644 (file)
index 0000000..596cf5d
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((decimal)(ValueType)o, Helper.Create(default(decimal)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((decimal?)(ValueType)o, Helper.Create(default(decimal)));
+    }
+
+    private static int Main()
+    {
+        decimal? s = Helper.Create(default(decimal));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass013.csproj
new file mode 100644 (file)
index 0000000..d86be46
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass013.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.cs
new file mode 100644 (file)
index 0000000..983d7eb
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of IntPtr using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((IntPtr)(ValueType)o, Helper.Create(default(IntPtr)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((IntPtr?)(ValueType)o, Helper.Create(default(IntPtr)));
+    }
+
+    private static int Main()
+    {
+        IntPtr? s = Helper.Create(default(IntPtr));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass014.csproj
new file mode 100644 (file)
index 0000000..205653c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass014.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.cs
new file mode 100644 (file)
index 0000000..7fd4f12
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((UIntPtr)(ValueType)o, Helper.Create(default(UIntPtr)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((UIntPtr?)(ValueType)o, Helper.Create(default(UIntPtr)));
+    }
+
+    private static int Main()
+    {
+        UIntPtr? s = Helper.Create(default(UIntPtr));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass015.csproj
new file mode 100644 (file)
index 0000000..90ec914
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass015.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.cs
new file mode 100644 (file)
index 0000000..a169b77
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of Guid using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((Guid)(ValueType)o, Helper.Create(default(Guid)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((Guid?)(ValueType)o, Helper.Create(default(Guid)));
+    }
+
+    private static int Main()
+    {
+        Guid? s = Helper.Create(default(Guid));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass016.csproj
new file mode 100644 (file)
index 0000000..09a4d8e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass016.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.cs
new file mode 100644 (file)
index 0000000..bb46da0
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((GCHandle)(ValueType)o, Helper.Create(default(GCHandle)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((GCHandle?)(ValueType)o, Helper.Create(default(GCHandle)));
+    }
+
+    private static int Main()
+    {
+        GCHandle? s = Helper.Create(default(GCHandle));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass017.csproj
new file mode 100644 (file)
index 0000000..55915ee
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass017.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.cs
new file mode 100644 (file)
index 0000000..da31f2d
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ByteE using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ByteE)(ValueType)o, Helper.Create(default(ByteE)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ByteE?)(ValueType)o, Helper.Create(default(ByteE)));
+    }
+
+    private static int Main()
+    {
+        ByteE? s = Helper.Create(default(ByteE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass018.csproj
new file mode 100644 (file)
index 0000000..27f3990
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass018.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.cs
new file mode 100644 (file)
index 0000000..65adb59
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((IntE)(ValueType)o, Helper.Create(default(IntE)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((IntE?)(ValueType)o, Helper.Create(default(IntE)));
+    }
+
+    private static int Main()
+    {
+        IntE? s = Helper.Create(default(IntE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass019.csproj
new file mode 100644 (file)
index 0000000..2a5c7a8
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass019.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.cs
new file mode 100644 (file)
index 0000000..463601f
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of LongE using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((LongE)(ValueType)o, Helper.Create(default(LongE)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((LongE?)(ValueType)o, Helper.Create(default(LongE)));
+    }
+
+    private static int Main()
+    {
+        LongE? s = Helper.Create(default(LongE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass020.csproj
new file mode 100644 (file)
index 0000000..8597c06
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass020.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.cs
new file mode 100644 (file)
index 0000000..1be6c8f
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((EmptyStruct)(ValueType)o, Helper.Create(default(EmptyStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((EmptyStruct?)(ValueType)o, Helper.Create(default(EmptyStruct)));
+    }
+
+    private static int Main()
+    {
+        EmptyStruct? s = Helper.Create(default(EmptyStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass021.csproj
new file mode 100644 (file)
index 0000000..27617cb
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass021.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.cs
new file mode 100644 (file)
index 0000000..d80afe7
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStruct)(ValueType)o, Helper.Create(default(NotEmptyStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStruct?)(ValueType)o, Helper.Create(default(NotEmptyStruct)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass022.csproj
new file mode 100644 (file)
index 0000000..d697f7f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass022.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.cs
new file mode 100644 (file)
index 0000000..56e2431
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructQ)(ValueType)o, Helper.Create(default(NotEmptyStructQ)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructQ?)(ValueType)o, Helper.Create(default(NotEmptyStructQ)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass023.csproj
new file mode 100644 (file)
index 0000000..8fb8147
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass023.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.cs
new file mode 100644 (file)
index 0000000..165e485
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructA using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructA)(ValueType)o, Helper.Create(default(NotEmptyStructA)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructA?)(ValueType)o, Helper.Create(default(NotEmptyStructA)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass024.csproj
new file mode 100644 (file)
index 0000000..9457d08
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass024.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.cs
new file mode 100644 (file)
index 0000000..4632d2e
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructQA)(ValueType)o, Helper.Create(default(NotEmptyStructQA)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructQA?)(ValueType)o, Helper.Create(default(NotEmptyStructQA)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass025.csproj
new file mode 100644 (file)
index 0000000..11b47b5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass025.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.cs
new file mode 100644 (file)
index 0000000..bd41b65
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of EmptyStructGen<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((EmptyStructGen<int>)(ValueType)o, Helper.Create(default(EmptyStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((EmptyStructGen<int>?)(ValueType)o, Helper.Create(default(EmptyStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        EmptyStructGen<int>? s = Helper.Create(default(EmptyStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass026.csproj
new file mode 100644 (file)
index 0000000..7a7c549
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass026.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.cs
new file mode 100644 (file)
index 0000000..1606a2d
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructGen<int>)(ValueType)o, Helper.Create(default(NotEmptyStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructGen<int>?)(ValueType)o, Helper.Create(default(NotEmptyStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructGen<int>? s = Helper.Create(default(NotEmptyStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass027.csproj
new file mode 100644 (file)
index 0000000..e41e0db
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass027.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.cs
new file mode 100644 (file)
index 0000000..d4685b2
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGen<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGen<int>)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGen<int>?)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGen<int>? s = Helper.Create(default(NotEmptyStructConstrainedGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass028.csproj
new file mode 100644 (file)
index 0000000..0763c91
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass028.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.cs
new file mode 100644 (file)
index 0000000..fd2f6b1
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenA<int>)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenA<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenA<int>?)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenA<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenA<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenA<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass029.csproj
new file mode 100644 (file)
index 0000000..667b7a6
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass029.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.cs
new file mode 100644 (file)
index 0000000..0af11e3
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGenQ<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQ<int>)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenQ<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQ<int>?)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenQ<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQ<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenQ<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass030.csproj
new file mode 100644 (file)
index 0000000..e1aa48c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass030.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.cs
new file mode 100644 (file)
index 0000000..2f40dc0
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQA<int>)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenQA<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQA<int>?)(ValueType)o, Helper.Create(default(NotEmptyStructConstrainedGenQA<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQA<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenQA<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass031.csproj
new file mode 100644 (file)
index 0000000..1cb7967
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass031.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.cs
new file mode 100644 (file)
index 0000000..a2c6bbc
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NestedStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NestedStruct)(ValueType)o, Helper.Create(default(NestedStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NestedStruct?)(ValueType)o, Helper.Create(default(NestedStruct)));
+    }
+
+    private static int Main()
+    {
+        NestedStruct? s = Helper.Create(default(NestedStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass032.csproj
new file mode 100644 (file)
index 0000000..849c3d7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass032.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.cs
new file mode 100644 (file)
index 0000000..0e0fa44
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((NestedStructGen<int>)(ValueType)o, Helper.Create(default(NestedStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((NestedStructGen<int>?)(ValueType)o, Helper.Create(default(NestedStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NestedStructGen<int>? s = Helper.Create(default(NestedStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass033.csproj
new file mode 100644 (file)
index 0000000..3e0505f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass033.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.cs
new file mode 100644 (file)
index 0000000..9ef4bad
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ExplicitFieldOffsetStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ExplicitFieldOffsetStruct)(ValueType)o, Helper.Create(default(ExplicitFieldOffsetStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ExplicitFieldOffsetStruct?)(ValueType)o, Helper.Create(default(ExplicitFieldOffsetStruct)));
+    }
+
+    private static int Main()
+    {
+        ExplicitFieldOffsetStruct? s = Helper.Create(default(ExplicitFieldOffsetStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass034.csproj
new file mode 100644 (file)
index 0000000..ab52623
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass034.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.cs
new file mode 100644 (file)
index 0000000..1b141aa
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((MarshalAsStruct)(ValueType)o, Helper.Create(default(MarshalAsStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((MarshalAsStruct?)(ValueType)o, Helper.Create(default(MarshalAsStruct)));
+    }
+
+    private static int Main()
+    {
+        MarshalAsStruct? s = Helper.Create(default(MarshalAsStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass037.csproj
new file mode 100644 (file)
index 0000000..bac25e8
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass037.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.cs
new file mode 100644 (file)
index 0000000..03800c4
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterface using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterface)(ValueType)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterface?)(ValueType)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass038.csproj
new file mode 100644 (file)
index 0000000..1af24d1
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass038.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.cs
new file mode 100644 (file)
index 0000000..63bcf95
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterface)(ValueType)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterface?)(ValueType)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass039.csproj
new file mode 100644 (file)
index 0000000..7fe1ade
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass039.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.cs
new file mode 100644 (file)
index 0000000..479b77c
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterfaceGen<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>)(ValueType)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>?)(ValueType)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterfaceGen<int>? s = Helper.Create(default(ImplementOneInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass040.csproj
new file mode 100644 (file)
index 0000000..e98fd4b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass040.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.cs
new file mode 100644 (file)
index 0000000..32ac5ba
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>)(ValueType)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>?)(ValueType)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterfaceGen<int>? s = Helper.Create(default(ImplementTwoInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass041.csproj
new file mode 100644 (file)
index 0000000..bc6d453
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass041.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.cs
new file mode 100644 (file)
index 0000000..b896d0f
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementAllInterface<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>)(ValueType)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>?)(ValueType)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementAllInterface<int>? s = Helper.Create(default(ImplementAllInterface<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass042.csproj
new file mode 100644 (file)
index 0000000..522e358
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass042.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.cs
new file mode 100644 (file)
index 0000000..d1d4e12
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((WithMultipleGCHandleStruct)(ValueType)o, Helper.Create(default(WithMultipleGCHandleStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((WithMultipleGCHandleStruct?)(ValueType)o, Helper.Create(default(WithMultipleGCHandleStruct)));
+    }
+
+    private static int Main()
+    {
+        WithMultipleGCHandleStruct? s = Helper.Create(default(WithMultipleGCHandleStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass043.csproj
new file mode 100644 (file)
index 0000000..5c5f9f8
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass043.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.cs
new file mode 100644 (file)
index 0000000..5bb6529
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of WithOnlyFXTypeStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((WithOnlyFXTypeStruct)(ValueType)o, Helper.Create(default(WithOnlyFXTypeStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((WithOnlyFXTypeStruct?)(ValueType)o, Helper.Create(default(WithOnlyFXTypeStruct)));
+    }
+
+    private static int Main()
+    {
+        WithOnlyFXTypeStruct? s = Helper.Create(default(WithOnlyFXTypeStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass044.csproj
new file mode 100644 (file)
index 0000000..ed7af75
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass044.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.cs
new file mode 100644 (file)
index 0000000..a77e81d
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((MixedAllStruct)(ValueType)o, Helper.Create(default(MixedAllStruct)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((MixedAllStruct?)(ValueType)o, Helper.Create(default(MixedAllStruct)));
+    }
+
+    private static int Main()
+    {
+        MixedAllStruct? s = Helper.Create(default(MixedAllStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass045.csproj
new file mode 100644 (file)
index 0000000..3530d11
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass045.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/app.config b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.cs
new file mode 100644 (file)
index 0000000..443faaf
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of IntE using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((IntE)(Enum)o, Helper.Create(default(IntE)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((IntE?)(Enum)o, Helper.Create(default(IntE)));
+    }
+
+    private static int Main()
+    {
+        IntE? s = Helper.Create(default(IntE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum001.csproj
new file mode 100644 (file)
index 0000000..727b8e5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-enum001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.cs
new file mode 100644 (file)
index 0000000..2b174c5
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ByteE)(Enum)o, Helper.Create(default(ByteE)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ByteE?)(Enum)o, Helper.Create(default(ByteE)));
+    }
+
+    private static int Main()
+    {
+        ByteE? s = Helper.Create(default(ByteE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum002.csproj
new file mode 100644 (file)
index 0000000..2d340f4
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-enum002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.cs
new file mode 100644 (file)
index 0000000..5f67e97
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of LongE using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((LongE)(Enum)o, Helper.Create(default(LongE)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((LongE?)(Enum)o, Helper.Create(default(LongE)));
+    }
+
+    private static int Main()
+    {
+        LongE? s = Helper.Create(default(LongE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/enum/castclass-enum003.csproj
new file mode 100644 (file)
index 0000000..1af0be4
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-enum003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/app.config b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.cs
new file mode 100644 (file)
index 0000000..7c2445c
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((char)(ValueType)(object)o, Helper.Create(default(char)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((char?)(ValueType)(object)o, Helper.Create(default(char)));
+    }
+
+    private static int Main()
+    {
+        char? s = Helper.Create(default(char));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics001.csproj
new file mode 100644 (file)
index 0000000..7b55bc0
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.cs
new file mode 100644 (file)
index 0000000..2385791
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of bool using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((bool)(ValueType)(object)o, Helper.Create(default(bool)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((bool?)(ValueType)(object)o, Helper.Create(default(bool)));
+    }
+
+    private static int Main()
+    {
+        bool? s = Helper.Create(default(bool));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics002.csproj
new file mode 100644 (file)
index 0000000..97a6ffa
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.cs
new file mode 100644 (file)
index 0000000..778c36c
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((byte)(ValueType)(object)o, Helper.Create(default(byte)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((byte?)(ValueType)(object)o, Helper.Create(default(byte)));
+    }
+
+    private static int Main()
+    {
+        byte? s = Helper.Create(default(byte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics003.csproj
new file mode 100644 (file)
index 0000000..e817abe
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.cs
new file mode 100644 (file)
index 0000000..d2cd3c4
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of sbyte using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((sbyte)(ValueType)(object)o, Helper.Create(default(sbyte)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((sbyte?)(ValueType)(object)o, Helper.Create(default(sbyte)));
+    }
+
+    private static int Main()
+    {
+        sbyte? s = Helper.Create(default(sbyte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics004.csproj
new file mode 100644 (file)
index 0000000..7d08eec
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics004.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.cs
new file mode 100644 (file)
index 0000000..8dfbc8d
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((short)(ValueType)(object)o, Helper.Create(default(short)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((short?)(ValueType)(object)o, Helper.Create(default(short)));
+    }
+
+    private static int Main()
+    {
+        short? s = Helper.Create(default(short));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics005.csproj
new file mode 100644 (file)
index 0000000..b0437b2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics005.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.cs
new file mode 100644 (file)
index 0000000..9026cd4
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ushort using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ushort)(ValueType)(object)o, Helper.Create(default(ushort)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ushort?)(ValueType)(object)o, Helper.Create(default(ushort)));
+    }
+
+    private static int Main()
+    {
+        ushort? s = Helper.Create(default(ushort));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics006.csproj
new file mode 100644 (file)
index 0000000..c40dac6
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics006.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.cs
new file mode 100644 (file)
index 0000000..c9a2613
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((int)(ValueType)(object)o, Helper.Create(default(int)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((int?)(ValueType)(object)o, Helper.Create(default(int)));
+    }
+
+    private static int Main()
+    {
+        int? s = Helper.Create(default(int));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics007.csproj
new file mode 100644 (file)
index 0000000..0a00ac2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics007.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.cs
new file mode 100644 (file)
index 0000000..61f7645
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of uint using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((uint)(ValueType)(object)o, Helper.Create(default(uint)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((uint?)(ValueType)(object)o, Helper.Create(default(uint)));
+    }
+
+    private static int Main()
+    {
+        uint? s = Helper.Create(default(uint));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics008.csproj
new file mode 100644 (file)
index 0000000..dbfd83b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics008.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.cs
new file mode 100644 (file)
index 0000000..bf88dd0
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((long)(ValueType)(object)o, Helper.Create(default(long)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((long?)(ValueType)(object)o, Helper.Create(default(long)));
+    }
+
+    private static int Main()
+    {
+        long? s = Helper.Create(default(long));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics009.csproj
new file mode 100644 (file)
index 0000000..69fd626
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics009.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.cs
new file mode 100644 (file)
index 0000000..342768b
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ulong using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ulong)(ValueType)(object)o, Helper.Create(default(ulong)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ulong?)(ValueType)(object)o, Helper.Create(default(ulong)));
+    }
+
+    private static int Main()
+    {
+        ulong? s = Helper.Create(default(ulong));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics010.csproj
new file mode 100644 (file)
index 0000000..20c104e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics010.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.cs
new file mode 100644 (file)
index 0000000..543ab23
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((float)(ValueType)(object)o, Helper.Create(default(float)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((float?)(ValueType)(object)o, Helper.Create(default(float)));
+    }
+
+    private static int Main()
+    {
+        float? s = Helper.Create(default(float));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics011.csproj
new file mode 100644 (file)
index 0000000..cf81cca
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics011.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.cs
new file mode 100644 (file)
index 0000000..a0744e1
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of double using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((double)(ValueType)(object)o, Helper.Create(default(double)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((double?)(ValueType)(object)o, Helper.Create(default(double)));
+    }
+
+    private static int Main()
+    {
+        double? s = Helper.Create(default(double));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics012.csproj
new file mode 100644 (file)
index 0000000..fb86ed6
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics012.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.cs
new file mode 100644 (file)
index 0000000..10b4d87
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((decimal)(ValueType)(object)o, Helper.Create(default(decimal)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((decimal?)(ValueType)(object)o, Helper.Create(default(decimal)));
+    }
+
+    private static int Main()
+    {
+        decimal? s = Helper.Create(default(decimal));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics013.csproj
new file mode 100644 (file)
index 0000000..ad2145f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics013.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.cs
new file mode 100644 (file)
index 0000000..bbb52b8
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of IntPtr using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((IntPtr)(ValueType)(object)o, Helper.Create(default(IntPtr)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((IntPtr?)(ValueType)(object)o, Helper.Create(default(IntPtr)));
+    }
+
+    private static int Main()
+    {
+        IntPtr? s = Helper.Create(default(IntPtr));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics014.csproj
new file mode 100644 (file)
index 0000000..16ffd7f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics014.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.cs
new file mode 100644 (file)
index 0000000..6000242
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((UIntPtr)(ValueType)(object)o, Helper.Create(default(UIntPtr)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((UIntPtr?)(ValueType)(object)o, Helper.Create(default(UIntPtr)));
+    }
+
+    private static int Main()
+    {
+        UIntPtr? s = Helper.Create(default(UIntPtr));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics015.csproj
new file mode 100644 (file)
index 0000000..d74191f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics015.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.cs
new file mode 100644 (file)
index 0000000..345196e
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of Guid using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((Guid)(ValueType)(object)o, Helper.Create(default(Guid)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((Guid?)(ValueType)(object)o, Helper.Create(default(Guid)));
+    }
+
+    private static int Main()
+    {
+        Guid? s = Helper.Create(default(Guid));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics016.csproj
new file mode 100644 (file)
index 0000000..092f9f5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics016.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.cs
new file mode 100644 (file)
index 0000000..ba7c792
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((GCHandle)(ValueType)(object)o, Helper.Create(default(GCHandle)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((GCHandle?)(ValueType)(object)o, Helper.Create(default(GCHandle)));
+    }
+
+    private static int Main()
+    {
+        GCHandle? s = Helper.Create(default(GCHandle));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics017.csproj
new file mode 100644 (file)
index 0000000..85d5005
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics017.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.cs
new file mode 100644 (file)
index 0000000..67d58b2
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ByteE using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ByteE)(ValueType)(object)o, Helper.Create(default(ByteE)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ByteE?)(ValueType)(object)o, Helper.Create(default(ByteE)));
+    }
+
+    private static int Main()
+    {
+        ByteE? s = Helper.Create(default(ByteE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics018.csproj
new file mode 100644 (file)
index 0000000..18cf10b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics018.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.cs
new file mode 100644 (file)
index 0000000..db51a77
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((IntE)(ValueType)(object)o, Helper.Create(default(IntE)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((IntE?)(ValueType)(object)o, Helper.Create(default(IntE)));
+    }
+
+    private static int Main()
+    {
+        IntE? s = Helper.Create(default(IntE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics019.csproj
new file mode 100644 (file)
index 0000000..0a7c9c6
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics019.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.cs
new file mode 100644 (file)
index 0000000..875da6e
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of LongE using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((LongE)(ValueType)(object)o, Helper.Create(default(LongE)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((LongE?)(ValueType)(object)o, Helper.Create(default(LongE)));
+    }
+
+    private static int Main()
+    {
+        LongE? s = Helper.Create(default(LongE));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics020.csproj
new file mode 100644 (file)
index 0000000..01e0537
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics020.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.cs
new file mode 100644 (file)
index 0000000..1c28bd0
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((EmptyStruct)(ValueType)(object)o, Helper.Create(default(EmptyStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((EmptyStruct?)(ValueType)(object)o, Helper.Create(default(EmptyStruct)));
+    }
+
+    private static int Main()
+    {
+        EmptyStruct? s = Helper.Create(default(EmptyStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics021.csproj
new file mode 100644 (file)
index 0000000..a5d25b4
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics021.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.cs
new file mode 100644 (file)
index 0000000..b25bcab
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStruct)(ValueType)(object)o, Helper.Create(default(NotEmptyStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStruct?)(ValueType)(object)o, Helper.Create(default(NotEmptyStruct)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStruct? s = Helper.Create(default(NotEmptyStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics022.csproj
new file mode 100644 (file)
index 0000000..a0aaed7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics022.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.cs
new file mode 100644 (file)
index 0000000..cb8b056
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructQ)(ValueType)(object)o, Helper.Create(default(NotEmptyStructQ)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructQ?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructQ)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQ? s = Helper.Create(default(NotEmptyStructQ));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics023.csproj
new file mode 100644 (file)
index 0000000..b46e1f3
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics023.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.cs
new file mode 100644 (file)
index 0000000..7d5b4ad
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructA using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructA)(ValueType)(object)o, Helper.Create(default(NotEmptyStructA)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructA?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructA)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructA? s = Helper.Create(default(NotEmptyStructA));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics024.csproj
new file mode 100644 (file)
index 0000000..8c9fd7c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics024.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.cs
new file mode 100644 (file)
index 0000000..294ffc7
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructQA)(ValueType)(object)o, Helper.Create(default(NotEmptyStructQA)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructQA?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructQA)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQA? s = Helper.Create(default(NotEmptyStructQA));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics025.csproj
new file mode 100644 (file)
index 0000000..812f1bb
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics025.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.cs
new file mode 100644 (file)
index 0000000..31083b1
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of EmptyStructGen<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((EmptyStructGen<int>)(ValueType)(object)o, Helper.Create(default(EmptyStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((EmptyStructGen<int>?)(ValueType)(object)o, Helper.Create(default(EmptyStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        EmptyStructGen<int>? s = Helper.Create(default(EmptyStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics026.csproj
new file mode 100644 (file)
index 0000000..df8fbc0
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics026.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.cs
new file mode 100644 (file)
index 0000000..e19e374
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructGen<int>)(ValueType)(object)o, Helper.Create(default(NotEmptyStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructGen<int>?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructGen<int>? s = Helper.Create(default(NotEmptyStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics027.csproj
new file mode 100644 (file)
index 0000000..298056f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics027.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.cs
new file mode 100644 (file)
index 0000000..2f8e341
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGen<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGen<int>)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGen<int>?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGen<int>? s = Helper.Create(default(NotEmptyStructConstrainedGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics028.csproj
new file mode 100644 (file)
index 0000000..29e35c2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics028.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.cs
new file mode 100644 (file)
index 0000000..af0f834
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenA<int>)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenA<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenA<int>?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenA<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenA<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenA<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics029.csproj
new file mode 100644 (file)
index 0000000..f99f3d2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics029.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.cs
new file mode 100644 (file)
index 0000000..88f0b98
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGenQ<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQ<int>)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQ<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQ<int>?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQ<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQ<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenQ<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics030.csproj
new file mode 100644 (file)
index 0000000..2f1336d
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics030.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.cs
new file mode 100644 (file)
index 0000000..5f06e92
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQA<int>)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQA<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NotEmptyStructConstrainedGenQA<int>?)(ValueType)(object)o, Helper.Create(default(NotEmptyStructConstrainedGenQA<int>)));
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQA<int>? s = Helper.Create(default(NotEmptyStructConstrainedGenQA<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics031.csproj
new file mode 100644 (file)
index 0000000..a7e5490
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics031.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.cs
new file mode 100644 (file)
index 0000000..7c3f573
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NestedStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NestedStruct)(ValueType)(object)o, Helper.Create(default(NestedStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NestedStruct?)(ValueType)(object)o, Helper.Create(default(NestedStruct)));
+    }
+
+    private static int Main()
+    {
+        NestedStruct? s = Helper.Create(default(NestedStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics032.csproj
new file mode 100644 (file)
index 0000000..ba307c6
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics032.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.cs
new file mode 100644 (file)
index 0000000..35e2be4
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((NestedStructGen<int>)(ValueType)(object)o, Helper.Create(default(NestedStructGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((NestedStructGen<int>?)(ValueType)(object)o, Helper.Create(default(NestedStructGen<int>)));
+    }
+
+    private static int Main()
+    {
+        NestedStructGen<int>? s = Helper.Create(default(NestedStructGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics033.csproj
new file mode 100644 (file)
index 0000000..15c9a22
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics033.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.cs
new file mode 100644 (file)
index 0000000..e8321b0
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ExplicitFieldOffsetStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ExplicitFieldOffsetStruct)(ValueType)(object)o, Helper.Create(default(ExplicitFieldOffsetStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ExplicitFieldOffsetStruct?)(ValueType)(object)o, Helper.Create(default(ExplicitFieldOffsetStruct)));
+    }
+
+    private static int Main()
+    {
+        ExplicitFieldOffsetStruct? s = Helper.Create(default(ExplicitFieldOffsetStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics034.csproj
new file mode 100644 (file)
index 0000000..c8554ca
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics034.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.cs
new file mode 100644 (file)
index 0000000..9c42246
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((MarshalAsStruct)(ValueType)(object)o, Helper.Create(default(MarshalAsStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((MarshalAsStruct?)(ValueType)(object)o, Helper.Create(default(MarshalAsStruct)));
+    }
+
+    private static int Main()
+    {
+        MarshalAsStruct? s = Helper.Create(default(MarshalAsStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics037.csproj
new file mode 100644 (file)
index 0000000..c86f773
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics037.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.cs
new file mode 100644 (file)
index 0000000..d00ccb5
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterface using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ImplementOneInterface)(ValueType)(object)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ImplementOneInterface?)(ValueType)(object)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics038.csproj
new file mode 100644 (file)
index 0000000..65bbece
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics038.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.cs
new file mode 100644 (file)
index 0000000..3557c3b
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ImplementTwoInterface)(ValueType)(object)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ImplementTwoInterface?)(ValueType)(object)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics039.csproj
new file mode 100644 (file)
index 0000000..c7cbe7a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics039.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.cs
new file mode 100644 (file)
index 0000000..0674c8f
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterfaceGen<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>)(ValueType)(object)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>?)(ValueType)(object)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterfaceGen<int>? s = Helper.Create(default(ImplementOneInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics040.csproj
new file mode 100644 (file)
index 0000000..098a8f4
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics040.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.cs
new file mode 100644 (file)
index 0000000..2891e57
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>)(ValueType)(object)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>?)(ValueType)(object)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterfaceGen<int>? s = Helper.Create(default(ImplementTwoInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics041.csproj
new file mode 100644 (file)
index 0000000..569df4f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics041.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.cs
new file mode 100644 (file)
index 0000000..d8f49b6
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementAllInterface<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>)(ValueType)(object)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>?)(ValueType)(object)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementAllInterface<int>? s = Helper.Create(default(ImplementAllInterface<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics042.csproj
new file mode 100644 (file)
index 0000000..f061c90
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics042.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.cs
new file mode 100644 (file)
index 0000000..6ab22ce
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((WithMultipleGCHandleStruct)(ValueType)(object)o, Helper.Create(default(WithMultipleGCHandleStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((WithMultipleGCHandleStruct?)(ValueType)(object)o, Helper.Create(default(WithMultipleGCHandleStruct)));
+    }
+
+    private static int Main()
+    {
+        WithMultipleGCHandleStruct? s = Helper.Create(default(WithMultipleGCHandleStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics043.csproj
new file mode 100644 (file)
index 0000000..60d207a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics043.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.cs
new file mode 100644 (file)
index 0000000..728fcfc
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of WithOnlyFXTypeStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((WithOnlyFXTypeStruct)(ValueType)(object)o, Helper.Create(default(WithOnlyFXTypeStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((WithOnlyFXTypeStruct?)(ValueType)(object)o, Helper.Create(default(WithOnlyFXTypeStruct)));
+    }
+
+    private static int Main()
+    {
+        WithOnlyFXTypeStruct? s = Helper.Create(default(WithOnlyFXTypeStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics044.csproj
new file mode 100644 (file)
index 0000000..45e81eb
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics044.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.cs
new file mode 100644 (file)
index 0000000..005f026
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ<T>(T o)
+    {
+        return Helper.Compare((MixedAllStruct)(ValueType)(object)o, Helper.Create(default(MixedAllStruct)));
+    }
+
+    private static bool BoxUnboxToQ<T>(T o)
+    {
+        return Helper.Compare((MixedAllStruct?)(ValueType)(object)o, Helper.Create(default(MixedAllStruct)));
+    }
+
+    private static int Main()
+    {
+        MixedAllStruct? s = Helper.Create(default(MixedAllStruct));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/generics/castclass-generics045.csproj
new file mode 100644 (file)
index 0000000..9fb87fe
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-generics045.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/app.config b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.cs
new file mode 100644 (file)
index 0000000..5223de0
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterface using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterface)(IEmpty)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterface?)(IEmpty)o, Helper.Create(default(ImplementOneInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterface? s = Helper.Create(default(ImplementOneInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface001.csproj
new file mode 100644 (file)
index 0000000..4555942
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.cs
new file mode 100644 (file)
index 0000000..3589afd
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterface)(IEmpty)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterface?)(IEmpty)o, Helper.Create(default(ImplementTwoInterface)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterface? s = Helper.Create(default(ImplementTwoInterface));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface002.csproj
new file mode 100644 (file)
index 0000000..f37222d
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.cs
new file mode 100644 (file)
index 0000000..0bc962b
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementOneInterfaceGen<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>)(IEmptyGen<int>)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementOneInterfaceGen<int>?)(IEmptyGen<int>)o, Helper.Create(default(ImplementOneInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterfaceGen<int>? s = Helper.Create(default(ImplementOneInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface003.csproj
new file mode 100644 (file)
index 0000000..25e5801
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.cs
new file mode 100644 (file)
index 0000000..371d01f
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>)(IEmptyGen<int>)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementTwoInterfaceGen<int>?)(IEmptyGen<int>)o, Helper.Create(default(ImplementTwoInterfaceGen<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterfaceGen<int>? s = Helper.Create(default(ImplementTwoInterfaceGen<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface004.csproj
new file mode 100644 (file)
index 0000000..6e20e49
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface004.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.cs
new file mode 100644 (file)
index 0000000..13995a1
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementAllInterface<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>)(IEmpty)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ImplementAllInterface<int>?)(IEmpty)o, Helper.Create(default(ImplementAllInterface<int>)));
+    }
+
+    private static int Main()
+    {
+        ImplementAllInterface<int>? s = Helper.Create(default(ImplementAllInterface<int>));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface005.csproj
new file mode 100644 (file)
index 0000000..4b2b10d
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface005.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.cs
new file mode 100644 (file)
index 0000000..977eed0
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((char)(IComparable)o, Helper.Create(default(char)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((char?)(IComparable)o, Helper.Create(default(char)));
+    }
+
+    private static int Main()
+    {
+        char? s = Helper.Create(default(char));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface006.csproj
new file mode 100644 (file)
index 0000000..45dde42
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface006.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.cs
new file mode 100644 (file)
index 0000000..6070897
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of bool using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((bool)(IComparable)o, Helper.Create(default(bool)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((bool?)(IComparable)o, Helper.Create(default(bool)));
+    }
+
+    private static int Main()
+    {
+        bool? s = Helper.Create(default(bool));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface007.csproj
new file mode 100644 (file)
index 0000000..aedf184
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface007.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.cs
new file mode 100644 (file)
index 0000000..d2ea648
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((byte)(IComparable)o, Helper.Create(default(byte)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((byte?)(IComparable)o, Helper.Create(default(byte)));
+    }
+
+    private static int Main()
+    {
+        byte? s = Helper.Create(default(byte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface008.csproj
new file mode 100644 (file)
index 0000000..3de3eb7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface008.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.cs
new file mode 100644 (file)
index 0000000..f101f20
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of sbyte using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((sbyte)(IComparable)o, Helper.Create(default(sbyte)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((sbyte?)(IComparable)o, Helper.Create(default(sbyte)));
+    }
+
+    private static int Main()
+    {
+        sbyte? s = Helper.Create(default(sbyte));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface009.csproj
new file mode 100644 (file)
index 0000000..5462126
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface009.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.cs
new file mode 100644 (file)
index 0000000..d6e47ec
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((short)(IComparable)o, Helper.Create(default(short)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((short?)(IComparable)o, Helper.Create(default(short)));
+    }
+
+    private static int Main()
+    {
+        short? s = Helper.Create(default(short));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface010.csproj
new file mode 100644 (file)
index 0000000..f3b9c52
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface010.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.cs
new file mode 100644 (file)
index 0000000..35248d9
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ushort using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ushort)(IComparable)o, Helper.Create(default(ushort)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ushort?)(IComparable)o, Helper.Create(default(ushort)));
+    }
+
+    private static int Main()
+    {
+        ushort? s = Helper.Create(default(ushort));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface011.csproj
new file mode 100644 (file)
index 0000000..87e51a1
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface011.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.cs
new file mode 100644 (file)
index 0000000..8ee21fa
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((int)(IComparable)o, Helper.Create(default(int)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((int?)(IComparable)o, Helper.Create(default(int)));
+    }
+
+    private static int Main()
+    {
+        int? s = Helper.Create(default(int));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface012.csproj
new file mode 100644 (file)
index 0000000..2364ec2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface012.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.cs
new file mode 100644 (file)
index 0000000..44bb10d
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of uint using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((uint)(IComparable)o, Helper.Create(default(uint)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((uint?)(IComparable)o, Helper.Create(default(uint)));
+    }
+
+    private static int Main()
+    {
+        uint? s = Helper.Create(default(uint));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface013.csproj
new file mode 100644 (file)
index 0000000..243d984
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface013.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.cs
new file mode 100644 (file)
index 0000000..c6a9f32
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((long)(IComparable)o, Helper.Create(default(long)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((long?)(IComparable)o, Helper.Create(default(long)));
+    }
+
+    private static int Main()
+    {
+        long? s = Helper.Create(default(long));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface014.csproj
new file mode 100644 (file)
index 0000000..22070da
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface014.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.cs
new file mode 100644 (file)
index 0000000..13cb443
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ulong using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((ulong)(IComparable)o, Helper.Create(default(ulong)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((ulong?)(IComparable)o, Helper.Create(default(ulong)));
+    }
+
+    private static int Main()
+    {
+        ulong? s = Helper.Create(default(ulong));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface015.csproj
new file mode 100644 (file)
index 0000000..1a0f7fb
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface015.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.cs
new file mode 100644 (file)
index 0000000..a3fc4c4
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((float)(IComparable)o, Helper.Create(default(float)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((float?)(IComparable)o, Helper.Create(default(float)));
+    }
+
+    private static int Main()
+    {
+        float? s = Helper.Create(default(float));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface016.csproj
new file mode 100644 (file)
index 0000000..8646695
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface016.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.cs
new file mode 100644 (file)
index 0000000..b3de02f
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of double using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((double)(IComparable)o, Helper.Create(default(double)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((double?)(IComparable)o, Helper.Create(default(double)));
+    }
+
+    private static int Main()
+    {
+        double? s = Helper.Create(default(double));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface017.csproj
new file mode 100644 (file)
index 0000000..3477173
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface017.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.cs
new file mode 100644 (file)
index 0000000..9cea560
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return Helper.Compare((decimal)(IComparable)o, Helper.Create(default(decimal)));
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return Helper.Compare((decimal?)(IComparable)o, Helper.Create(default(decimal)));
+    }
+
+    private static int Main()
+    {
+        decimal? s = Helper.Create(default(decimal));
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/interface/castclass-interface018.csproj
new file mode 100644 (file)
index 0000000..43b21a5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-interface018.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/app.config b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/app.config
new file mode 100644 (file)
index 0000000..8077c95
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+      <dependentAssembly>
+        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+      <dependentAssembly>
+        <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+        <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
+      </dependentAssembly>
+    </assemblyBinding>
+  </runtime>
+</configuration>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.cs
new file mode 100644 (file)
index 0000000..894005c
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of char using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((char?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        char? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null001.csproj
new file mode 100644 (file)
index 0000000..9351f1c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null001.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.cs
new file mode 100644 (file)
index 0000000..58396af
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((bool?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        bool? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null002.csproj
new file mode 100644 (file)
index 0000000..13c695e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null002.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.cs
new file mode 100644 (file)
index 0000000..2d114e1
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of byte using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((byte?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        byte? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null003.csproj
new file mode 100644 (file)
index 0000000..a67114c
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null003.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.cs
new file mode 100644 (file)
index 0000000..3012b72
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((sbyte?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        sbyte? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null004.csproj
new file mode 100644 (file)
index 0000000..e61fc61
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null004.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.cs
new file mode 100644 (file)
index 0000000..70cf926
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of short using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((short?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        short? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null005.csproj
new file mode 100644 (file)
index 0000000..02dde3e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null005.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.cs
new file mode 100644 (file)
index 0000000..c788691
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ushort?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        ushort? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null006.csproj
new file mode 100644 (file)
index 0000000..e4a4a04
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null006.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.cs
new file mode 100644 (file)
index 0000000..ba8d11d
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of int using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((int?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        int? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null007.csproj
new file mode 100644 (file)
index 0000000..ed8ac48
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null007.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.cs
new file mode 100644 (file)
index 0000000..83f625c
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((uint?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        uint? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null008.csproj
new file mode 100644 (file)
index 0000000..a2e4ac7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null008.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.cs
new file mode 100644 (file)
index 0000000..3a57b19
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of long using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((long?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        long? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null009.csproj
new file mode 100644 (file)
index 0000000..9b80335
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null009.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.cs
new file mode 100644 (file)
index 0000000..0c08a82
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ulong?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        ulong? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null010.csproj
new file mode 100644 (file)
index 0000000..1979ef7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null010.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.cs
new file mode 100644 (file)
index 0000000..f248d68
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of float using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((float?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        float? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null011.csproj
new file mode 100644 (file)
index 0000000..c91db41
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null011.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.cs
new file mode 100644 (file)
index 0000000..270b1b1
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((double?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        double? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null012.csproj
new file mode 100644 (file)
index 0000000..ed29b53
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null012.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.cs
new file mode 100644 (file)
index 0000000..d0575f8
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of decimal using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((decimal?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        decimal? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null013.csproj
new file mode 100644 (file)
index 0000000..e76cbd5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null013.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.cs
new file mode 100644 (file)
index 0000000..e21d634
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((IntPtr?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        IntPtr? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null014.csproj
new file mode 100644 (file)
index 0000000..c70633b
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null014.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.cs
new file mode 100644 (file)
index 0000000..8837fb1
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of UIntPtr using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((UIntPtr?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        UIntPtr? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null015.csproj
new file mode 100644 (file)
index 0000000..62dab5f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null015.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.cs
new file mode 100644 (file)
index 0000000..c6eaa5d
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((Guid?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        Guid? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null016.csproj
new file mode 100644 (file)
index 0000000..939ecb6
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null016.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.cs
new file mode 100644 (file)
index 0000000..2c00160
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of GCHandle using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((GCHandle?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        GCHandle? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null017.csproj
new file mode 100644 (file)
index 0000000..8b2dc40
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null017.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.cs
new file mode 100644 (file)
index 0000000..1e38553
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ByteE?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        ByteE? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null018.csproj
new file mode 100644 (file)
index 0000000..9a29a06
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null018.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.cs
new file mode 100644 (file)
index 0000000..3138756
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of IntE using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((IntE?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        IntE? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null019.csproj
new file mode 100644 (file)
index 0000000..6d72fc7
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null019.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.cs
new file mode 100644 (file)
index 0000000..cfd735d
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((LongE?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        LongE? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null020.csproj
new file mode 100644 (file)
index 0000000..45ca2a1
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null020.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.cs
new file mode 100644 (file)
index 0000000..74d90be
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of EmptyStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((EmptyStruct?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        EmptyStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null021.csproj
new file mode 100644 (file)
index 0000000..49b8bd2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null021.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.cs
new file mode 100644 (file)
index 0000000..c2bd44e
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStruct?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null022.csproj
new file mode 100644 (file)
index 0000000..5c0dabc
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null022.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.cs
new file mode 100644 (file)
index 0000000..2c92062
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructQ using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructQ?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQ? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null023.csproj
new file mode 100644 (file)
index 0000000..3251ef2
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null023.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.cs
new file mode 100644 (file)
index 0000000..dfe7e1e
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructA?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructA? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null024.csproj
new file mode 100644 (file)
index 0000000..4a446c9
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null024.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.cs
new file mode 100644 (file)
index 0000000..841d4ac
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructQA using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructQA?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructQA? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null025.csproj
new file mode 100644 (file)
index 0000000..9f37d91
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null025.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.cs
new file mode 100644 (file)
index 0000000..651a157
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((EmptyStructGen<int>?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        EmptyStructGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null026.csproj
new file mode 100644 (file)
index 0000000..bf9983f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null026.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.cs
new file mode 100644 (file)
index 0000000..3b96a9f
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructGen<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructGen<int>?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null027.csproj
new file mode 100644 (file)
index 0000000..da5f096
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null027.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.cs
new file mode 100644 (file)
index 0000000..f084169
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructConstrainedGen<int>?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null028.csproj
new file mode 100644 (file)
index 0000000..55f0eb5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null028.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.cs
new file mode 100644 (file)
index 0000000..6cfa779
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGenA<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructConstrainedGenA<int>?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenA<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null029.csproj
new file mode 100644 (file)
index 0000000..66b6c84
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null029.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.cs
new file mode 100644 (file)
index 0000000..bec7eef
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructConstrainedGenQ<int>?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQ<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null030.csproj
new file mode 100644 (file)
index 0000000..b150cea
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null030.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.cs
new file mode 100644 (file)
index 0000000..7fe865a
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NotEmptyStructConstrainedGenQA<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NotEmptyStructConstrainedGenQA<int>?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NotEmptyStructConstrainedGenQA<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null031.csproj
new file mode 100644 (file)
index 0000000..c1d4b5a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null031.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.cs
new file mode 100644 (file)
index 0000000..81481d0
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NestedStruct?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NestedStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null032.csproj
new file mode 100644 (file)
index 0000000..a18d818
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null032.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.cs
new file mode 100644 (file)
index 0000000..dba81fc
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of NestedStructGen<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((NestedStructGen<int>?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        NestedStructGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null033.csproj
new file mode 100644 (file)
index 0000000..96f27db
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null033.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.cs
new file mode 100644 (file)
index 0000000..ad51d20
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ExplicitFieldOffsetStruct?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        ExplicitFieldOffsetStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null034.csproj
new file mode 100644 (file)
index 0000000..fbf1861
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null034.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.cs
new file mode 100644 (file)
index 0000000..52c55a1
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of MarshalAsStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((MarshalAsStruct?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        MarshalAsStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null037.csproj
new file mode 100644 (file)
index 0000000..3e6482e
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null037.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.cs
new file mode 100644 (file)
index 0000000..2d29dd6
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ImplementOneInterface?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterface? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null038.csproj
new file mode 100644 (file)
index 0000000..b86cf7d
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null038.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.cs
new file mode 100644 (file)
index 0000000..c00d9fd
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementTwoInterface using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ImplementTwoInterface?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterface? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null039.csproj
new file mode 100644 (file)
index 0000000..ee1569a
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null039.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.cs
new file mode 100644 (file)
index 0000000..b041a1f
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ImplementOneInterfaceGen<int>?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        ImplementOneInterfaceGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null040.csproj
new file mode 100644 (file)
index 0000000..7a8fed5
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null040.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.cs
new file mode 100644 (file)
index 0000000..96c2c80
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of ImplementTwoInterfaceGen<int> using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ImplementTwoInterfaceGen<int>?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        ImplementTwoInterfaceGen<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null041.csproj
new file mode 100644 (file)
index 0000000..48007be
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null041.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.cs
new file mode 100644 (file)
index 0000000..b48e925
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((ImplementAllInterface<int>?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        ImplementAllInterface<int>? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null042.csproj
new file mode 100644 (file)
index 0000000..85e5ddf
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null042.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.cs
new file mode 100644 (file)
index 0000000..7d156eb
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of WithMultipleGCHandleStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((WithMultipleGCHandleStruct?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        WithMultipleGCHandleStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null043.csproj
new file mode 100644 (file)
index 0000000..b2cadbb
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null043.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.cs
new file mode 100644 (file)
index 0000000..32708cd
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((WithOnlyFXTypeStruct?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        WithOnlyFXTypeStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null044.csproj
new file mode 100644 (file)
index 0000000..0c180db
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null044.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.cs
new file mode 100644 (file)
index 0000000..b9d8fa2
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+// <Area> Nullable - CastClass </Area>
+// <Title> Nullable type with castclass expr  </Title>
+// <Description>  
+// checking type of MixedAllStruct using cast expr
+// </Description> 
+// <RelatedBugs> </RelatedBugs>  
+//<Expects Status=success></Expects>
+// <Code> 
+
+
+using System.Runtime.InteropServices;
+using System;
+
+internal class NullableTest
+{
+    private static bool BoxUnboxToNQGen<T>(T o)
+    {
+        return ((ValueType)(object)o) == null;
+    }
+
+    private static bool BoxUnboxToQGen<T>(T? o) where T : struct
+    {
+        return ((T?)(object)(ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToNQ(object o)
+    {
+        return ((ValueType)o) == null;
+    }
+
+    private static bool BoxUnboxToQ(object o)
+    {
+        return ((MixedAllStruct?)(ValueType)o) == null;
+    }
+
+    private static int Main()
+    {
+        MixedAllStruct? s = null;
+
+        if (BoxUnboxToNQ(s) && BoxUnboxToQ(s) && BoxUnboxToNQGen(s) && BoxUnboxToQGen(s))
+            return ExitCode.Passed;
+        else
+            return ExitCode.Failed;
+    }
+}
+
+
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.csproj b/tests/src/JIT/jit64/valuetypes/nullable/castclass/null/castclass-null045.csproj
new file mode 100644 (file)
index 0000000..4fd6d4f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <AssemblyName>$(MSBuildProjectName)</AssemblyName>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <FileAlignment>512</FileAlignment>
+    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+    <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
+    <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
+    <RestorePackages>true</RestorePackages>
+    <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
+  </PropertyGroup>
+  <!-- Default configurations to help VS understand the configurations -->
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+  </PropertyGroup>
+  <ItemGroup>
+    <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
+      <Visible>False</Visible>
+    </CodeAnalysisDependentAssemblyPaths>
+  </ItemGroup>
+  <PropertyGroup>
+    <DebugType></DebugType>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="castclass-null045.cs" />
+    <Compile Include="..\structdef.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
+    <None Include="app.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+  </ItemGroup>
+  <PropertyGroup>
+    <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
+    <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
+  </PropertyGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+  <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
+  </PropertyGroup> 
+</Project>
\ No newline at end of file
diff --git a/tests/src/JIT/jit64/valuetypes/nullable/castclass/structdef.cs b/tests/src/JIT/jit64/valuetypes/nullable/castclass/structdef.cs
new file mode 100644 (file)
index 0000000..1a1105f
--- /dev/null
@@ -0,0 +1,401 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+#pragma warning disable 0183
+
+using System.Runtime.InteropServices;
+using System;
+using System.ComponentModel;
+// primitives / CLR Types
+
+// interfaces 
+public interface IEmpty { }
+public interface INotEmpty
+{
+    void DoNothing();
+}
+
+// generic interfaces 
+public interface IEmptyGen<T> { }
+public interface INotEmptyGen<T>
+{
+    void DoNothing();
+}
+
+// struct 
+public struct EmptyStruct { }
+public struct NotEmptyStruct
+{
+    public int Field;
+}
+
+public struct NotEmptyStructQ
+{
+    public int? Field;
+}
+
+public struct NotEmptyStructA
+{
+    public int[] Field;
+}
+
+public struct NotEmptyStructQA
+{
+    public int?[] Field;
+}
+
+// generic structs 
+public struct EmptyStructGen<T> { }
+public struct NotEmptyStructGen<T>
+{
+    public T Field;
+}
+
+public struct NotEmptyStructConstrainedGen<T> where T : struct
+{
+    public T Field;
+}
+
+public struct NotEmptyStructConstrainedGenA<T> where T : struct
+{
+    public T[] Field;
+}
+
+public struct NotEmptyStructConstrainedGenQ<T> where T : struct
+{
+    public T? Field;
+}
+
+public struct NotEmptyStructConstrainedGenQA<T> where T : struct
+{
+    public T?[] Field;
+}
+
+// nested struct 
+public struct NestedStruct
+{
+    public struct Nested { }
+}
+
+public struct NestedStructGen<T>
+{
+    public struct Nested { }
+}
+
+
+// struct with Field Offset
+[StructLayout(LayoutKind.Explicit)]
+public struct ExplicitFieldOffsetStruct
+{
+    [FieldOffset(0)]
+    public int Field00;
+    [FieldOffset(0x0f)]
+    public int Field15;
+}
+
+// struct with Attributes
+internal struct MarshalAsStruct
+{
+    [System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)]
+    public string StringField;
+}
+
+// struct implement interfaces
+internal struct ImplementOneInterface : IEmpty { }
+
+internal struct ImplementTwoInterface : IEmpty, INotEmpty
+{
+    public void DoNothing() { }
+}
+
+internal struct ImplementOneInterfaceGen<T> : IEmptyGen<T> { }
+
+internal struct ImplementTwoInterfaceGen<T> : IEmptyGen<T>, INotEmptyGen<T>
+{
+    public void DoNothing() { }
+}
+
+internal struct ImplementAllInterface<T> : IEmpty, INotEmpty, IEmptyGen<T>, INotEmptyGen<T>
+{
+    public void DoNothing() { }
+    void INotEmptyGen<T>.DoNothing() { }
+}
+
+// enums
+public enum IntE { start = 1, }
+public enum ByteE : byte { start = 1, }
+public enum LongE : long { start = 1, }
+
+
+// other intersting structs
+public struct WithMultipleGCHandleStruct
+{
+    public GCHandle H1;
+    public GCHandle H2;
+    public GCHandle H3;
+    public GCHandle H4;
+    public GCHandle H5;
+}
+
+public struct WithOnlyFXTypeStruct
+{
+    public Guid GUID;
+    public decimal DECIMAL;
+}
+
+
+public struct MixedAllStruct
+{
+    public int INT;
+    public int? IntQ;
+    public int?[] IntQA;
+    public string STRING;
+    public IntE INTE;
+    public EmptyClass EMPTYCLASS;
+    public IEmpty IEMPTY;
+    public EmptyStruct EMPTYSTRUCT;
+    public IEmptyGen<int> IEMPTYGEN;
+    public EmptyStructGen<int> EMPTYSTRUCTGEN;
+    public WithOnlyFXTypeStruct WITHONLYFXTYPESTRUCT;
+    public GCHandle GCHANDLE;
+}
+
+
+// other types
+public struct EmptyClass { }
+public struct NotEmptyClass
+{
+    public int Field;
+}
+
+public struct EmptyClassGen<T> { }
+public struct NotEmptyClassGen<T>
+{
+    public T Field;
+}
+
+public struct NotEmptyClassConstrainedGen<T> where T : class
+{
+    public T Field;
+}
+public struct NestedClass
+{
+    public struct Nested { }
+}
+
+public struct NestedClassGen<T>
+{
+    public struct Nested { }
+}
+
+internal class ImplementOneInterfaceC : IEmpty { }
+
+internal class ImplementTwoInterfaceC : IEmpty, INotEmpty
+{
+    public void DoNothing() { }
+}
+
+internal class ImplementOneInterfaceGenC<T> : IEmptyGen<T> { }
+
+internal class ImplementTwoInterfaceGenC<T> : IEmptyGen<T>, INotEmptyGen<T>
+{
+    public void DoNothing() { }
+}
+
+internal class ImplementAllInterfaceC<T> : IEmpty, INotEmpty, IEmptyGen<T>, INotEmptyGen<T>
+{
+    public void DoNothing() { }
+    void INotEmptyGen<T>.DoNothing() { }
+}
+
+public sealed class SealedClass { }
+
+public delegate void SimpleDelegate();
+public delegate void GenericDelegate<T>();
+
+
+// ExitCode
+public static class ExitCode
+{
+    public static int Failed = 101;
+    public static int Passed = 100;
+}
+
+
+// Create Value Instance
+internal static class Helper
+{
+    public static GCHandle GCHANDLE;
+    static Helper()
+    {
+        GCHANDLE = GCHandle.Alloc(System.Console.Out);
+    }
+
+    public static char Create(char val) { return 'c'; }
+    public static bool Create(bool val) { return true; }
+    public static byte Create(byte val) { return 0x08; }
+    public static sbyte Create(sbyte val) { return -0x0e; }
+    public static short Create(short val) { return -0x0f; }
+    public static ushort Create(ushort val) { return 0xff; }
+    public static int Create(int val) { return 100; }
+    public static uint Create(uint val) { return 200; }
+    public static long Create(long val) { return int.MaxValue; }
+    public static ulong Create(ulong val) { return 300; }
+    public static float Create(float val) { return 1.15f; }
+    public static double Create(double val) { return 0.05; }
+    public static decimal Create(decimal val) { return 1.0M; }
+
+    public static IntPtr Create(IntPtr val) { return (IntPtr)1000; }
+    public static UIntPtr Create(UIntPtr val) { return (UIntPtr)2000; }
+    public static Guid Create(Guid val) { return new Guid("00020810-0001-0000-C000-000000000046"); }
+    public static GCHandle Create(GCHandle val) { return GCHANDLE; }
+    public static ByteE Create(ByteE val) { return (ByteE)9; }
+    public static IntE Create(IntE val) { return (IntE)55; }
+    public static LongE Create(LongE val) { return (LongE)34; }
+    public static EmptyStruct Create(EmptyStruct val) { return new EmptyStruct(); }
+    public static NotEmptyStruct Create(NotEmptyStruct val) { NotEmptyStruct ne = new NotEmptyStruct(); ne.Field = 100; return ne; }
+    public static NotEmptyStructQ Create(NotEmptyStructQ val) { NotEmptyStructQ neq = new NotEmptyStructQ(); neq.Field = 101; return neq; }
+    public static NotEmptyStructA Create(NotEmptyStructA val) { NotEmptyStructA nea = new NotEmptyStructA(); nea.Field = new int[] { 10 }; return nea; }
+    public static NotEmptyStructQA Create(NotEmptyStructQA val) { NotEmptyStructQA neq = new NotEmptyStructQA(); neq.Field = new int?[] { 10 }; return neq; }
+    public static EmptyStructGen<int> Create(EmptyStructGen<int> val) { return new EmptyStructGen<int>(); }
+    public static NotEmptyStructGen<int> Create(NotEmptyStructGen<int> val) { NotEmptyStructGen<int> ne = new NotEmptyStructGen<int>(); ne.Field = 88; return ne; }
+    public static NotEmptyStructConstrainedGen<int> Create(NotEmptyStructConstrainedGen<int> val) { NotEmptyStructConstrainedGen<int> ne = new NotEmptyStructConstrainedGen<int>(); ne.Field = 1010; return ne; }
+    public static NotEmptyStructConstrainedGenA<int> Create(NotEmptyStructConstrainedGenA<int> val) { NotEmptyStructConstrainedGenA<int> neq = new NotEmptyStructConstrainedGenA<int>(); neq.Field = new int[] { 11 }; return neq; }
+    public static NotEmptyStructConstrainedGenQ<int> Create(NotEmptyStructConstrainedGenQ<int> val) { NotEmptyStructConstrainedGenQ<int> neq = new NotEmptyStructConstrainedGenQ<int>(); neq.Field = 12; return neq; }
+    public static NotEmptyStructConstrainedGenQA<int> Create(NotEmptyStructConstrainedGenQA<int> val) { NotEmptyStructConstrainedGenQA<int> neq = new NotEmptyStructConstrainedGenQA<int>(); neq.Field = new int?[] { 17 }; return neq; }
+    public static NestedStruct Create(NestedStruct val) { NestedStruct ns = new NestedStruct(); return ns; }
+    public static NestedStructGen<int> Create(NestedStructGen<int> val) { NestedStructGen<int> nsg = new NestedStructGen<int>(); return nsg; }
+    public static ExplicitFieldOffsetStruct Create(ExplicitFieldOffsetStruct val) { ExplicitFieldOffsetStruct epl = new ExplicitFieldOffsetStruct(); epl.Field00 = 40; epl.Field15 = 15; return epl; }
+    public static MarshalAsStruct Create(MarshalAsStruct val) { MarshalAsStruct ma = new MarshalAsStruct(); ma.StringField = "Nullable"; return ma; }
+    public static ImplementOneInterface Create(ImplementOneInterface val) { ImplementOneInterface imp = new ImplementOneInterface(); return imp; }
+    public static ImplementTwoInterface Create(ImplementTwoInterface val) { ImplementTwoInterface imp = new ImplementTwoInterface(); return imp; }
+    public static ImplementOneInterfaceGen<int> Create(ImplementOneInterfaceGen<int> val) { ImplementOneInterfaceGen<int> imp = new ImplementOneInterfaceGen<int>(); return imp; }
+    public static ImplementTwoInterfaceGen<int> Create(ImplementTwoInterfaceGen<int> val) { ImplementTwoInterfaceGen<int> imp = new ImplementTwoInterfaceGen<int>(); return imp; }
+    public static ImplementAllInterface<int> Create(ImplementAllInterface<int> val) { ImplementAllInterface<int> imp = new ImplementAllInterface<int>(); return imp; }
+    public static WithMultipleGCHandleStruct Create(WithMultipleGCHandleStruct val)
+    { WithMultipleGCHandleStruct mgch = new WithMultipleGCHandleStruct(); mgch.H1 = GCHANDLE; mgch.H2 = GCHANDLE; mgch.H3 = GCHANDLE; mgch.H4 = GCHANDLE; mgch.H5 = GCHANDLE; return mgch; }
+    public static WithOnlyFXTypeStruct Create(WithOnlyFXTypeStruct val) { WithOnlyFXTypeStruct wofx = new WithOnlyFXTypeStruct(); wofx.DECIMAL = 50.0m; wofx.GUID = Create(default(Guid)); return wofx; }
+    public static MixedAllStruct Create(MixedAllStruct val)
+    {
+        MixedAllStruct mas;
+        mas.INT = 10;
+        mas.IntQ = null;
+        mas.IntQA = new int?[] { 10 };
+        mas.STRING = "Nullable";
+        mas.INTE = Create(default(IntE));
+        mas.EMPTYCLASS = new EmptyClass();
+        mas.IEMPTY = Create(default(ImplementOneInterface));
+        mas.EMPTYSTRUCT = Create(default(EmptyStruct));
+        mas.IEMPTYGEN = Create(default(ImplementOneInterfaceGen<int>));
+        mas.EMPTYSTRUCTGEN = Create(default(EmptyStructGen<int>));
+        mas.WITHONLYFXTYPESTRUCT = Create(default(WithOnlyFXTypeStruct));
+        mas.GCHANDLE = Create(default(GCHandle));
+
+        return mas;
+    }
+
+    public static bool Compare(char val, char val1) { return val == val1; }
+    public static bool Compare(bool val, bool val1) { return val == val1; }
+    public static bool Compare(byte val, byte val1) { return val == val1; }
+    public static bool Compare(sbyte val, sbyte val1) { return val == val1; }
+    public static bool Compare(short val, short val1) { return val == val1; }
+    public static bool Compare(ushort val, ushort val1) { return val == val1; }
+    public static bool Compare(int val, int val1) { return val == val1; }
+    public static bool Compare(uint val, uint val1) { return val == val1; }
+    public static bool Compare(long val, long val1) { return val == val1; }
+    public static bool Compare(ulong val, ulong val1) { return val == val1; }
+    public static bool Compare(float val, float val1) { return val == val1; }
+    public static bool Compare(double val, double val1) { return val == val1; }
+    public static bool Compare(decimal val, decimal val1) { return val == val1; }
+
+    public static bool Compare(IntPtr val, IntPtr val1) { return val == val1; }
+    public static bool Compare(UIntPtr val, UIntPtr val1) { return val == val1; }
+    public static bool Compare(Guid val, Guid val1) { return val == val1; }
+    public static bool Compare(GCHandle val, GCHandle val1) { return val == val1; }
+    public static bool Compare(ByteE val, ByteE val1) { return val == val1; }
+    public static bool Compare(IntE val, IntE val1) { return val == val1; }
+    public static bool Compare(LongE val, LongE val1) { return val == val1; }
+    public static bool Compare(EmptyStruct val, EmptyStruct val1) { return val.Equals(val1); }
+    public static bool Compare(NotEmptyStruct val, NotEmptyStruct val1) { return val.Field == val1.Field; }
+    public static bool Compare(NotEmptyStructQ val, NotEmptyStructQ val1) { return val.Field == val1.Field; }
+    public static bool Compare(NotEmptyStructA val, NotEmptyStructA val1) { return val.Field[0] == val1.Field[0]; }
+    public static bool Compare(NotEmptyStructQA val, NotEmptyStructQA val1) { return val.Field[0] == val1.Field[0]; }
+    public static bool Compare(EmptyStructGen<int> val, EmptyStructGen<int> val1) { return val.Equals(val1); }
+    public static bool Compare(NotEmptyStructGen<int> val, NotEmptyStructGen<int> val1) { return val.Field == val1.Field; }
+    public static bool Compare(NotEmptyStructConstrainedGen<int> val, NotEmptyStructConstrainedGen<int> val1) { return val.Field == val1.Field; }
+    public static bool Compare(NotEmptyStructConstrainedGenA<int> val, NotEmptyStructConstrainedGenA<int> val1) { return val.Field[0] == val1.Field[0]; }
+    public static bool Compare(NotEmptyStructConstrainedGenQ<int> val, NotEmptyStructConstrainedGenQ<int> val1) { return val.Field == val1.Field; }
+    public static bool Compare(NotEmptyStructConstrainedGenQA<int> val, NotEmptyStructConstrainedGenQA<int> val1) { return val.Field[0] == val1.Field[0]; }
+    public static bool Compare(NestedStruct val, NestedStruct val1) { return val.Equals(val1); }
+    public static bool Compare(NestedStructGen<int> val, NestedStructGen<int> val1) { return val.Equals(val1); }
+    public static bool Compare(ExplicitFieldOffsetStruct val, ExplicitFieldOffsetStruct val1) { return (val.Field00 == val1.Field00) && (val.Field15 == val1.Field15); }
+    public static bool Compare(MarshalAsStruct val, MarshalAsStruct val1) { return val.Equals(val1); }
+    public static bool Compare(ImplementOneInterface val, ImplementOneInterface val1) { return (val is IEmpty) && val.Equals(val1); }
+    public static bool Compare(ImplementTwoInterface val, ImplementTwoInterface val1) { return (val is IEmpty) && val is INotEmpty && val.Equals(val1); }
+    public static bool Compare(ImplementOneInterfaceGen<int> val, ImplementOneInterfaceGen<int> val1) { return val is IEmptyGen<int> && val.Equals(val1); }
+    public static bool Compare(ImplementTwoInterfaceGen<int> val, ImplementTwoInterfaceGen<int> val1) { return val is IEmptyGen<int> && val is INotEmptyGen<int> && val.Equals(val1); }
+    public static bool Compare(ImplementAllInterface<int> val, ImplementAllInterface<int> val1) { return val is IEmpty && val is INotEmpty && val is IEmptyGen<int> && val is INotEmptyGen<int> && val.Equals(val1); }
+    public static bool Compare(WithMultipleGCHandleStruct val, WithMultipleGCHandleStruct val1)
+    { return val.H1 == val1.H1 && val.H2 == val1.H2 && val.H3 == val1.H3 && val.H4 == val1.H4 && val.H5 == val1.H5; }
+    public static bool Compare(WithOnlyFXTypeStruct val, WithOnlyFXTypeStruct val1) { return val.GUID == val1.GUID && val.DECIMAL == val1.DECIMAL; }
+    public static bool Compare(MixedAllStruct val, MixedAllStruct val1)
+    {
+        return val.INT == val1.INT &&
+        val.IntQ == val1.IntQ &&
+        val.IntQA[0] == val1.IntQA[0] &&
+        val.STRING == val1.STRING &&
+        val.INTE == val1.INTE &&
+        val.EMPTYCLASS.Equals(val1.EMPTYCLASS) &&
+        val.IEMPTY.Equals(val1.IEMPTY) &&
+        Compare(val.EMPTYSTRUCT, val1.EMPTYSTRUCT) &&
+        val.IEMPTYGEN.Equals(val1.IEMPTYGEN) &&
+        Compare(val.EMPTYSTRUCTGEN, val1.EMPTYSTRUCTGEN) &&
+        Compare(val.WITHONLYFXTYPESTRUCT, val1.WITHONLYFXTYPESTRUCT) &&
+       Compare(val.GCHANDLE, val1.GCHANDLE);
+    }
+
+    public static bool Compare(char? val, char val1) { return Compare(val.Value, val1); }
+    public static bool Compare(bool? val, bool val1) { return Compare(val.Value, val1); }
+    public static bool Compare(byte? val, byte val1) { return Compare(val.Value, val1); }
+    public static bool Compare(sbyte? val, sbyte val1) { return Compare(val.Value, val1); }
+    public static bool Compare(short? val, short val1) { return Compare(val.Value, val1); }
+    public static bool Compare(ushort? val, ushort val1) { return Compare(val.Value, val1); }
+    public static bool Compare(int? val, int val1) { return Compare(val.Value, val1); }
+    public static bool Compare(uint? val, uint val1) { return Compare(val.Value, val1); }
+    public static bool Compare(long? val, long val1) { return Compare(val.Value, val1); }
+    public static bool Compare(ulong? val, ulong val1) { return Compare(val.Value, val1); }
+    public static bool Compare(float? val, float val1) { return Compare(val.Value, val1); }
+    public static bool Compare(double? val, double val1) { return Compare(val.Value, val1); }
+    public static bool Compare(decimal? val, decimal val1) { return Compare(val.Value, val1); }
+
+    public static bool Compare(IntPtr? val, IntPtr val1) { return Compare(val.Value, val1); }
+    public static bool Compare(UIntPtr? val, UIntPtr val1) { return Compare(val.Value, val1); }
+    public static bool Compare(Guid? val, Guid val1) { return Compare(val.Value, val1); }
+    public static bool Compare(GCHandle? val, GCHandle val1) { return Compare(val.Value, val1); }
+    public static bool Compare(ByteE? val, ByteE val1) { return Compare(val.Value, val1); }
+    public static bool Compare(IntE? val, IntE val1) { return Compare(val.Value, val1); }
+    public static bool Compare(LongE? val, LongE val1) { return Compare(val.Value, val1); }
+    public static bool Compare(EmptyStruct? val, EmptyStruct val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStruct? val, NotEmptyStruct val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructQ? val, NotEmptyStructQ val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructA? val, NotEmptyStructA val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructQA? val, NotEmptyStructQA val1) { return Compare(val.Value, val1); }
+    public static bool Compare(EmptyStructGen<int>? val, EmptyStructGen<int> val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructGen<int>? val, NotEmptyStructGen<int> val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructConstrainedGen<int>? val, NotEmptyStructConstrainedGen<int> val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructConstrainedGenA<int>? val, NotEmptyStructConstrainedGenA<int> val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructConstrainedGenQ<int>? val, NotEmptyStructConstrainedGenQ<int> val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NotEmptyStructConstrainedGenQA<int>? val, NotEmptyStructConstrainedGenQA<int> val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NestedStruct? val, NestedStruct val1) { return Compare(val.Value, val1); }
+    public static bool Compare(NestedStructGen<int>? val, NestedStructGen<int> val1) { return Compare(val.Value, val1); }
+    public static bool Compare(ExplicitFieldOffsetStruct? val, ExplicitFieldOffsetStruct val1) { return Compare(val.Value, val1); }
+    public static bool Compare(MarshalAsStruct? val, MarshalAsStruct val1) { return Compare(val.Value, val1); }
+    public static bool Compare(ImplementOneInterface? val, ImplementOneInterface val1) { return Compare(val.Value, val1); }
+    public static bool Compare(ImplementTwoInterface? val, ImplementTwoInterface val1) { return Compare(val.Value, val1); }
+    public static bool Compare(ImplementOneInterfaceGen<int>? val, ImplementOneInterfaceGen<int> val1) { return Compare(val.Value, val1); }
+    public static bool Compare(ImplementTwoInterfaceGen<int>? val, ImplementTwoInterfaceGen<int> val1) { return Compare(val.Value, val1); }
+    public static bool Compare(ImplementAllInterface<int>? val, ImplementAllInterface<int> val1) { return Compare(val.Value, val1); }
+    public static bool Compare(WithMultipleGCHandleStruct? val, WithMultipleGCHandleStruct val1) { return Compare(val.Value, val1); }
+    public static bool Compare(WithOnlyFXTypeStruct? val, WithOnlyFXTypeStruct val1) { return Compare(val.Value, val1); }
+    public static bool Compare(MixedAllStruct? val, MixedAllStruct val1) { return Compare(val.Value, val1); }
+}