@@ -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 ();
@@ -152,7 +152,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseDTClausesTest) {
152
152
153
153
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
154
154
SmallVector<RootElement> Elements;
155
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
155
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
156
+ *PP);
156
157
157
158
// Test no diagnostics produced
158
159
Consumer->setNoDiag ();
@@ -255,7 +256,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseStaticSamplerTest) {
255
256
256
257
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
257
258
SmallVector<RootElement> Elements;
258
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
259
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
260
+ *PP);
259
261
260
262
// Test no diagnostics produced
261
263
Consumer->setNoDiag ();
@@ -340,7 +342,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseFloatsTest) {
340
342
341
343
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
342
344
SmallVector<RootElement> Elements;
343
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
345
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
346
+ *PP);
344
347
345
348
// Test no diagnostics produced
346
349
Consumer->setNoDiag ();
@@ -415,7 +418,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidSamplerFlagsTest) {
415
418
416
419
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
417
420
SmallVector<RootElement> Elements;
418
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
421
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
422
+ *PP);
419
423
420
424
// Test no diagnostics produced
421
425
Consumer->setNoDiag ();
@@ -446,7 +450,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootConsantsTest) {
446
450
447
451
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
448
452
SmallVector<RootElement> Elements;
449
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
453
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
454
+ *PP);
450
455
451
456
// Test no diagnostics produced
452
457
Consumer->setNoDiag ();
@@ -503,7 +508,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootFlagsTest) {
503
508
504
509
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
505
510
SmallVector<RootElement> Elements;
506
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
511
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
512
+ *PP);
507
513
508
514
// Test no diagnostics produced
509
515
Consumer->setNoDiag ();
@@ -556,7 +562,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootDescriptorsTest) {
556
562
557
563
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
558
564
SmallVector<RootElement> Elements;
559
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
565
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
566
+ *PP);
560
567
561
568
// Test no diagnostics produced
562
569
Consumer->setNoDiag ();
@@ -630,7 +637,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidTrailingCommaTest) {
630
637
631
638
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
632
639
SmallVector<RootElement> Elements;
633
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
640
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
641
+ *PP);
634
642
635
643
// Test no diagnostics produced
636
644
Consumer->setNoDiag ();
@@ -661,8 +669,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidVersion10Test) {
661
669
662
670
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
663
671
SmallVector<RootElement> Elements;
664
- auto Version = llvm::dxbc:: RootSignatureVersion::V1_0;
665
- hlsl::RootSignatureParser Parser (Version, Elements, Lexer, *PP);
672
+ hlsl::RootSignatureParser Parser ( RootSignatureVersion::V1_0, Elements, Lexer,
673
+ *PP);
666
674
667
675
// Test no diagnostics produced
668
676
Consumer->setNoDiag ();
@@ -733,8 +741,8 @@ TEST_F(ParseHLSLRootSignatureTest, ValidVersion11Test) {
733
741
734
742
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
735
743
SmallVector<RootElement> Elements;
736
- auto Version = llvm::dxbc:: RootSignatureVersion::V1_1;
737
- hlsl::RootSignatureParser Parser (Version, Elements, Lexer, *PP);
744
+ hlsl::RootSignatureParser Parser ( RootSignatureVersion::V1_1, Elements, Lexer,
745
+ *PP);
738
746
739
747
// Test no diagnostics produced
740
748
Consumer->setNoDiag ();
@@ -800,7 +808,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseUnexpectedTokenTest) {
800
808
801
809
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
802
810
SmallVector<RootElement> Elements;
803
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
811
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
812
+ *PP);
804
813
805
814
// Test correct diagnostic produced
806
815
Consumer->setExpected (diag::err_hlsl_unexpected_end_of_params);
@@ -820,7 +829,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseInvalidTokenTest) {
820
829
821
830
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
822
831
SmallVector<RootElement> Elements;
823
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
832
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
833
+ *PP);
824
834
825
835
// Test correct diagnostic produced - invalid token
826
836
Consumer->setExpected (diag::err_hlsl_unexpected_end_of_params);
@@ -840,7 +850,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseUnexpectedEndOfStreamTest) {
840
850
841
851
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
842
852
SmallVector<RootElement> Elements;
843
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
853
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
854
+ *PP);
844
855
845
856
// Test correct diagnostic produced - end of stream
846
857
Consumer->setExpected (diag::err_expected_after);
@@ -865,7 +876,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingDTParameterTest) {
865
876
866
877
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
867
878
SmallVector<RootElement> Elements;
868
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
879
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
880
+ *PP);
869
881
870
882
// Test correct diagnostic produced
871
883
Consumer->setExpected (diag::err_hlsl_rootsig_missing_param);
@@ -887,7 +899,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingRDParameterTest) {
887
899
888
900
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
889
901
SmallVector<RootElement> Elements;
890
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
902
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
903
+ *PP);
891
904
892
905
// Test correct diagnostic produced
893
906
Consumer->setExpected (diag::err_hlsl_rootsig_missing_param);
@@ -909,7 +922,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingRCParameterTest) {
909
922
910
923
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
911
924
SmallVector<RootElement> Elements;
912
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
925
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
926
+ *PP);
913
927
914
928
// Test correct diagnostic produced
915
929
Consumer->setExpected (diag::err_hlsl_rootsig_missing_param);
@@ -933,7 +947,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryDTParameterTest) {
933
947
934
948
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
935
949
SmallVector<RootElement> Elements;
936
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
950
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
951
+ *PP);
937
952
938
953
// Test correct diagnostic produced
939
954
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -955,7 +970,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryRCParameterTest) {
955
970
956
971
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
957
972
SmallVector<RootElement> Elements;
958
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
973
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
974
+ *PP);
959
975
960
976
// Test correct diagnostic produced
961
977
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -979,7 +995,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedOptionalDTParameterTest) {
979
995
980
996
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
981
997
SmallVector<RootElement> Elements;
982
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
998
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
999
+ *PP);
983
1000
984
1001
// Test correct diagnostic produced
985
1002
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -1005,7 +1022,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedOptionalRCParameterTest) {
1005
1022
1006
1023
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1007
1024
SmallVector<RootElement> Elements;
1008
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1025
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1026
+ *PP);
1009
1027
1010
1028
// Test correct diagnostic produced
1011
1029
Consumer->setExpected (diag::err_hlsl_rootsig_repeat_param);
@@ -1028,7 +1046,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedNumberTest) {
1028
1046
1029
1047
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1030
1048
SmallVector<RootElement> Elements;
1031
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1049
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1050
+ *PP);
1032
1051
1033
1052
// Test correct diagnostic produced
1034
1053
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -1050,7 +1069,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseOverflowedNegativeNumberTest) {
1050
1069
1051
1070
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1052
1071
SmallVector<RootElement> Elements;
1053
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1072
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1073
+ *PP);
1054
1074
1055
1075
// Test correct diagnostic produced
1056
1076
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -1071,7 +1091,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedFloatTest) {
1071
1091
1072
1092
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1073
1093
SmallVector<RootElement> Elements;
1074
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1094
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1095
+ *PP);
1075
1096
1076
1097
// Test correct diagnostic produced
1077
1098
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -1092,7 +1113,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexNegOverflowedFloatTest) {
1092
1113
1093
1114
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1094
1115
SmallVector<RootElement> Elements;
1095
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1116
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1117
+ *PP);
1096
1118
1097
1119
// Test correct diagnostic produced
1098
1120
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -1113,7 +1135,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedDoubleTest) {
1113
1135
1114
1136
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1115
1137
SmallVector<RootElement> Elements;
1116
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1138
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1139
+ *PP);
1117
1140
1118
1141
// Test correct diagnostic produced
1119
1142
Consumer->setExpected (diag::err_hlsl_number_literal_overflow);
@@ -1134,7 +1157,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexUnderflowFloatTest) {
1134
1157
1135
1158
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1136
1159
SmallVector<RootElement> Elements;
1137
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1160
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1161
+ *PP);
1138
1162
1139
1163
// Test correct diagnostic produced
1140
1164
Consumer->setExpected (diag::err_hlsl_number_literal_underflow);
@@ -1158,7 +1182,8 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidNonZeroFlagsTest) {
1158
1182
1159
1183
hlsl::RootSignatureLexer Lexer (Source, TokLoc);
1160
1184
SmallVector<RootElement> Elements;
1161
- hlsl::RootSignatureParser Parser (DefVersion, Elements, Lexer, *PP);
1185
+ hlsl::RootSignatureParser Parser (RootSignatureVersion::V1_1, Elements, Lexer,
1186
+ *PP);
1162
1187
1163
1188
// Test correct diagnostic produced
1164
1189
Consumer->setExpected (diag::err_hlsl_rootsig_non_zero_flag);
0 commit comments