Run formatter
TBR=dneto@google.com Change-Id: Idccbc5eeec6d763cdacd8d050bb396a0c897c7ca Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/19400 Reviewed-by: dan sinclair <dsinclair@google.com>
This commit is contained in:
parent
fa3944c3dd
commit
b39dabd0cd
|
@ -12,12 +12,11 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/reader/spirv/function.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "gmock/gmock.h"
|
#include "gmock/gmock.h"
|
||||||
|
#include "src/reader/spirv/function.h"
|
||||||
#include "src/reader/spirv/parser_impl.h"
|
#include "src/reader/spirv/parser_impl.h"
|
||||||
#include "src/reader/spirv/parser_impl_test_helper.h"
|
#include "src/reader/spirv/parser_impl_test_helper.h"
|
||||||
#include "src/reader/spirv/spirv_tools_helpers_test.h"
|
#include "src/reader/spirv/spirv_tools_helpers_test.h"
|
||||||
|
@ -137,50 +136,38 @@ TEST_P(SpvBinaryTest, EmitExpression) {
|
||||||
<< "\n " << GetParam().ast_rhs;
|
<< "\n " << GetParam().ast_rhs;
|
||||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(ss.str())) << assembly;
|
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(ss.str())) << assembly;
|
||||||
}
|
}
|
||||||
INSTANTIATE_TEST_SUITE_P(SpvParserTest,
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
SpvBinaryTest,
|
SpvParserTest,
|
||||||
::testing::Values(
|
SpvBinaryTest,
|
||||||
// Both uint
|
::testing::Values(
|
||||||
BinaryData{
|
// Both uint
|
||||||
"uint", "uint_10", "OpIAdd", "uint_20", "__u32",
|
BinaryData{"uint", "uint_10", "OpIAdd", "uint_20", "__u32",
|
||||||
"ScalarConstructor{10}", "add",
|
"ScalarConstructor{10}", "add", "ScalarConstructor{20}"},
|
||||||
"ScalarConstructor{20}"},
|
// Both int
|
||||||
// Both int
|
BinaryData{"int", "int_30", "OpIAdd", "int_40", "__i32",
|
||||||
BinaryData{
|
"ScalarConstructor{30}", "add", "ScalarConstructor{40}"},
|
||||||
"int", "int_30", "OpIAdd", "int_40", "__i32",
|
// Mixed, returning uint
|
||||||
"ScalarConstructor{30}", "add",
|
BinaryData{"uint", "int_30", "OpIAdd", "uint_10", "__u32",
|
||||||
"ScalarConstructor{40}"},
|
"ScalarConstructor{30}", "add", "ScalarConstructor{10}"},
|
||||||
// Mixed, returning uint
|
// Mixed, returning int
|
||||||
BinaryData{
|
BinaryData{"int", "int_30", "OpIAdd", "uint_10", "__i32",
|
||||||
"uint", "int_30", "OpIAdd", "uint_10", "__u32",
|
"ScalarConstructor{30}", "add", "ScalarConstructor{10}"},
|
||||||
"ScalarConstructor{30}", "add",
|
// Both v2uint
|
||||||
"ScalarConstructor{10}"},
|
BinaryData{"v2uint", "v2uint_10_20", "OpIAdd", "v2uint_20_10",
|
||||||
// Mixed, returning int
|
"__vec_2__u32", AstFor("v2uint_10_20"), "add",
|
||||||
BinaryData{
|
AstFor("v2uint_20_10")},
|
||||||
"int", "int_30", "OpIAdd", "uint_10", "__i32",
|
// Both v2int
|
||||||
"ScalarConstructor{30}", "add",
|
BinaryData{"v2int", "v2int_30_40", "OpIAdd", "v2int_40_30",
|
||||||
"ScalarConstructor{10}"},
|
"__vec_2__i32", AstFor("v2int_30_40"), "add",
|
||||||
// Both v2uint
|
AstFor("v2int_40_30")},
|
||||||
BinaryData{
|
// Mixed, returning v2uint
|
||||||
"v2uint", "v2uint_10_20", "OpIAdd", "v2uint_20_10", "__vec_2__u32",
|
BinaryData{"v2uint", "v2int_30_40", "OpIAdd", "v2uint_10_20",
|
||||||
AstFor("v2uint_10_20"), "add",
|
"__vec_2__u32", AstFor("v2int_30_40"), "add",
|
||||||
AstFor("v2uint_20_10")},
|
AstFor("v2uint_10_20")},
|
||||||
// Both v2int
|
// Mixed, returning v2int
|
||||||
BinaryData{
|
BinaryData{"v2int", "v2int_40_30", "OpIAdd", "v2uint_20_10",
|
||||||
"v2int", "v2int_30_40", "OpIAdd", "v2int_40_30", "__vec_2__i32",
|
"__vec_2__i32", AstFor("v2int_40_30"), "add",
|
||||||
AstFor("v2int_30_40"), "add",
|
AstFor("v2uint_20_10")}));
|
||||||
AstFor("v2int_40_30")},
|
|
||||||
// Mixed, returning v2uint
|
|
||||||
BinaryData{
|
|
||||||
"v2uint", "v2int_30_40", "OpIAdd", "v2uint_10_20", "__vec_2__u32",
|
|
||||||
AstFor("v2int_30_40"), "add",
|
|
||||||
AstFor("v2uint_10_20")},
|
|
||||||
// Mixed, returning v2int
|
|
||||||
BinaryData{
|
|
||||||
"v2int", "v2int_40_30", "OpIAdd", "v2uint_20_10", "__vec_2__i32",
|
|
||||||
AstFor("v2int_40_30"), "add",
|
|
||||||
AstFor("v2uint_20_10")}
|
|
||||||
));
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
} // namespace spirv
|
} // namespace spirv
|
||||||
|
|
|
@ -12,12 +12,11 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "src/reader/spirv/function.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "gmock/gmock.h"
|
#include "gmock/gmock.h"
|
||||||
|
#include "src/reader/spirv/function.h"
|
||||||
#include "src/reader/spirv/parser_impl.h"
|
#include "src/reader/spirv/parser_impl.h"
|
||||||
#include "src/reader/spirv/parser_impl_test_helper.h"
|
#include "src/reader/spirv/parser_impl_test_helper.h"
|
||||||
#include "src/reader/spirv/spirv_tools_helpers_test.h"
|
#include "src/reader/spirv/spirv_tools_helpers_test.h"
|
||||||
|
|
|
@ -15,20 +15,20 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
#include "src/ast/binary_expression.h"
|
||||||
#include "src/ast/float_literal.h"
|
#include "src/ast/float_literal.h"
|
||||||
#include "src/ast/identifier_expression.h"
|
#include "src/ast/identifier_expression.h"
|
||||||
|
#include "src/ast/int_literal.h"
|
||||||
#include "src/ast/scalar_constructor_expression.h"
|
#include "src/ast/scalar_constructor_expression.h"
|
||||||
#include "src/ast/type/i32_type.h"
|
|
||||||
#include "src/ast/type/f32_type.h"
|
#include "src/ast/type/f32_type.h"
|
||||||
#include "src/context.h"
|
#include "src/ast/type/i32_type.h"
|
||||||
#include "src/type_determiner.h"
|
|
||||||
#include "src/ast/type/vector_type.h"
|
#include "src/ast/type/vector_type.h"
|
||||||
#include "src/ast/type_constructor_expression.h"
|
#include "src/ast/type_constructor_expression.h"
|
||||||
#include "src/ast/variable.h"
|
#include "src/ast/variable.h"
|
||||||
#include "src/ast/int_literal.h"
|
#include "src/context.h"
|
||||||
|
#include "src/type_determiner.h"
|
||||||
#include "src/writer/spirv/builder.h"
|
#include "src/writer/spirv/builder.h"
|
||||||
#include "src/writer/spirv/spv_dump.h"
|
#include "src/writer/spirv/spv_dump.h"
|
||||||
#include "src/ast/binary_expression.h"
|
|
||||||
|
|
||||||
namespace tint {
|
namespace tint {
|
||||||
namespace writer {
|
namespace writer {
|
||||||
|
@ -185,7 +185,7 @@ TEST_F(BuilderTest, IdentifierExpression_NoLoadConst) {
|
||||||
|
|
||||||
ast::Variable var("var", ast::StorageClass::kNone, &i32);
|
ast::Variable var("var", ast::StorageClass::kNone, &i32);
|
||||||
var.set_constructor(std::make_unique<ast::ScalarConstructorExpression>(
|
var.set_constructor(std::make_unique<ast::ScalarConstructorExpression>(
|
||||||
std::make_unique<ast::IntLiteral>(&i32, 2)));
|
std::make_unique<ast::IntLiteral>(&i32, 2)));
|
||||||
var.set_is_const(true);
|
var.set_is_const(true);
|
||||||
|
|
||||||
td.RegisterVariableForTesting(&var);
|
td.RegisterVariableForTesting(&var);
|
||||||
|
|
Loading…
Reference in New Issue