@@ -377,7 +377,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseUnexpectedEndOfStreamTest) {
377377 ASSERT_TRUE (Consumer->isSatisfied ());
378378}
379379
380- TEST_F (ParseHLSLRootSignatureTest, InvalidMissingParameterTest ) {
380+ TEST_F (ParseHLSLRootSignatureTest, InvalidMissingDTParameterTest ) {
381381 // This test will check that the parsing fails due a mandatory
382382 // parameter (register) not being specified
383383 const llvm::StringLiteral Source = R"cc(
@@ -401,6 +401,28 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingParameterTest) {
401401 ASSERT_TRUE (Consumer->isSatisfied ());
402402}
403403
404+ TEST_F (ParseHLSLRootSignatureTest, InvalidMissingRCParameterTest) {
405+ // This test will check that the parsing fails due a mandatory
406+ // parameter (num32BitConstants) not being specified
407+ const llvm::StringLiteral Source = R"cc(
408+ RootConstants(b0)
409+ )cc" ;
410+
411+ TrivialModuleLoader ModLoader;
412+ auto PP = createPP (Source, ModLoader);
413+ auto TokLoc = SourceLocation ();
414+
415+ hlsl::RootSignatureLexer Lexer (Source, TokLoc);
416+ SmallVector<RootElement> Elements;
417+ hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
418+
419+ // Test correct diagnostic produced
420+ Consumer->setExpected (diag::err_hlsl_rootsig_missing_param);
421+ ASSERT_TRUE (Parser.parse ());
422+
423+ ASSERT_TRUE (Consumer->isSatisfied ());
424+ }
425+
404426TEST_F (ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryDTParameterTest) {
405427 // This test will check that the parsing fails due the same mandatory
406428 // parameter being specified multiple times
0 commit comments