@@ -298,6 +298,7 @@ class ValidationTest : public ::testing::Test {
298298 TEST_METHOD (ValidatePrintfNotAllowed)
299299
300300 TEST_METHOD (ValidateVersionNotAllowed)
301+ TEST_METHOD (CreateHandleNotAllowedSM66)
301302
302303 dxc::DxcDllSupport m_dllSupport;
303304 VersionSupportInfo m_ver;
@@ -3858,3 +3859,18 @@ TEST_F(ValidationTest, ValidateVersionNotAllowed) {
38583859 (" = !{i32 1, i32 " + higherDxilMinor + " }" ).c_str (),
38593860 (" error: Dxil version in metadata (1." + higherDxilMinor + " ) is not supported; maximum: (1." + maxDxilMinor + " )" ).c_str ());
38603861}
3862+
3863+ TEST_F (ValidationTest, CreateHandleNotAllowedSM66) {
3864+ if (m_ver.SkipDxilVersion (1 , 6 )) return ;
3865+ RewriteAssemblyCheckMsg (L" ..\\ CodeGenHLSL\\ basic.hlsl" , " ps_6_5" ,
3866+ {" = !{i32 1, i32 5}" , " = !{!\" ps\" , i32 6, i32 5}" },
3867+ {" = !{i32 1, i32 6}" , " = !{!\" ps\" , i32 6, i32 6}" },
3868+ " opcode 'CreateHandle' should only be used in 'Shader model 6.5 and below'" );
3869+ RewriteAssemblyCheckMsg (L" ..\\ CodeGenHLSL\\ basic.hlsl" , " lib_6_5" ,
3870+ {" call %dx.types.Handle @\" dx.op.createHandleForLib.class.Buffer<vector<float, 4> >\"\\ (i32 160, %\" class.Buffer<vector<float, 4> >\" %[0-9]+\\ )" ,
3871+ " declare %dx.types.Handle @\" dx.op.createHandleForLib.class.Buffer<vector<float, 4> >\"\\ (i32, %\" class.Buffer<vector<float, 4> >\"\\ ) #1" },
3872+ {" call %dx.types.Handle @dx.op.createHandle(i32 57, i8 0, i32 0, i32 0, i1 false)" ,
3873+ " declare %dx.types.Handle @dx.op.createHandle(i32, i8, i32, i32, i1) #1" },
3874+ " opcode 'CreateHandle' should only be used in 'non-library targets'" ,
3875+ true );
3876+ }
0 commit comments