Skip to content

Commit 1642bc9

Browse files
committed
update uses in testcases
1 parent f27909f commit 1642bc9

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ using namespace llvm::hlsl::rootsig;
2929

3030
namespace {
3131

32+
static const llvm::dxbc::RootSignatureVersion DefVersion =
33+
llvm::dxbc::RootSignatureVersion::V1_1;
34+
3235
// Diagnostic helper for helper tests
3336
class ExpectedDiagConsumer : public DiagnosticConsumer {
3437
virtual void anchor() {}
@@ -115,7 +118,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseEmptyTest) {
115118

116119
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
117120
SmallVector<RootElement> Elements;
118-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
121+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
119122

120123
// Test no diagnostics produced
121124
Consumer->setNoDiag();
@@ -148,7 +151,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseDTClausesTest) {
148151

149152
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
150153
SmallVector<RootElement> Elements;
151-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
154+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
152155

153156
// Test no diagnostics produced
154157
Consumer->setNoDiag();
@@ -244,7 +247,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseStaticSamplerTest) {
244247

245248
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
246249
SmallVector<RootElement> Elements;
247-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
250+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
248251

249252
// Test no diagnostics produced
250253
Consumer->setNoDiag();
@@ -318,7 +321,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseFloatsTest) {
318321

319322
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
320323
SmallVector<RootElement> Elements;
321-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
324+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
322325

323326
// Test no diagnostics produced
324327
Consumer->setNoDiag();
@@ -393,7 +396,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidSamplerFlagsTest) {
393396

394397
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
395398
SmallVector<RootElement> Elements;
396-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
399+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
397400

398401
// Test no diagnostics produced
399402
Consumer->setNoDiag();
@@ -423,7 +426,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootConsantsTest) {
423426

424427
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
425428
SmallVector<RootElement> Elements;
426-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
429+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
427430

428431
// Test no diagnostics produced
429432
Consumer->setNoDiag();
@@ -477,7 +480,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootFlagsTest) {
477480

478481
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
479482
SmallVector<RootElement> Elements;
480-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
483+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
481484

482485
// Test no diagnostics produced
483486
Consumer->setNoDiag();
@@ -517,7 +520,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidParseRootDescriptorsTest) {
517520

518521
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
519522
SmallVector<RootElement> Elements;
520-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
523+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
521524

522525
// Test no diagnostics produced
523526
Consumer->setNoDiag();
@@ -585,7 +588,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidTrailingCommaTest) {
585588

586589
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
587590
SmallVector<RootElement> Elements;
588-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
591+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
589592

590593
// Test no diagnostics produced
591594
Consumer->setNoDiag();
@@ -609,7 +612,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseUnexpectedTokenTest) {
609612

610613
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
611614
SmallVector<RootElement> Elements;
612-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
615+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
613616

614617
// Test correct diagnostic produced
615618
Consumer->setExpected(diag::err_hlsl_unexpected_end_of_params);
@@ -629,7 +632,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseInvalidTokenTest) {
629632

630633
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
631634
SmallVector<RootElement> Elements;
632-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
635+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
633636

634637
// Test correct diagnostic produced - invalid token
635638
Consumer->setExpected(diag::err_hlsl_unexpected_end_of_params);
@@ -649,7 +652,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseUnexpectedEndOfStreamTest) {
649652

650653
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
651654
SmallVector<RootElement> Elements;
652-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
655+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
653656

654657
// Test correct diagnostic produced - end of stream
655658
Consumer->setExpected(diag::err_expected_after);
@@ -674,7 +677,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingDTParameterTest) {
674677

675678
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
676679
SmallVector<RootElement> Elements;
677-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
680+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
678681

679682
// Test correct diagnostic produced
680683
Consumer->setExpected(diag::err_hlsl_rootsig_missing_param);
@@ -696,7 +699,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingRDParameterTest) {
696699

697700
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
698701
SmallVector<RootElement> Elements;
699-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
702+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
700703

701704
// Test correct diagnostic produced
702705
Consumer->setExpected(diag::err_hlsl_rootsig_missing_param);
@@ -718,7 +721,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidMissingRCParameterTest) {
718721

719722
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
720723
SmallVector<RootElement> Elements;
721-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
724+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
722725

723726
// Test correct diagnostic produced
724727
Consumer->setExpected(diag::err_hlsl_rootsig_missing_param);
@@ -742,7 +745,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryDTParameterTest) {
742745

743746
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
744747
SmallVector<RootElement> Elements;
745-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
748+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
746749

747750
// Test correct diagnostic produced
748751
Consumer->setExpected(diag::err_hlsl_rootsig_repeat_param);
@@ -764,7 +767,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedMandatoryRCParameterTest) {
764767

765768
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
766769
SmallVector<RootElement> Elements;
767-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
770+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
768771

769772
// Test correct diagnostic produced
770773
Consumer->setExpected(diag::err_hlsl_rootsig_repeat_param);
@@ -788,7 +791,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedOptionalDTParameterTest) {
788791

789792
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
790793
SmallVector<RootElement> Elements;
791-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
794+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
792795

793796
// Test correct diagnostic produced
794797
Consumer->setExpected(diag::err_hlsl_rootsig_repeat_param);
@@ -814,7 +817,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidRepeatedOptionalRCParameterTest) {
814817

815818
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
816819
SmallVector<RootElement> Elements;
817-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
820+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
818821

819822
// Test correct diagnostic produced
820823
Consumer->setExpected(diag::err_hlsl_rootsig_repeat_param);
@@ -837,7 +840,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedNumberTest) {
837840

838841
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
839842
SmallVector<RootElement> Elements;
840-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
843+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
841844

842845
// Test correct diagnostic produced
843846
Consumer->setExpected(diag::err_hlsl_number_literal_overflow);
@@ -859,7 +862,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidParseOverflowedNegativeNumberTest) {
859862

860863
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
861864
SmallVector<RootElement> Elements;
862-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
865+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
863866

864867
// Test correct diagnostic produced
865868
Consumer->setExpected(diag::err_hlsl_number_literal_overflow);
@@ -880,7 +883,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedFloatTest) {
880883

881884
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
882885
SmallVector<RootElement> Elements;
883-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
886+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
884887

885888
// Test correct diagnostic produced
886889
Consumer->setExpected(diag::err_hlsl_number_literal_overflow);
@@ -901,7 +904,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexNegOverflowedFloatTest) {
901904

902905
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
903906
SmallVector<RootElement> Elements;
904-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
907+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
905908

906909
// Test correct diagnostic produced
907910
Consumer->setExpected(diag::err_hlsl_number_literal_overflow);
@@ -922,7 +925,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedDoubleTest) {
922925

923926
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
924927
SmallVector<RootElement> Elements;
925-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
928+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
926929

927930
// Test correct diagnostic produced
928931
Consumer->setExpected(diag::err_hlsl_number_literal_overflow);
@@ -943,7 +946,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexUnderflowFloatTest) {
943946

944947
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
945948
SmallVector<RootElement> Elements;
946-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
949+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
947950

948951
// Test correct diagnostic produced
949952
Consumer->setExpected(diag::err_hlsl_number_literal_underflow);
@@ -967,7 +970,7 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidNonZeroFlagsTest) {
967970

968971
hlsl::RootSignatureLexer Lexer(Source, TokLoc);
969972
SmallVector<RootElement> Elements;
970-
hlsl::RootSignatureParser Parser(Elements, Lexer, *PP);
973+
hlsl::RootSignatureParser Parser(DefVersion, Elements, Lexer, *PP);
971974

972975
// Test correct diagnostic produced
973976
Consumer->setExpected(diag::err_hlsl_rootsig_non_zero_flag);

llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ TEST(HLSLRootSignatureTest, DescriptorCBVClauseDump) {
1717
DescriptorTableClause Clause;
1818
Clause.Type = ClauseType::CBuffer;
1919
Clause.Reg = {RegisterType::BReg, 0};
20-
Clause.setDefaultFlags();
20+
Clause.setDefaultFlags(llvm::dxbc::RootSignatureVersion::V1_1);
2121

2222
std::string Out;
2323
llvm::raw_string_ostream OS(Out);
@@ -112,7 +112,7 @@ TEST(HLSLRootSignatureTest, RootCBVDump) {
112112
RootDescriptor Descriptor;
113113
Descriptor.Type = DescriptorType::CBuffer;
114114
Descriptor.Reg = {RegisterType::BReg, 0};
115-
Descriptor.setDefaultFlags();
115+
Descriptor.setDefaultFlags(llvm::dxbc::RootSignatureVersion::V1_1);
116116

117117
std::string Out;
118118
llvm::raw_string_ostream OS(Out);

0 commit comments

Comments
 (0)