@@ -136,32 +136,32 @@ TEST_F(ParseHLSLRootSignatureTest, ValidLexNumbersTest) {
136136
137137 SmallVector<hlsl::RootSignatureToken> Tokens;
138138 SmallVector<hlsl::TokenKind> Expected = {
139- hlsl::TokenKind::int_literal,
140- hlsl::TokenKind::int_literal,
141- hlsl::TokenKind::int_literal,
139+ hlsl::TokenKind::pu_minus, hlsl::TokenKind:: int_literal,
140+ hlsl::TokenKind::int_literal, hlsl::TokenKind::pu_plus,
141+ hlsl::TokenKind::int_literal, hlsl::TokenKind::pu_plus,
142142 hlsl::TokenKind::int_literal,
143143 };
144144 CheckTokens (Lexer, Tokens, Expected);
145145 ASSERT_TRUE (Consumer->IsSatisfied ());
146146
147- // Sample negative int
148- hlsl::RootSignatureToken IntToken = Tokens[0 ];
149- ASSERT_TRUE (IntToken.NumLiteral .getInt ().isSigned ());
150- ASSERT_EQ (IntToken.NumLiteral .getInt ().getExtValue (), - 42 );
147+ // // Sample negative: int component
148+ hlsl::RootSignatureToken IntToken = Tokens[1 ];
149+ ASSERT_FALSE (IntToken.NumLiteral .getInt ().isSigned ());
150+ ASSERT_EQ (IntToken.NumLiteral .getInt ().getExtValue (), 42 );
151151
152152 // Sample unsigned int
153- IntToken = Tokens[1 ];
153+ IntToken = Tokens[2 ];
154154 ASSERT_FALSE (IntToken.NumLiteral .getInt ().isSigned ());
155155 ASSERT_EQ (IntToken.NumLiteral .getInt ().getExtValue (), 42 );
156156
157- // Sample positive int that is treated as unsigned
158- IntToken = Tokens[2 ];
157+ // Sample positive: int component
158+ IntToken = Tokens[4 ];
159159 ASSERT_FALSE (IntToken.NumLiteral .getInt ().isSigned ());
160160 ASSERT_EQ (IntToken.NumLiteral .getInt ().getExtValue (), 42 );
161161
162162 // Sample positive int that would overflow the signed representation but
163163 // is treated as an unsigned integer instead
164- IntToken = Tokens[3 ];
164+ IntToken = Tokens[6 ];
165165 ASSERT_FALSE (IntToken.NumLiteral .getInt ().isSigned ());
166166 ASSERT_EQ (IntToken.NumLiteral .getInt ().getExtValue (), 2147483648 );
167167}
@@ -174,7 +174,7 @@ TEST_F(ParseHLSLRootSignatureTest, ValidLexAllTokensTest) {
174174
175175 b0 t43 u987 s234
176176
177- (),|=
177+ (),|=+-
178178
179179 DescriptorTable
180180
@@ -286,25 +286,6 @@ TEST_F(ParseHLSLRootSignatureTest, InvalidLexOverflowedNumberTest) {
286286 ASSERT_TRUE (Consumer->IsSatisfied ());
287287}
288288
289- TEST_F (ParseHLSLRootSignatureTest, InvalidLexEmptyNumberTest) {
290- // This test will check that the lexing fails due to no integer being provided
291- const llvm::StringLiteral Source = R"cc(
292- -
293- )cc" ;
294-
295- TrivialModuleLoader ModLoader;
296- auto PP = CreatePP (Source, ModLoader);
297- auto TokLoc = SourceLocation ();
298-
299- // Test correct diagnostic produced
300- Consumer->SetExpected (diag::err_hlsl_expected_number_literal);
301-
302- hlsl::RootSignatureLexer Lexer (Source, TokLoc, *PP);
303-
304- ASSERT_TRUE (Lexer.ConsumeToken ());
305- ASSERT_TRUE (Consumer->IsSatisfied ());
306- }
307-
308289TEST_F (ParseHLSLRootSignatureTest, InvalidLexRegNumberTest) {
309290 // This test will check that the lexing fails due to no integer being provided
310291 const llvm::StringLiteral Source = R"cc(
0 commit comments