Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPU: Array size at most max signed int + 1 #3077

Merged
merged 3 commits into from
Dec 3, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Avoid character range in Googletest RegEx matcher
  • Loading branch information
dneto0 committed Nov 29, 2019
commit be6f9430c666206e6c10639172b7c1cb44c50807
14 changes: 7 additions & 7 deletions test/val/val_id_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,12 +847,12 @@ TEST_P(OpTypeArrayLengthTest, LengthZero) {
EXPECT_EQ(
SPV_ERROR_INVALID_ID,
Val(CompileSuccessfully(MakeArrayLength("0", kSigned, width)),
"OpTypeArray Length <id> '[0-9]\\[%.*\\]' default value must be at "
"OpTypeArray Length <id> '3\\[%.*\\]' default value must be at "
"least 1."));
EXPECT_EQ(
SPV_ERROR_INVALID_ID,
Val(CompileSuccessfully(MakeArrayLength("0", kUnsigned, width)),
"OpTypeArray Length <id> '[0-9]\\[%.*\\]' default value must be at "
"OpTypeArray Length <id> '3\\[%.*\\]' default value must be at "
"least 1."));
}

Expand All @@ -861,23 +861,23 @@ TEST_P(OpTypeArrayLengthTest, LengthNegative) {
EXPECT_EQ(
SPV_ERROR_INVALID_ID,
Val(CompileSuccessfully(MakeArrayLength("-1", kSigned, width)),
"OpTypeArray Length <id> '[0-9]\\[%.*\\]' default value must be at "
"OpTypeArray Length <id> '3\\[%.*\\]' default value must be at "
"least 1."));
EXPECT_EQ(
SPV_ERROR_INVALID_ID,
Val(CompileSuccessfully(MakeArrayLength("-2", kSigned, width)),
"OpTypeArray Length <id> '[0-9]\\[%.*\\]' default value must be at "
"OpTypeArray Length <id> '3\\[%.*\\]' default value must be at "
"least 1."));
EXPECT_EQ(
SPV_ERROR_INVALID_ID,
Val(CompileSuccessfully(MakeArrayLength("-123", kSigned, width)),
"OpTypeArray Length <id> '[0-9]\\[%.*\\]' default value must be at "
"OpTypeArray Length <id> '3\\[%.*\\]' default value must be at "
"least 1."));
const std::string neg_max = "0x8" + std::string(width / 4 - 1, '0');
EXPECT_EQ(
SPV_ERROR_INVALID_ID,
Val(CompileSuccessfully(MakeArrayLength(neg_max, kSigned, width)),
"OpTypeArray Length <id> '[0-9]\\[%.*\\]' default value must be at "
"OpTypeArray Length <id> '3\\[%.*\\]' default value must be at "
"least 1."));
}

Expand Down Expand Up @@ -943,7 +943,7 @@ TEST_P(OpTypeArrayLengthTest, LengthPositiveHugeEnding1InWebGPU) {
EXPECT_EQ(
SPV_ERROR_INVALID_ID,
Val(module,
"OpTypeArray Length <id> '[0-9]\\[%.*\\]' size exceeds max value "
"OpTypeArray Length <id> '3\\[%.*\\]' size exceeds max value "
"2147483648 permitted by WebGPU: got 2147483649"));
}

Expand Down