@@ -377,7 +377,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseUnexpectedEndOfStreamTest) {
377
377
ASSERT_TRUE (Consumer->isSatisfied ());
378
378
}
379
379
380
- TEST_F (ParseHLSLRootSignatureTest, InvalidMissingParameterTest ) {
380
+ TEST_F (ParseHLSLRootSignatureTest, InvalidMissingDTParameterTest ) {
381
381
// This test will check that the parsing fails due a mandatory
382
382
// parameter (register) not being specified
383
383
const llvm::StringLiteral Source = R"cc(
@@ -401,6 +401,28 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingParameterTest) {
401
401
ASSERT_TRUE (Consumer->isSatisfied ());
402
402
}
403
403
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
+
404
426
TEST_F (ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryDTParameterTest) {
405
427
// This test will check that the parsing fails due the same mandatory
406
428
// parameter being specified multiple times
0 commit comments