@@ -401,7 +401,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingParameterTest) {
401
401
ASSERT_TRUE (Consumer->isSatisfied ());
402
402
}
403
403
404
- TEST_F (ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryParameterTest ) {
404
+ TEST_F (ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryDTParameterTest ) {
405
405
// This test will check that the parsing fails due the same mandatory
406
406
// parameter being specified multiple times
407
407
const llvm::StringLiteral Source = R"cc(
@@ -425,6 +425,28 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryParameterTest) {
425
425
ASSERT_TRUE (Consumer->isSatisfied ());
426
426
}
427
427
428
+ TEST_F (ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryRCParameterTest) {
429
+ // This test will check that the parsing fails due the same mandatory
430
+ // parameter being specified multiple times
431
+ const llvm::StringLiteral Source = R"cc(
432
+ RootConstants(num32BitConstants = 32, num32BitConstants = 24)
433
+ )cc" ;
434
+
435
+ TrivialModuleLoader ModLoader;
436
+ auto PP = createPP (Source, ModLoader);
437
+ auto TokLoc = SourceLocation ();
438
+
439
+ hlsl::RootSignatureLexer Lexer (Source, TokLoc);
440
+ SmallVector<RootElement> Elements;
441
+ hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
442
+
443
+ // Test correct diagnostic produced
444
+ Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
445
+ ASSERT_TRUE (Parser.parse ());
446
+
447
+ ASSERT_TRUE (Consumer->isSatisfied ());
448
+ }
449
+
428
450
TEST_F (ParseHLSLRootSignatureTest, InvalidRepeatedOptionalParameterTest) {
429
451
// This test will check that the parsing fails due the same optional
430
452
// parameter being specified multiple times
0 commit comments