@@ -29,8 +29,7 @@ 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;
32
+ using llvm::dxbc::RootSignatureVersion;
34
33
35
34
// Diagnostic helper for helper tests
36
35
class ExpectedDiagConsumer : public DiagnosticConsumer {
@@ -118,7 +117,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseEmptyTest) {
118
117
119
118
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
120
119
SmallVector<RootElement> Elements;
121
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
120
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
121
+ *PP);
122
122
123
123
// Test no diagnostics produced
124
124
Consumer->setNoDiag ();
@@ -151,7 +151,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseDTClausesTest) {
151
151
152
152
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
153
153
SmallVector<RootElement> Elements;
154
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
154
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
155
+ *PP);
155
156
156
157
// Test no diagnostics produced
157
158
Consumer->setNoDiag ();
@@ -249,7 +250,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseStaticSamplerTest) {
249
250
250
251
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
251
252
SmallVector<RootElement> Elements;
252
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
253
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
254
+ *PP);
253
255
254
256
// Test no diagnostics produced
255
257
Consumer->setNoDiag ();
@@ -334,7 +336,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseFloatsTest) {
334
336
335
337
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
336
338
SmallVector<RootElement> Elements;
337
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
339
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
340
+ *PP);
338
341
339
342
// Test no diagnostics produced
340
343
Consumer->setNoDiag ();
@@ -409,7 +412,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidSamplerFlagsTest) {
409
412
410
413
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
411
414
SmallVector<RootElement> Elements;
412
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
415
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
416
+ *PP);
413
417
414
418
// Test no diagnostics produced
415
419
Consumer->setNoDiag ();
@@ -439,7 +443,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootConsantsTest) {
439
443
440
444
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
441
445
SmallVector<RootElement> Elements;
442
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
446
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
447
+ *PP);
443
448
444
449
// Test no diagnostics produced
445
450
Consumer->setNoDiag ();
@@ -495,7 +500,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootFlagsTest) {
495
500
496
501
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
497
502
SmallVector<RootElement> Elements;
498
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
503
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
504
+ *PP);
499
505
500
506
// Test no diagnostics produced
501
507
Consumer->setNoDiag ();
@@ -536,7 +542,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootDescriptorsTest) {
536
542
537
543
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
538
544
SmallVector<RootElement> Elements;
539
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
545
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
546
+ *PP);
540
547
541
548
// Test no diagnostics produced
542
549
Consumer->setNoDiag ();
@@ -608,7 +615,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidTrailingCommaTest) {
608
615
609
616
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
610
617
SmallVector<RootElement> Elements;
611
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
618
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
619
+ *PP);
612
620
613
621
// Test no diagnostics produced
614
622
Consumer->setNoDiag ();
@@ -639,8 +647,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidVersion10Test) {
639
647
640
648
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
641
649
SmallVector<RootElement> Elements;
642
- auto Version = llvm::dxbc:: RootSignatureVersion::V1_0;
643
- hlsl::RootSignatureParser Parser (Version, Elements, Lexer, *PP);
650
+ hlsl::RootSignatureParser Parser ( RootSignatureVersion::V1_0, Elements, Lexer,
651
+ *PP);
644
652
645
653
// Test no diagnostics produced
646
654
Consumer->setNoDiag ();
@@ -711,8 +719,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidVersion11Test) {
711
719
712
720
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
713
721
SmallVector<RootElement> Elements;
714
- auto Version = llvm::dxbc:: RootSignatureVersion::V1_1;
715
- hlsl::RootSignatureParser Parser (Version, Elements, Lexer, *PP);
722
+ hlsl::RootSignatureParser Parser ( RootSignatureVersion::V1_1, Elements, Lexer,
723
+ *PP);
716
724
717
725
// Test no diagnostics produced
718
726
Consumer->setNoDiag ();
@@ -778,7 +786,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseUnexpectedTokenTest) {
778
786
779
787
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
780
788
SmallVector<RootElement> Elements;
781
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
789
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
790
+ *PP);
782
791
783
792
// Test correct diagnostic produced
784
793
Consumer->setExpected (diag::err_hlsl_unexpected_end_of_params);
@@ -798,7 +807,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseInvalidTokenTest) {
798
807
799
808
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
800
809
SmallVector<RootElement> Elements;
801
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
810
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
811
+ *PP);
802
812
803
813
// Test correct diagnostic produced - invalid token
804
814
Consumer->setExpected (diag::err_hlsl_unexpected_end_of_params);
@@ -818,7 +828,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseUnexpectedEndOfStreamTest) {
818
828
819
829
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
820
830
SmallVector<RootElement> Elements;
821
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
831
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
832
+ *PP);
822
833
823
834
// Test correct diagnostic produced - end of stream
824
835
Consumer->setExpected (diag::err_expected_after);
@@ -843,7 +854,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingDTParameterTest) {
843
854
844
855
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
845
856
SmallVector<RootElement> Elements;
846
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
857
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
858
+ *PP);
847
859
848
860
// Test correct diagnostic produced
849
861
Consumer->setExpected (diag::err_hlsl_rootsig_missing_param);
@@ -865,7 +877,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingRDParameterTest) {
865
877
866
878
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
867
879
SmallVector<RootElement> Elements;
868
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
880
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
881
+ *PP);
869
882
870
883
// Test correct diagnostic produced
871
884
Consumer->setExpected (diag::err_hlsl_rootsig_missing_param);
@@ -887,7 +900,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingRCParameterTest) {
887
900
888
901
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
889
902
SmallVector<RootElement> Elements;
890
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
903
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
904
+ *PP);
891
905
892
906
// Test correct diagnostic produced
893
907
Consumer->setExpected (diag::err_hlsl_rootsig_missing_param);
@@ -911,7 +925,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryDTParameterTest) {
911
925
912
926
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
913
927
SmallVector<RootElement> Elements;
914
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
928
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
929
+ *PP);
915
930
916
931
// Test correct diagnostic produced
917
932
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -933,7 +948,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryRCParameterTest) {
933
948
934
949
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
935
950
SmallVector<RootElement> Elements;
936
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
951
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
952
+ *PP);
937
953
938
954
// Test correct diagnostic produced
939
955
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -957,7 +973,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedOptionalDTParameterTest) {
957
973
958
974
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
959
975
SmallVector<RootElement> Elements;
960
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
976
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
977
+ *PP);
961
978
962
979
// Test correct diagnostic produced
963
980
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -983,7 +1000,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedOptionalRCParameterTest) {
983
1000
984
1001
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
985
1002
SmallVector<RootElement> Elements;
986
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1003
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1004
+ *PP);
987
1005
988
1006
// Test correct diagnostic produced
989
1007
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -1006,7 +1024,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedNumberTest) {
1006
1024
1007
1025
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1008
1026
SmallVector<RootElement> Elements;
1009
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1027
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1028
+ *PP);
1010
1029
1011
1030
// Test correct diagnostic produced
1012
1031
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -1028,7 +1047,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseOverflowedNegativeNumberTest) {
1028
1047
1029
1048
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1030
1049
SmallVector<RootElement> Elements;
1031
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1050
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1051
+ *PP);
1032
1052
1033
1053
// Test correct diagnostic produced
1034
1054
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -1049,7 +1069,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedFloatTest) {
1049
1069
1050
1070
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1051
1071
SmallVector<RootElement> Elements;
1052
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1072
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1073
+ *PP);
1053
1074
1054
1075
// Test correct diagnostic produced
1055
1076
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -1070,7 +1091,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexNegOverflowedFloatTest) {
1070
1091
1071
1092
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1072
1093
SmallVector<RootElement> Elements;
1073
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1094
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1095
+ *PP);
1074
1096
1075
1097
// Test correct diagnostic produced
1076
1098
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -1091,7 +1113,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedDoubleTest) {
1091
1113
1092
1114
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1093
1115
SmallVector<RootElement> Elements;
1094
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1116
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1117
+ *PP);
1095
1118
1096
1119
// Test correct diagnostic produced
1097
1120
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -1112,7 +1135,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexUnderflowFloatTest) {
1112
1135
1113
1136
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1114
1137
SmallVector<RootElement> Elements;
1115
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1138
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1139
+ *PP);
1116
1140
1117
1141
// Test correct diagnostic produced
1118
1142
Consumer->setExpected (diag::err_hlsl_number_literal_underflow);
@@ -1136,7 +1160,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidNonZeroFlagsTest) {
1136
1160
1137
1161
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1138
1162
SmallVector<RootElement> Elements;
1139
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1163
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1164
+ *PP);
1140
1165
1141
1166
// Test correct diagnostic produced
1142
1167
Consumer->setExpected (diag::err_hlsl_rootsig_non_zero_flag);
0 commit comments