@@ -29,6 +29,9 @@ using namespace llvm::hlsl::rootsig;
29
29
30
30
namespace {
31
31
32
+ static const llvm::dxbc::RootSignatureVersion DefVersion =
33
+ llvm::dxbc::RootSignatureVersion::V1_1;
34
+
32
35
// Diagnostic helper for helper tests
33
36
class ExpectedDiagConsumer : public DiagnosticConsumer {
34
37
virtual void anchor () {}
@@ -115,7 +118,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseEmptyTest) {
115
118
116
119
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
117
120
SmallVector<RootElement> Elements;
118
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
121
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
119
122
120
123
// Test no diagnostics produced
121
124
Consumer->setNoDiag ();
@@ -148,7 +151,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseDTClausesTest) {
148
151
149
152
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
150
153
SmallVector<RootElement> Elements;
151
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
154
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
152
155
153
156
// Test no diagnostics produced
154
157
Consumer->setNoDiag ();
@@ -244,7 +247,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseStaticSamplerTest) {
244
247
245
248
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
246
249
SmallVector<RootElement> Elements;
247
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
250
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
248
251
249
252
// Test no diagnostics produced
250
253
Consumer->setNoDiag ();
@@ -318,7 +321,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseFloatsTest) {
318
321
319
322
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
320
323
SmallVector<RootElement> Elements;
321
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
324
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
322
325
323
326
// Test no diagnostics produced
324
327
Consumer->setNoDiag ();
@@ -393,7 +396,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidSamplerFlagsTest) {
393
396
394
397
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
395
398
SmallVector<RootElement> Elements;
396
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
399
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
397
400
398
401
// Test no diagnostics produced
399
402
Consumer->setNoDiag ();
@@ -423,7 +426,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootConsantsTest) {
423
426
424
427
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
425
428
SmallVector<RootElement> Elements;
426
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
429
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
427
430
428
431
// Test no diagnostics produced
429
432
Consumer->setNoDiag ();
@@ -477,7 +480,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootFlagsTest) {
477
480
478
481
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
479
482
SmallVector<RootElement> Elements;
480
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
483
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
481
484
482
485
// Test no diagnostics produced
483
486
Consumer->setNoDiag ();
@@ -517,7 +520,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootDescriptorsTest) {
517
520
518
521
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
519
522
SmallVector<RootElement> Elements;
520
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
523
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
521
524
522
525
// Test no diagnostics produced
523
526
Consumer->setNoDiag ();
@@ -585,7 +588,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidTrailingCommaTest) {
585
588
586
589
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
587
590
SmallVector<RootElement> Elements;
588
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
591
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
589
592
590
593
// Test no diagnostics produced
591
594
Consumer->setNoDiag ();
@@ -609,7 +612,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseUnexpectedTokenTest) {
609
612
610
613
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
611
614
SmallVector<RootElement> Elements;
612
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
615
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
613
616
614
617
// Test correct diagnostic produced
615
618
Consumer->setExpected (diag::err_hlsl_unexpected_end_of_params);
@@ -629,7 +632,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseInvalidTokenTest) {
629
632
630
633
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
631
634
SmallVector<RootElement> Elements;
632
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
635
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
633
636
634
637
// Test correct diagnostic produced - invalid token
635
638
Consumer->setExpected (diag::err_hlsl_unexpected_end_of_params);
@@ -649,7 +652,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseUnexpectedEndOfStreamTest) {
649
652
650
653
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
651
654
SmallVector<RootElement> Elements;
652
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
655
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
653
656
654
657
// Test correct diagnostic produced - end of stream
655
658
Consumer->setExpected (diag::err_expected_after);
@@ -674,7 +677,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingDTParameterTest) {
674
677
675
678
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
676
679
SmallVector<RootElement> Elements;
677
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
680
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
678
681
679
682
// Test correct diagnostic produced
680
683
Consumer->setExpected (diag::err_hlsl_rootsig_missing_param);
@@ -696,7 +699,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingRDParameterTest) {
696
699
697
700
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
698
701
SmallVector<RootElement> Elements;
699
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
702
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
700
703
701
704
// Test correct diagnostic produced
702
705
Consumer->setExpected (diag::err_hlsl_rootsig_missing_param);
@@ -718,7 +721,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingRCParameterTest) {
718
721
719
722
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
720
723
SmallVector<RootElement> Elements;
721
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
724
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
722
725
723
726
// Test correct diagnostic produced
724
727
Consumer->setExpected (diag::err_hlsl_rootsig_missing_param);
@@ -742,7 +745,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryDTParameterTest) {
742
745
743
746
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
744
747
SmallVector<RootElement> Elements;
745
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
748
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
746
749
747
750
// Test correct diagnostic produced
748
751
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -764,7 +767,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryRCParameterTest) {
764
767
765
768
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
766
769
SmallVector<RootElement> Elements;
767
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
770
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
768
771
769
772
// Test correct diagnostic produced
770
773
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -788,7 +791,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedOptionalDTParameterTest) {
788
791
789
792
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
790
793
SmallVector<RootElement> Elements;
791
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
794
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
792
795
793
796
// Test correct diagnostic produced
794
797
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -814,7 +817,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedOptionalRCParameterTest) {
814
817
815
818
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
816
819
SmallVector<RootElement> Elements;
817
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
820
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
818
821
819
822
// Test correct diagnostic produced
820
823
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -837,7 +840,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedNumberTest) {
837
840
838
841
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
839
842
SmallVector<RootElement> Elements;
840
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
843
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
841
844
842
845
// Test correct diagnostic produced
843
846
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -859,7 +862,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseOverflowedNegativeNumberTest) {
859
862
860
863
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
861
864
SmallVector<RootElement> Elements;
862
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
865
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
863
866
864
867
// Test correct diagnostic produced
865
868
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -880,7 +883,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedFloatTest) {
880
883
881
884
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
882
885
SmallVector<RootElement> Elements;
883
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
886
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
884
887
885
888
// Test correct diagnostic produced
886
889
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -901,7 +904,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexNegOverflowedFloatTest) {
901
904
902
905
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
903
906
SmallVector<RootElement> Elements;
904
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
907
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
905
908
906
909
// Test correct diagnostic produced
907
910
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -922,7 +925,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedDoubleTest) {
922
925
923
926
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
924
927
SmallVector<RootElement> Elements;
925
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
928
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
926
929
927
930
// Test correct diagnostic produced
928
931
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -943,7 +946,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexUnderflowFloatTest) {
943
946
944
947
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
945
948
SmallVector<RootElement> Elements;
946
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
949
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
947
950
948
951
// Test correct diagnostic produced
949
952
Consumer->setExpected (diag::err_hlsl_number_literal_underflow);
@@ -967,7 +970,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidNonZeroFlagsTest) {
967
970
968
971
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
969
972
SmallVector<RootElement> Elements;
970
- hlsl::RootSignatureParser Parser (Elements, Lexer, *PP);
973
+ hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
971
974
972
975
// Test correct diagnostic produced
973
976
Consumer->setExpected (diag::err_hlsl_rootsig_non_zero_flag);
0 commit comments