mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 02:39:11 +00:00
[ast] Add the result_type into the AST dump
This CL adds the result_type type_name into the AST dump if available. Bug: tint:310, tint:308 Change-Id: Iea678fd4f7a2dadbfca86f29043c75459c421cb3 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/32780 Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com> Commit-Queue: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
112314b73d
commit
80598edf78
@@ -68,54 +68,54 @@ std::string CommonTypes() {
|
||||
// Returns the AST dump for a given SPIR-V assembly constant.
|
||||
std::string AstFor(std::string assembly) {
|
||||
if (assembly == "v2uint_10_20") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
})";
|
||||
}
|
||||
if (assembly == "v2uint_20_10") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
})";
|
||||
}
|
||||
if (assembly == "v2int_30_40") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
})";
|
||||
}
|
||||
if (assembly == "v2int_40_30") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
})";
|
||||
}
|
||||
if (assembly == "cast_int_v2uint_10_20") {
|
||||
return R"(Bitcast<__vec_2__i32>{
|
||||
TypeConstructor{
|
||||
return R"(Bitcast[not set]<__vec_2__i32>{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
}
|
||||
})";
|
||||
}
|
||||
if (assembly == "v2float_50_60") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
})";
|
||||
}
|
||||
if (assembly == "v2float_60_50") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
})";
|
||||
}
|
||||
return "bad case";
|
||||
@@ -141,9 +141,9 @@ TEST_F(SpvUnaryArithTest, SNegate_Int_Int) {
|
||||
none
|
||||
__i32
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
negation
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor[not set]{30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -168,10 +168,10 @@ TEST_F(SpvUnaryArithTest, SNegate_Int_Uint) {
|
||||
none
|
||||
__i32
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
negation
|
||||
Bitcast<__i32>{
|
||||
ScalarConstructor{10}
|
||||
Bitcast[not set]<__i32>{
|
||||
ScalarConstructor[not set]{10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,10 +197,10 @@ TEST_F(SpvUnaryArithTest, SNegate_Uint_Int) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Bitcast<__u32>{
|
||||
UnaryOp{
|
||||
Bitcast[not set]<__u32>{
|
||||
UnaryOp[not set]{
|
||||
negation
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor[not set]{30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -226,11 +226,11 @@ TEST_F(SpvUnaryArithTest, SNegate_Uint_Uint) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Bitcast<__u32>{
|
||||
UnaryOp{
|
||||
Bitcast[not set]<__u32>{
|
||||
UnaryOp[not set]{
|
||||
negation
|
||||
Bitcast<__i32>{
|
||||
ScalarConstructor{10}
|
||||
Bitcast[not set]<__i32>{
|
||||
ScalarConstructor[not set]{10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,12 +257,12 @@ TEST_F(SpvUnaryArithTest, SNegate_SignedVec_SignedVec) {
|
||||
none
|
||||
__vec_2__i32
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
negation
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,13 +288,13 @@ TEST_F(SpvUnaryArithTest, SNegate_SignedVec_UnsignedVec) {
|
||||
none
|
||||
__vec_2__i32
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
negation
|
||||
Bitcast<__vec_2__i32>{
|
||||
TypeConstructor{
|
||||
Bitcast[not set]<__vec_2__i32>{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -321,13 +321,13 @@ TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_SignedVec) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
Bitcast<__vec_2__u32>{
|
||||
UnaryOp{
|
||||
Bitcast[not set]<__vec_2__u32>{
|
||||
UnaryOp[not set]{
|
||||
negation
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,14 +354,14 @@ TEST_F(SpvUnaryArithTest, SNegate_UnsignedVec_UnsignedVec) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
Bitcast<__vec_2__u32>{
|
||||
UnaryOp{
|
||||
Bitcast[not set]<__vec_2__u32>{
|
||||
UnaryOp[not set]{
|
||||
negation
|
||||
Bitcast<__vec_2__i32>{
|
||||
TypeConstructor{
|
||||
Bitcast[not set]<__vec_2__i32>{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -389,9 +389,9 @@ TEST_F(SpvUnaryArithTest, FNegate_Scalar) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
negation
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -416,12 +416,12 @@ TEST_F(SpvUnaryArithTest, FNegate_Vector) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
negation
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -471,7 +471,7 @@ TEST_P(SpvBinaryArithTest, EmitExpression) {
|
||||
x_1
|
||||
none
|
||||
)"
|
||||
<< GetParam().ast_type << "\n {\n Binary{"
|
||||
<< GetParam().ast_type << "\n {\n Binary[not set]{"
|
||||
<< "\n " << GetParam().ast_lhs << "\n " << GetParam().ast_op
|
||||
<< "\n " << GetParam().ast_rhs;
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(ss.str())) << assembly;
|
||||
@@ -483,16 +483,20 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpIAdd", "uint_20", "__u32",
|
||||
"ScalarConstructor{10}", "add", "ScalarConstructor{20}"},
|
||||
"ScalarConstructor[not set]{10}", "add",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpIAdd", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "add", "ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "add",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Mixed, returning uint
|
||||
BinaryData{"uint", "int_30", "OpIAdd", "uint_10", "__u32",
|
||||
"ScalarConstructor{30}", "add", "ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "add",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Mixed, returning int
|
||||
BinaryData{"int", "int_30", "OpIAdd", "uint_10", "__i32",
|
||||
"ScalarConstructor{30}", "add", "ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "add",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpIAdd", "v2uint_20_10",
|
||||
"__vec_2__u32", AstFor("v2uint_10_20"), "add",
|
||||
@@ -516,8 +520,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Scalar float
|
||||
BinaryData{"float", "float_50", "OpFAdd", "float_60", "__f32",
|
||||
"ScalarConstructor{50.000000}", "add",
|
||||
"ScalarConstructor{60.000000}"},
|
||||
"ScalarConstructor[not set]{50.000000}", "add",
|
||||
"ScalarConstructor[not set]{60.000000}"},
|
||||
// Vector float
|
||||
BinaryData{"v2float", "v2float_50_60", "OpFAdd", "v2float_60_50",
|
||||
"__vec_2__f32", AstFor("v2float_50_60"), "add",
|
||||
@@ -529,20 +533,20 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpISub", "uint_20", "__u32",
|
||||
"ScalarConstructor{10}", "subtract",
|
||||
"ScalarConstructor{20}"},
|
||||
"ScalarConstructor[not set]{10}", "subtract",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpISub", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "subtract",
|
||||
"ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "subtract",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Mixed, returning uint
|
||||
BinaryData{"uint", "int_30", "OpISub", "uint_10", "__u32",
|
||||
"ScalarConstructor{30}", "subtract",
|
||||
"ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "subtract",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Mixed, returning int
|
||||
BinaryData{"int", "int_30", "OpISub", "uint_10", "__i32",
|
||||
"ScalarConstructor{30}", "subtract",
|
||||
"ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "subtract",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpISub", "v2uint_20_10",
|
||||
"__vec_2__u32", AstFor("v2uint_10_20"), "subtract",
|
||||
@@ -566,8 +570,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Scalar float
|
||||
BinaryData{"float", "float_50", "OpFSub", "float_60", "__f32",
|
||||
"ScalarConstructor{50.000000}", "subtract",
|
||||
"ScalarConstructor{60.000000}"},
|
||||
"ScalarConstructor[not set]{50.000000}", "subtract",
|
||||
"ScalarConstructor[not set]{60.000000}"},
|
||||
// Vector float
|
||||
BinaryData{"v2float", "v2float_50_60", "OpFSub", "v2float_60_50",
|
||||
"__vec_2__f32", AstFor("v2float_50_60"), "subtract",
|
||||
@@ -579,20 +583,20 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpIMul", "uint_20", "__u32",
|
||||
"ScalarConstructor{10}", "multiply",
|
||||
"ScalarConstructor{20}"},
|
||||
"ScalarConstructor[not set]{10}", "multiply",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpIMul", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "multiply",
|
||||
"ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "multiply",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Mixed, returning uint
|
||||
BinaryData{"uint", "int_30", "OpIMul", "uint_10", "__u32",
|
||||
"ScalarConstructor{30}", "multiply",
|
||||
"ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "multiply",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Mixed, returning int
|
||||
BinaryData{"int", "int_30", "OpIMul", "uint_10", "__i32",
|
||||
"ScalarConstructor{30}", "multiply",
|
||||
"ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "multiply",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpIMul", "v2uint_20_10",
|
||||
"__vec_2__u32", AstFor("v2uint_10_20"), "multiply",
|
||||
@@ -616,8 +620,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Scalar float
|
||||
BinaryData{"float", "float_50", "OpFMul", "float_60", "__f32",
|
||||
"ScalarConstructor{50.000000}", "multiply",
|
||||
"ScalarConstructor{60.000000}"},
|
||||
"ScalarConstructor[not set]{50.000000}", "multiply",
|
||||
"ScalarConstructor[not set]{60.000000}"},
|
||||
// Vector float
|
||||
BinaryData{"v2float", "v2float_50_60", "OpFMul", "v2float_60_50",
|
||||
"__vec_2__f32", AstFor("v2float_50_60"), "multiply",
|
||||
@@ -629,7 +633,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpUDiv", "uint_20", "__u32",
|
||||
"ScalarConstructor{10}", "divide", "ScalarConstructor{20}"},
|
||||
"ScalarConstructor[not set]{10}", "divide",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpUDiv", "v2uint_20_10",
|
||||
"__vec_2__u32", AstFor("v2uint_10_20"), "divide",
|
||||
@@ -641,7 +646,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpSDiv", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "divide", "ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "divide",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Both v2int
|
||||
BinaryData{"v2int", "v2int_30_40", "OpSDiv", "v2int_40_30",
|
||||
"__vec_2__i32", AstFor("v2int_30_40"), "divide",
|
||||
@@ -653,16 +659,16 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Mixed, returning int, second arg uint
|
||||
BinaryData{"int", "int_30", "OpSDiv", "uint_10", "__i32",
|
||||
"ScalarConstructor{30}", "divide",
|
||||
R"(Bitcast<__i32>{
|
||||
ScalarConstructor{10}
|
||||
"ScalarConstructor[not set]{30}", "divide",
|
||||
R"(Bitcast[not set]<__i32>{
|
||||
ScalarConstructor[not set]{10}
|
||||
})"},
|
||||
// Mixed, returning int, first arg uint
|
||||
BinaryData{"int", "uint_10", "OpSDiv", "int_30", "__i32",
|
||||
R"(Bitcast<__i32>{
|
||||
ScalarConstructor{10}
|
||||
R"(Bitcast[not set]<__i32>{
|
||||
ScalarConstructor[not set]{10}
|
||||
})",
|
||||
"divide", "ScalarConstructor{30}"},
|
||||
"divide", "ScalarConstructor[not set]{30}"},
|
||||
// Mixed, returning v2int, first arg v2uint
|
||||
BinaryData{"v2int", "v2uint_10_20", "OpSDiv", "v2int_30_40",
|
||||
"__vec_2__i32", AstFor("cast_int_v2uint_10_20"), "divide",
|
||||
@@ -696,11 +702,11 @@ TEST_F(SpvBinaryArithTestBasic, SDiv_Scalar_UnsignedResult) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Bitcast<__u32>{
|
||||
Binary{
|
||||
ScalarConstructor{30}
|
||||
Bitcast[not set]<__u32>{
|
||||
Binary[not set]{
|
||||
ScalarConstructor[not set]{30}
|
||||
divide
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{40}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -731,18 +737,18 @@ TEST_F(SpvBinaryArithTestBasic, SDiv_Vector_UnsignedResult) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
Bitcast<__vec_2__u32>{
|
||||
Binary{
|
||||
TypeConstructor{
|
||||
Bitcast[not set]<__vec_2__u32>{
|
||||
Binary[not set]{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
}
|
||||
divide
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -757,8 +763,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Scalar float
|
||||
BinaryData{"float", "float_50", "OpFDiv", "float_60", "__f32",
|
||||
"ScalarConstructor{50.000000}", "divide",
|
||||
"ScalarConstructor{60.000000}"},
|
||||
"ScalarConstructor[not set]{50.000000}", "divide",
|
||||
"ScalarConstructor[not set]{60.000000}"},
|
||||
// Vector float
|
||||
BinaryData{"v2float", "v2float_50_60", "OpFDiv", "v2float_60_50",
|
||||
"__vec_2__f32", AstFor("v2float_50_60"), "divide",
|
||||
@@ -770,7 +776,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpUMod", "uint_20", "__u32",
|
||||
"ScalarConstructor{10}", "modulo", "ScalarConstructor{20}"},
|
||||
"ScalarConstructor[not set]{10}", "modulo",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpUMod", "v2uint_20_10",
|
||||
"__vec_2__u32", AstFor("v2uint_10_20"), "modulo",
|
||||
@@ -785,7 +792,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpSMod", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "modulo", "ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "modulo",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Both v2int
|
||||
BinaryData{"v2int", "v2int_30_40", "OpSMod", "v2int_40_30",
|
||||
"__vec_2__i32", AstFor("v2int_30_40"), "modulo",
|
||||
@@ -797,16 +805,16 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Mixed, returning int, second arg uint
|
||||
BinaryData{"int", "int_30", "OpSMod", "uint_10", "__i32",
|
||||
"ScalarConstructor{30}", "modulo",
|
||||
R"(Bitcast<__i32>{
|
||||
ScalarConstructor{10}
|
||||
"ScalarConstructor[not set]{30}", "modulo",
|
||||
R"(Bitcast[not set]<__i32>{
|
||||
ScalarConstructor[not set]{10}
|
||||
})"},
|
||||
// Mixed, returning int, first arg uint
|
||||
BinaryData{"int", "uint_10", "OpSMod", "int_30", "__i32",
|
||||
R"(Bitcast<__i32>{
|
||||
ScalarConstructor{10}
|
||||
R"(Bitcast[not set]<__i32>{
|
||||
ScalarConstructor[not set]{10}
|
||||
})",
|
||||
"modulo", "ScalarConstructor{30}"},
|
||||
"modulo", "ScalarConstructor[not set]{30}"},
|
||||
// Mixed, returning v2int, first arg v2uint
|
||||
BinaryData{"v2int", "v2uint_10_20", "OpSMod", "v2int_30_40",
|
||||
"__vec_2__i32", AstFor("cast_int_v2uint_10_20"), "modulo",
|
||||
@@ -840,11 +848,11 @@ TEST_F(SpvBinaryArithTestBasic, SMod_Scalar_UnsignedResult) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Bitcast<__u32>{
|
||||
Binary{
|
||||
ScalarConstructor{30}
|
||||
Bitcast[not set]<__u32>{
|
||||
Binary[not set]{
|
||||
ScalarConstructor[not set]{30}
|
||||
modulo
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{40}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -875,18 +883,18 @@ TEST_F(SpvBinaryArithTestBasic, SMod_Vector_UnsignedResult) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
Bitcast<__vec_2__u32>{
|
||||
Binary{
|
||||
TypeConstructor{
|
||||
Bitcast[not set]<__vec_2__u32>{
|
||||
Binary[not set]{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
}
|
||||
modulo
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -901,8 +909,8 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Scalar float
|
||||
BinaryData{"float", "float_50", "OpFMod", "float_60", "__f32",
|
||||
"ScalarConstructor{50.000000}", "modulo",
|
||||
"ScalarConstructor{60.000000}"},
|
||||
"ScalarConstructor[not set]{50.000000}", "modulo",
|
||||
"ScalarConstructor[not set]{60.000000}"},
|
||||
// Vector float
|
||||
BinaryData{"v2float", "v2float_50_60", "OpFMod", "v2float_60_50",
|
||||
"__vec_2__f32", AstFor("v2float_50_60"), "modulo",
|
||||
@@ -927,10 +935,10 @@ TEST_F(SpvBinaryArithTestBasic, VectorTimesScalar) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
Binary{
|
||||
Identifier{x_1}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
multiply
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -956,10 +964,10 @@ TEST_F(SpvBinaryArithTestBasic, MatrixTimesScalar) {
|
||||
none
|
||||
__mat_2_2__f32
|
||||
{
|
||||
Binary{
|
||||
Identifier{x_1}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
multiply
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -985,10 +993,10 @@ TEST_F(SpvBinaryArithTestBasic, VectorTimesMatrix) {
|
||||
none
|
||||
__mat_2_2__f32
|
||||
{
|
||||
Binary{
|
||||
Identifier{x_1}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
multiply
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -1014,10 +1022,10 @@ TEST_F(SpvBinaryArithTestBasic, MatrixTimesVector) {
|
||||
none
|
||||
__mat_2_2__f32
|
||||
{
|
||||
Binary{
|
||||
Identifier{x_1}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
multiply
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -1043,10 +1051,10 @@ TEST_F(SpvBinaryArithTestBasic, MatrixTimesMatrix) {
|
||||
none
|
||||
__mat_2_2__f32
|
||||
{
|
||||
Binary{
|
||||
Identifier{x_1}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
multiply
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -1072,11 +1080,11 @@ TEST_F(SpvBinaryArithTestBasic, Dot) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{dot}
|
||||
Call[not set]{
|
||||
Identifier[not set]{dot}
|
||||
(
|
||||
Identifier{x_1}
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{x_2}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1103,11 +1111,11 @@ TEST_F(SpvBinaryArithTestBasic, OuterProduct) {
|
||||
none
|
||||
__mat_2_2__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{outerProduct}
|
||||
Call[not set]{
|
||||
Identifier[not set]{outerProduct}
|
||||
(
|
||||
Identifier{x_1}
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{x_2}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,54 +63,54 @@ std::string CommonTypes() {
|
||||
// Returns the AST dump for a given SPIR-V assembly constant.
|
||||
std::string AstFor(std::string assembly) {
|
||||
if (assembly == "v2uint_10_20") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
})";
|
||||
}
|
||||
if (assembly == "v2uint_20_10") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
})";
|
||||
}
|
||||
if (assembly == "v2int_30_40") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
})";
|
||||
}
|
||||
if (assembly == "v2int_40_30") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
})";
|
||||
}
|
||||
if (assembly == "cast_int_v2uint_10_20") {
|
||||
return R"(Bitcast<__vec_2__i32>{
|
||||
TypeConstructor{
|
||||
return R"(Bitcast[not set]<__vec_2__i32>{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
}
|
||||
})";
|
||||
}
|
||||
if (assembly == "v2float_50_60") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
})";
|
||||
}
|
||||
if (assembly == "v2float_60_50") {
|
||||
return R"(TypeConstructor{
|
||||
return R"(TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
})";
|
||||
}
|
||||
return "bad case";
|
||||
@@ -160,7 +160,7 @@ TEST_P(SpvBinaryBitTest, EmitExpression) {
|
||||
x_1
|
||||
none
|
||||
)"
|
||||
<< GetParam().ast_type << "\n {\n Binary{"
|
||||
<< GetParam().ast_type << "\n {\n Binary[not set]{"
|
||||
<< "\n " << GetParam().ast_lhs << "\n " << GetParam().ast_op
|
||||
<< "\n " << GetParam().ast_rhs;
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(ss.str())) << assembly;
|
||||
@@ -172,20 +172,20 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpShiftLeftLogical", "uint_20", "__u32",
|
||||
"ScalarConstructor{10}", "shift_left",
|
||||
"ScalarConstructor{20}"},
|
||||
"ScalarConstructor[not set]{10}", "shift_left",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpShiftLeftLogical", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "shift_left",
|
||||
"ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "shift_left",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Mixed, returning uint
|
||||
BinaryData{"uint", "int_30", "OpShiftLeftLogical", "uint_10", "__u32",
|
||||
"ScalarConstructor{30}", "shift_left",
|
||||
"ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "shift_left",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Mixed, returning int
|
||||
BinaryData{"int", "int_30", "OpShiftLeftLogical", "uint_10", "__i32",
|
||||
"ScalarConstructor{30}", "shift_left",
|
||||
"ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "shift_left",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpShiftLeftLogical",
|
||||
"v2uint_20_10", "__vec_2__u32", AstFor("v2uint_10_20"),
|
||||
@@ -209,20 +209,20 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpShiftRightLogical", "uint_20", "__u32",
|
||||
"ScalarConstructor{10}", "shift_right",
|
||||
"ScalarConstructor{20}"},
|
||||
"ScalarConstructor[not set]{10}", "shift_right",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpShiftRightLogical", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "shift_right",
|
||||
"ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "shift_right",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Mixed, returning uint
|
||||
BinaryData{"uint", "int_30", "OpShiftRightLogical", "uint_10", "__u32",
|
||||
"ScalarConstructor{30}", "shift_right",
|
||||
"ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "shift_right",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Mixed, returning int
|
||||
BinaryData{"int", "int_30", "OpShiftRightLogical", "uint_10", "__i32",
|
||||
"ScalarConstructor{30}", "shift_right",
|
||||
"ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "shift_right",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpShiftRightLogical",
|
||||
"v2uint_20_10", "__vec_2__u32", AstFor("v2uint_10_20"),
|
||||
@@ -246,20 +246,20 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpShiftRightArithmetic", "uint_20",
|
||||
"__u32", "ScalarConstructor{10}", "shift_right",
|
||||
"ScalarConstructor{20}"},
|
||||
"__u32", "ScalarConstructor[not set]{10}", "shift_right",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpShiftRightArithmetic", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "shift_right",
|
||||
"ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "shift_right",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Mixed, returning uint
|
||||
BinaryData{"uint", "int_30", "OpShiftRightArithmetic", "uint_10",
|
||||
"__u32", "ScalarConstructor{30}", "shift_right",
|
||||
"ScalarConstructor{10}"},
|
||||
"__u32", "ScalarConstructor[not set]{30}", "shift_right",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Mixed, returning int
|
||||
BinaryData{"int", "int_30", "OpShiftRightArithmetic", "uint_10",
|
||||
"__i32", "ScalarConstructor{30}", "shift_right",
|
||||
"ScalarConstructor{10}"},
|
||||
"__i32", "ScalarConstructor[not set]{30}", "shift_right",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpShiftRightArithmetic",
|
||||
"v2uint_20_10", "__vec_2__u32", AstFor("v2uint_10_20"),
|
||||
@@ -283,16 +283,20 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpBitwiseAnd", "uint_20", "__u32",
|
||||
"ScalarConstructor{10}", "and", "ScalarConstructor{20}"},
|
||||
"ScalarConstructor[not set]{10}", "and",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpBitwiseAnd", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "and", "ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "and",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Mixed, returning uint
|
||||
BinaryData{"uint", "int_30", "OpBitwiseAnd", "uint_10", "__u32",
|
||||
"ScalarConstructor{30}", "and", "ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "and",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Mixed, returning int
|
||||
BinaryData{"int", "int_30", "OpBitwiseAnd", "uint_10", "__i32",
|
||||
"ScalarConstructor{30}", "and", "ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "and",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpBitwiseAnd", "v2uint_20_10",
|
||||
"__vec_2__u32", AstFor("v2uint_10_20"), "and",
|
||||
@@ -316,16 +320,20 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpBitwiseOr", "uint_20", "__u32",
|
||||
"ScalarConstructor{10}", "or", "ScalarConstructor{20}"},
|
||||
"ScalarConstructor[not set]{10}", "or",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpBitwiseOr", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "or", "ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "or",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Mixed, returning uint
|
||||
BinaryData{"uint", "int_30", "OpBitwiseOr", "uint_10", "__u32",
|
||||
"ScalarConstructor{30}", "or", "ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "or",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Mixed, returning int
|
||||
BinaryData{"int", "int_30", "OpBitwiseOr", "uint_10", "__i32",
|
||||
"ScalarConstructor{30}", "or", "ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "or",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpBitwiseOr", "v2uint_20_10",
|
||||
"__vec_2__u32", AstFor("v2uint_10_20"), "or",
|
||||
@@ -349,16 +357,20 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
::testing::Values(
|
||||
// Both uint
|
||||
BinaryData{"uint", "uint_10", "OpBitwiseXor", "uint_20", "__u32",
|
||||
"ScalarConstructor{10}", "xor", "ScalarConstructor{20}"},
|
||||
"ScalarConstructor[not set]{10}", "xor",
|
||||
"ScalarConstructor[not set]{20}"},
|
||||
// Both int
|
||||
BinaryData{"int", "int_30", "OpBitwiseXor", "int_40", "__i32",
|
||||
"ScalarConstructor{30}", "xor", "ScalarConstructor{40}"},
|
||||
"ScalarConstructor[not set]{30}", "xor",
|
||||
"ScalarConstructor[not set]{40}"},
|
||||
// Mixed, returning uint
|
||||
BinaryData{"uint", "int_30", "OpBitwiseXor", "uint_10", "__u32",
|
||||
"ScalarConstructor{30}", "xor", "ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "xor",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Mixed, returning int
|
||||
BinaryData{"int", "int_30", "OpBitwiseXor", "uint_10", "__i32",
|
||||
"ScalarConstructor{30}", "xor", "ScalarConstructor{10}"},
|
||||
"ScalarConstructor[not set]{30}", "xor",
|
||||
"ScalarConstructor[not set]{10}"},
|
||||
// Both v2uint
|
||||
BinaryData{"v2uint", "v2uint_10_20", "OpBitwiseXor", "v2uint_20_10",
|
||||
"__vec_2__u32", AstFor("v2uint_10_20"), "xor",
|
||||
@@ -394,9 +406,9 @@ TEST_F(SpvUnaryBitTest, Not_Int_Int) {
|
||||
none
|
||||
__i32
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
not
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor[not set]{30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -421,10 +433,10 @@ TEST_F(SpvUnaryBitTest, Not_Int_Uint) {
|
||||
none
|
||||
__i32
|
||||
{
|
||||
Bitcast<__i32>{
|
||||
UnaryOp{
|
||||
Bitcast[not set]<__i32>{
|
||||
UnaryOp[not set]{
|
||||
not
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor[not set]{10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -450,10 +462,10 @@ TEST_F(SpvUnaryBitTest, Not_Uint_Int) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Bitcast<__u32>{
|
||||
UnaryOp{
|
||||
Bitcast[not set]<__u32>{
|
||||
UnaryOp[not set]{
|
||||
not
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor[not set]{30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -479,9 +491,9 @@ TEST_F(SpvUnaryBitTest, Not_Uint_Uint) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
not
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor[not set]{10}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -506,12 +518,12 @@ TEST_F(SpvUnaryBitTest, Not_SignedVec_SignedVec) {
|
||||
none
|
||||
__vec_2__i32
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
not
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -537,13 +549,13 @@ TEST_F(SpvUnaryBitTest, Not_SignedVec_UnsignedVec) {
|
||||
none
|
||||
__vec_2__i32
|
||||
{
|
||||
Bitcast<__vec_2__i32>{
|
||||
UnaryOp{
|
||||
Bitcast[not set]<__vec_2__i32>{
|
||||
UnaryOp[not set]{
|
||||
not
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -570,13 +582,13 @@ TEST_F(SpvUnaryBitTest, Not_UnsignedVec_SignedVec) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
Bitcast<__vec_2__u32>{
|
||||
UnaryOp{
|
||||
Bitcast[not set]<__vec_2__u32>{
|
||||
UnaryOp[not set]{
|
||||
not
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -602,12 +614,12 @@ TEST_F(SpvUnaryBitTest, Not_UnsignedVec_UnsignedVec) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
not
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ TEST_F(SpvParserTest, EmitStatement_VoidCallNoParams) {
|
||||
Function x_100 -> __void
|
||||
()
|
||||
{
|
||||
Call{
|
||||
Identifier{x_50}
|
||||
Call[not set]{
|
||||
Identifier[not set]{x_50}
|
||||
(
|
||||
)
|
||||
}
|
||||
@@ -96,8 +96,8 @@ TEST_F(SpvParserTest, EmitStatement_ScalarCallNoParams) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Call{
|
||||
Identifier{x_50}
|
||||
Call[not set]{
|
||||
Identifier[not set]{x_50}
|
||||
(
|
||||
)
|
||||
}
|
||||
@@ -113,7 +113,7 @@ Return{})"))
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Return{
|
||||
{
|
||||
ScalarConstructor{42}
|
||||
ScalarConstructor[not set]{42}
|
||||
}
|
||||
})")) << ToString(fe.ast_body());
|
||||
}
|
||||
@@ -159,8 +159,8 @@ VariableDeclStatement{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Call{
|
||||
Identifier{x_50}
|
||||
Call[not set]{
|
||||
Identifier[not set]{x_50}
|
||||
(
|
||||
)
|
||||
}
|
||||
@@ -168,12 +168,12 @@ VariableDeclStatement{
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_10}
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_10}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_10}
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_10}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
Return{})"))
|
||||
<< ToString(fe.ast_body());
|
||||
@@ -183,7 +183,7 @@ Return{})"))
|
||||
EXPECT_TRUE(fe.EmitBody()) << p->error();
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Return{
|
||||
{
|
||||
ScalarConstructor{42}
|
||||
ScalarConstructor[not set]{42}
|
||||
}
|
||||
})")) << ToString(fe.ast_body());
|
||||
}
|
||||
@@ -232,10 +232,10 @@ TEST_F(SpvParserTest, EmitStatement_CallWithParams) {
|
||||
{
|
||||
Return{
|
||||
{
|
||||
Binary{
|
||||
Identifier{x_51}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_51}
|
||||
add
|
||||
Identifier{x_52}
|
||||
Identifier[not set]{x_52}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,11 +249,11 @@ TEST_F(SpvParserTest, EmitStatement_CallWithParams) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Call{
|
||||
Identifier{x_50}
|
||||
Call[not set]{
|
||||
Identifier[not set]{x_50}
|
||||
(
|
||||
ScalarConstructor{42}
|
||||
ScalarConstructor{84}
|
||||
ScalarConstructor[not set]{42}
|
||||
ScalarConstructor[not set]{84}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -92,10 +92,10 @@ TEST_F(SpvParserTest_Composite_Construct, Vector) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,10 +106,10 @@ VariableDeclStatement{
|
||||
none
|
||||
__vec_2__i32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor{40}
|
||||
ScalarConstructor[not set]{30}
|
||||
ScalarConstructor[not set]{40}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -120,10 +120,10 @@ VariableDeclStatement{
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,22 +148,22 @@ TEST_F(SpvParserTest_Composite_Construct, Matrix) {
|
||||
none
|
||||
__mat_2_3__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__mat_2_3__f32
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{70.000000}
|
||||
ScalarConstructor{70.000000}
|
||||
ScalarConstructor[not set]{70.000000}
|
||||
ScalarConstructor[not set]{70.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,13 +189,13 @@ TEST_F(SpvParserTest_Composite_Construct, Array) {
|
||||
none
|
||||
__array__u32_5
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_5
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor{3}
|
||||
ScalarConstructor{4}
|
||||
ScalarConstructor{5}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
ScalarConstructor[not set]{3}
|
||||
ScalarConstructor[not set]{4}
|
||||
ScalarConstructor[not set]{5}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -220,15 +220,15 @@ TEST_F(SpvParserTest_Composite_Construct, Struct) {
|
||||
none
|
||||
__struct_S
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__struct_S
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
}
|
||||
ScalarConstructor{5}
|
||||
ScalarConstructor{30}
|
||||
ScalarConstructor[not set]{5}
|
||||
ScalarConstructor[not set]{30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -255,13 +255,13 @@ TEST_F(SpvParserTest_CompositeExtract, Vector) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
MemberAccessor{
|
||||
TypeConstructor{
|
||||
MemberAccessor[not set]{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
}
|
||||
Identifier{y}
|
||||
Identifier[not set]{y}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -306,9 +306,9 @@ TEST_F(SpvParserTest_CompositeExtract, Matrix) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
ArrayAccessor{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{2}
|
||||
ArrayAccessor[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -357,12 +357,12 @@ TEST_F(SpvParserTest_CompositeExtract, Matrix_Vector) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
MemberAccessor{
|
||||
ArrayAccessor{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{2}
|
||||
MemberAccessor[not set]{
|
||||
ArrayAccessor[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
Identifier{y}
|
||||
Identifier[not set]{y}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -391,9 +391,9 @@ TEST_F(SpvParserTest_CompositeExtract, Array) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
ArrayAccessor{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{3}
|
||||
ArrayAccessor[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{3}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -442,9 +442,9 @@ TEST_F(SpvParserTest_CompositeExtract, Struct) {
|
||||
none
|
||||
__i32
|
||||
{
|
||||
MemberAccessor{
|
||||
Identifier{x_1}
|
||||
Identifier{field2}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{field2}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -484,9 +484,9 @@ TEST_F(SpvParserTest_CompositeExtract, Struct_DifferOnlyInMemberName) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
MemberAccessor{
|
||||
Identifier{x_1}
|
||||
Identifier{algo}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{algo}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -497,9 +497,9 @@ TEST_F(SpvParserTest_CompositeExtract, Struct_DifferOnlyInMemberName) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
MemberAccessor{
|
||||
Identifier{x_3}
|
||||
Identifier{rithm}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{x_3}
|
||||
Identifier[not set]{rithm}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -550,18 +550,18 @@ TEST_F(SpvParserTest_CompositeExtract, Struct_Array_Matrix_Vector) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
MemberAccessor{
|
||||
ArrayAccessor{
|
||||
ArrayAccessor{
|
||||
MemberAccessor{
|
||||
Identifier{x_1}
|
||||
Identifier{field1}
|
||||
MemberAccessor[not set]{
|
||||
ArrayAccessor[not set]{
|
||||
ArrayAccessor[not set]{
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{field1}
|
||||
}
|
||||
ScalarConstructor{2}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
Identifier{y}
|
||||
Identifier[not set]{y}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -589,7 +589,7 @@ TEST_F(SpvParserTest_CopyObject, Scalar) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{3}
|
||||
ScalarConstructor[not set]{3}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -599,7 +599,7 @@ VariableDeclStatement{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
}
|
||||
})")) << ToString(fe.ast_body());
|
||||
@@ -627,7 +627,7 @@ TEST_F(SpvParserTest_CopyObject, Pointer) {
|
||||
none
|
||||
__ptr_function__u32
|
||||
{
|
||||
Identifier{x_10}
|
||||
Identifier[not set]{x_10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -637,7 +637,7 @@ VariableDeclStatement{
|
||||
none
|
||||
__ptr_function__u32
|
||||
{
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
}
|
||||
})")) << ToString(fe.ast_body());
|
||||
@@ -666,23 +666,23 @@ TEST_F(SpvParserTest_VectorShuffle, FunctionScopeOperands_UseBoth) {
|
||||
none
|
||||
__vec_4__u32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_4__u32
|
||||
MemberAccessor{
|
||||
Identifier{x_2}
|
||||
Identifier{y}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{x_2}
|
||||
Identifier[not set]{y}
|
||||
}
|
||||
MemberAccessor{
|
||||
Identifier{x_2}
|
||||
Identifier{x}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{x_2}
|
||||
Identifier[not set]{x}
|
||||
}
|
||||
MemberAccessor{
|
||||
Identifier{x_1}
|
||||
Identifier{y}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{y}
|
||||
}
|
||||
MemberAccessor{
|
||||
Identifier{x_1}
|
||||
Identifier{x}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{x}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -708,39 +708,39 @@ TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_UseBoth) {
|
||||
none
|
||||
__vec_4__u32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_4__u32
|
||||
MemberAccessor{
|
||||
TypeConstructor{
|
||||
MemberAccessor[not set]{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{4}
|
||||
ScalarConstructor{3}
|
||||
ScalarConstructor[not set]{4}
|
||||
ScalarConstructor[not set]{3}
|
||||
}
|
||||
Identifier{y}
|
||||
Identifier[not set]{y}
|
||||
}
|
||||
MemberAccessor{
|
||||
TypeConstructor{
|
||||
MemberAccessor[not set]{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{4}
|
||||
ScalarConstructor{3}
|
||||
ScalarConstructor[not set]{4}
|
||||
ScalarConstructor[not set]{3}
|
||||
}
|
||||
Identifier{x}
|
||||
Identifier[not set]{x}
|
||||
}
|
||||
MemberAccessor{
|
||||
TypeConstructor{
|
||||
MemberAccessor[not set]{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{3}
|
||||
ScalarConstructor{4}
|
||||
ScalarConstructor[not set]{3}
|
||||
ScalarConstructor[not set]{4}
|
||||
}
|
||||
Identifier{y}
|
||||
Identifier[not set]{y}
|
||||
}
|
||||
MemberAccessor{
|
||||
TypeConstructor{
|
||||
MemberAccessor[not set]{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{3}
|
||||
ScalarConstructor{4}
|
||||
ScalarConstructor[not set]{3}
|
||||
ScalarConstructor[not set]{4}
|
||||
}
|
||||
Identifier{x}
|
||||
Identifier[not set]{x}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -767,12 +767,12 @@ TEST_F(SpvParserTest_VectorShuffle, ConstantOperands_AllOnesMapToNull) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{0}
|
||||
MemberAccessor{
|
||||
Identifier{x_1}
|
||||
Identifier{y}
|
||||
ScalarConstructor[not set]{0}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{y}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ TEST_F(SpvUnaryConversionTest, Bitcast_Scalar) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Bitcast<__u32>{
|
||||
ScalarConstructor{50.000000}
|
||||
Bitcast[not set]<__u32>{
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -114,11 +114,11 @@ TEST_F(SpvUnaryConversionTest, Bitcast_Vector) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
Bitcast<__vec_2__f32>{
|
||||
TypeConstructor{
|
||||
Bitcast[not set]<__vec_2__f32>{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{10}
|
||||
ScalarConstructor{20}
|
||||
ScalarConstructor[not set]{10}
|
||||
ScalarConstructor[not set]{20}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,9 +243,9 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Scalar_FromSigned) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__f32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -270,10 +270,10 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Scalar_FromUnsigned) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__f32
|
||||
Bitcast<__i32>{
|
||||
Identifier{x_30}
|
||||
Bitcast[not set]<__i32>{
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,9 +299,9 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Vector_FromSigned) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -326,10 +326,10 @@ TEST_F(SpvUnaryConversionTest, ConvertSToF_Vector_FromUnsigned) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
Bitcast<__vec_2__i32>{
|
||||
Identifier{x_30}
|
||||
Bitcast[not set]<__vec_2__i32>{
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -388,10 +388,10 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Scalar_FromSigned) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__f32
|
||||
Bitcast<__u32>{
|
||||
Identifier{x_30}
|
||||
Bitcast[not set]<__u32>{
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,9 +417,9 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Scalar_FromUnsigned) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__f32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -444,10 +444,10 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Vector_FromSigned) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
Bitcast<__vec_2__u32>{
|
||||
Identifier{x_30}
|
||||
Bitcast[not set]<__vec_2__u32>{
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -473,9 +473,9 @@ TEST_F(SpvUnaryConversionTest, ConvertUToF_Vector_FromUnsigned) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -534,9 +534,9 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Scalar_ToSigned) {
|
||||
none
|
||||
__i32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__i32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -561,10 +561,10 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Scalar_ToUnsigned) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Bitcast<__u32>{
|
||||
TypeConstructor{
|
||||
Bitcast[not set]<__u32>{
|
||||
TypeConstructor[not set]{
|
||||
__i32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -590,9 +590,9 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Vector_ToSigned) {
|
||||
none
|
||||
__vec_2__i32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -617,10 +617,10 @@ TEST_F(SpvUnaryConversionTest, ConvertFToS_Vector_ToUnsigned) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
Bitcast<__vec_2__u32>{
|
||||
TypeConstructor{
|
||||
Bitcast[not set]<__vec_2__u32>{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -680,10 +680,10 @@ TEST_F(SpvUnaryConversionTest, ConvertFToU_Scalar_ToSigned) {
|
||||
none
|
||||
__i32
|
||||
{
|
||||
Bitcast<__i32>{
|
||||
TypeConstructor{
|
||||
Bitcast[not set]<__i32>{
|
||||
TypeConstructor[not set]{
|
||||
__u32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -709,9 +709,9 @@ TEST_F(SpvUnaryConversionTest, ConvertFToU_Scalar_ToUnsigned) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__u32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
@@ -736,10 +736,10 @@ TEST_F(SpvUnaryConversionTest, ConvertFToU_Vector_ToSigned) {
|
||||
none
|
||||
__vec_2__i32
|
||||
{
|
||||
Bitcast<__vec_2__i32>{
|
||||
TypeConstructor{
|
||||
Bitcast[not set]<__vec_2__i32>{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -765,9 +765,9 @@ TEST_F(SpvUnaryConversionTest, ConvertFToU_Vector_ToUnsigned) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
Identifier{x_30}
|
||||
Identifier[not set]{x_30}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
|
||||
@@ -106,10 +106,11 @@ TEST_P(SpvParserTest_GlslStd450_Float_Floating, Scalar) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{)" + GetParam().wgsl_func + R"(}
|
||||
Call[not set]{
|
||||
Identifier[not set]{)" + GetParam().wgsl_func +
|
||||
R"(}
|
||||
(
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -136,13 +137,14 @@ TEST_P(SpvParserTest_GlslStd450_Float_Floating, Vector) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{)" + GetParam().wgsl_func + R"(}
|
||||
Call[not set]{
|
||||
Identifier[not set]{)" + GetParam().wgsl_func +
|
||||
R"(}
|
||||
(
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -170,11 +172,12 @@ TEST_P(SpvParserTest_GlslStd450_Float_FloatingFloating, Scalar) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{)" + GetParam().wgsl_func + R"(}
|
||||
Call[not set]{
|
||||
Identifier[not set]{)" + GetParam().wgsl_func +
|
||||
R"(}
|
||||
(
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -201,18 +204,19 @@ TEST_P(SpvParserTest_GlslStd450_Float_FloatingFloating, Vector) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{)" + GetParam().wgsl_func + R"(}
|
||||
Call[not set]{
|
||||
Identifier[not set]{)" + GetParam().wgsl_func +
|
||||
R"(}
|
||||
(
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -240,10 +244,11 @@ TEST_P(SpvParserTest_GlslStd450_Floating_Floating, Scalar) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{)" + GetParam().wgsl_func + R"(}
|
||||
Call[not set]{
|
||||
Identifier[not set]{)" + GetParam().wgsl_func +
|
||||
R"(}
|
||||
(
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -270,13 +275,14 @@ TEST_P(SpvParserTest_GlslStd450_Floating_Floating, Vector) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{)" + GetParam().wgsl_func + R"(}
|
||||
Call[not set]{
|
||||
Identifier[not set]{)" + GetParam().wgsl_func +
|
||||
R"(}
|
||||
(
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -304,11 +310,12 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloating, Scalar) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{)" + GetParam().wgsl_func + R"(}
|
||||
Call[not set]{
|
||||
Identifier[not set]{)" + GetParam().wgsl_func +
|
||||
R"(}
|
||||
(
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -335,18 +342,19 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloating, Vector) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{)" + GetParam().wgsl_func + R"(}
|
||||
Call[not set]{
|
||||
Identifier[not set]{)" + GetParam().wgsl_func +
|
||||
R"(}
|
||||
(
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -374,12 +382,13 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloatingFloating, Scalar) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{)" + GetParam().wgsl_func + R"(}
|
||||
Call[not set]{
|
||||
Identifier[not set]{)" + GetParam().wgsl_func +
|
||||
R"(}
|
||||
(
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor{70.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
ScalarConstructor[not set]{70.000000}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -407,23 +416,24 @@ TEST_P(SpvParserTest_GlslStd450_Floating_FloatingFloatingFloating, Vector) {
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
Call{
|
||||
Identifier{)" + GetParam().wgsl_func + R"(}
|
||||
Call[not set]{
|
||||
Identifier[not set]{)" + GetParam().wgsl_func +
|
||||
R"(}
|
||||
(
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{60.000000}
|
||||
ScalarConstructor{50.000000}
|
||||
ScalarConstructor[not set]{60.000000}
|
||||
ScalarConstructor[not set]{50.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{70.000000}
|
||||
ScalarConstructor{70.000000}
|
||||
ScalarConstructor[not set]{70.000000}
|
||||
ScalarConstructor[not set]{70.000000}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -51,16 +51,16 @@ TEST_F(SpvParserTest, EmitStatement_StoreBoolConst) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody()) << p->error();
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{true}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{true}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{false}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{false}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{false}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{false}
|
||||
})"));
|
||||
}
|
||||
|
||||
@@ -83,12 +83,12 @@ TEST_F(SpvParserTest, EmitStatement_StoreUintConst) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{42}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{42}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{0}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{0}
|
||||
})"));
|
||||
}
|
||||
|
||||
@@ -111,12 +111,12 @@ TEST_F(SpvParserTest, EmitStatement_StoreIntConst) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{42}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{42}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{0}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{0}
|
||||
})"));
|
||||
}
|
||||
|
||||
@@ -139,12 +139,12 @@ TEST_F(SpvParserTest, EmitStatement_StoreFloatConst) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{42.000000}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{0.000000}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
})"));
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ TEST_F(SpvParserTest, EmitStatement_LoadBool) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
})"));
|
||||
}
|
||||
@@ -202,7 +202,7 @@ TEST_F(SpvParserTest, EmitStatement_LoadScalar) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,7 +212,7 @@ VariableDeclStatement{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -243,17 +243,17 @@ TEST_F(SpvParserTest, EmitStatement_UseLoadedScalarTwice) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
)"));
|
||||
}
|
||||
@@ -275,8 +275,8 @@ TEST_F(SpvParserTest, EmitStatement_StoreToModuleScopeVar) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{42}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{42}
|
||||
})"));
|
||||
}
|
||||
|
||||
@@ -342,11 +342,11 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_VectorSwizzle) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
MemberAccessor{
|
||||
Identifier{myvar}
|
||||
Identifier{z}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
Identifier[not set]{z}
|
||||
}
|
||||
ScalarConstructor{42}
|
||||
ScalarConstructor[not set]{42}
|
||||
})")) << ToString(fe.ast_body());
|
||||
}
|
||||
|
||||
@@ -405,11 +405,11 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_VectorNonConstIndex) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
ArrayAccessor{
|
||||
Identifier{myvar}
|
||||
Identifier{x_11}
|
||||
ArrayAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
Identifier[not set]{x_11}
|
||||
}
|
||||
ScalarConstructor{42}
|
||||
ScalarConstructor[not set]{42}
|
||||
})"));
|
||||
}
|
||||
|
||||
@@ -442,16 +442,16 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_Matrix) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
ArrayAccessor{
|
||||
Identifier{myvar}
|
||||
ScalarConstructor{2}
|
||||
ArrayAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_4__f32
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
}
|
||||
})"));
|
||||
}
|
||||
@@ -485,16 +485,16 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_Array) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
ArrayAccessor{
|
||||
Identifier{myvar}
|
||||
ScalarConstructor{2}
|
||||
ArrayAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_4__f32
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
}
|
||||
})"));
|
||||
}
|
||||
@@ -527,11 +527,11 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_Struct) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
MemberAccessor{
|
||||
Identifier{myvar}
|
||||
Identifier{age}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
Identifier[not set]{age}
|
||||
}
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
})"));
|
||||
}
|
||||
|
||||
@@ -575,18 +575,18 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_Struct_DifferOnlyMemberName) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
MemberAccessor{
|
||||
Identifier{myvar}
|
||||
Identifier{age}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
Identifier[not set]{age}
|
||||
}
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
}
|
||||
Assignment{
|
||||
MemberAccessor{
|
||||
Identifier{myvar2}
|
||||
Identifier{ancientness}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{myvar2}
|
||||
Identifier[not set]{ancientness}
|
||||
}
|
||||
ScalarConstructor{420.000000}
|
||||
ScalarConstructor[not set]{420.000000}
|
||||
})")) << ToString(fe.ast_body());
|
||||
}
|
||||
|
||||
@@ -685,14 +685,14 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_Struct_RuntimeArray) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
ArrayAccessor{
|
||||
MemberAccessor{
|
||||
Identifier{myvar}
|
||||
Identifier{age}
|
||||
ArrayAccessor[not set]{
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
Identifier[not set]{age}
|
||||
}
|
||||
ScalarConstructor{2}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
})"));
|
||||
}
|
||||
|
||||
@@ -725,14 +725,14 @@ TEST_F(SpvParserTest, EmitStatement_AccessChain_Compound_Matrix_Vector) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody());
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
MemberAccessor{
|
||||
ArrayAccessor{
|
||||
Identifier{myvar}
|
||||
ScalarConstructor{2}
|
||||
MemberAccessor[not set]{
|
||||
ArrayAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
Identifier{w}
|
||||
Identifier[not set]{w}
|
||||
}
|
||||
ScalarConstructor{42.000000}
|
||||
ScalarConstructor[not set]{42.000000}
|
||||
})"));
|
||||
}
|
||||
|
||||
@@ -833,21 +833,21 @@ TEST_F(SpvParserTest, RemapStorageBuffer_ThroughAccessChain_NonCascaded) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody()) << p->error();
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
MemberAccessor{
|
||||
Identifier{myvar}
|
||||
Identifier{field0}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
Identifier[not set]{field0}
|
||||
}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
Assignment{
|
||||
ArrayAccessor{
|
||||
MemberAccessor{
|
||||
Identifier{myvar}
|
||||
Identifier{field1}
|
||||
ArrayAccessor[not set]{
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
Identifier[not set]{field1}
|
||||
}
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
})")) << ToString(fe.ast_body())
|
||||
<< p->error();
|
||||
}
|
||||
@@ -872,14 +872,14 @@ TEST_F(SpvParserTest, RemapStorageBuffer_ThroughAccessChain_Cascaded) {
|
||||
FunctionEmitter fe(p, *spirv_function(100));
|
||||
EXPECT_TRUE(fe.EmitBody()) << p->error();
|
||||
EXPECT_THAT(ToString(fe.ast_body()), HasSubstr(R"(Assignment{
|
||||
ArrayAccessor{
|
||||
MemberAccessor{
|
||||
Identifier{myvar}
|
||||
Identifier{field1}
|
||||
ArrayAccessor[not set]{
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
Identifier[not set]{field1}
|
||||
}
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
})")) << ToString(fe.ast_body())
|
||||
<< p->error();
|
||||
}
|
||||
@@ -910,19 +910,19 @@ TEST_F(SpvParserTest, RemapStorageBuffer_ThroughCopyObject_WithoutHoisting) {
|
||||
none
|
||||
__ptr_storage_buffer__u32
|
||||
{
|
||||
ArrayAccessor{
|
||||
MemberAccessor{
|
||||
Identifier{myvar}
|
||||
Identifier{field1}
|
||||
ArrayAccessor[not set]{
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
Identifier[not set]{field1}
|
||||
}
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_2}
|
||||
ScalarConstructor{0}
|
||||
Identifier[not set]{x_2}
|
||||
ScalarConstructor[not set]{0}
|
||||
})")) << ToString(fe.ast_body())
|
||||
<< p->error();
|
||||
}
|
||||
@@ -968,17 +968,17 @@ TEST_F(SpvParserTest, RemapStorageBuffer_ThroughCopyObject_WithHoisting) {
|
||||
}
|
||||
If{
|
||||
(
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
)
|
||||
{
|
||||
Assignment{
|
||||
Identifier{x_2}
|
||||
ArrayAccessor{
|
||||
MemberAccessor{
|
||||
Identifier{myvar}
|
||||
Identifier{field1}
|
||||
Identifier[not set]{x_2}
|
||||
ArrayAccessor[not set]{
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{myvar}
|
||||
Identifier[not set]{field1}
|
||||
}
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -989,8 +989,8 @@ Else{
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_2}
|
||||
ScalarConstructor{0}
|
||||
Identifier[not set]{x_2}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
Return{}
|
||||
)")) << ToString(fe.ast_body())
|
||||
|
||||
@@ -73,7 +73,7 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Scalar) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ VariableDeclStatement{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ VariableDeclStatement{
|
||||
none
|
||||
__i32
|
||||
{
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ VariableDeclStatement{
|
||||
none
|
||||
__f32
|
||||
{
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
}
|
||||
})")) << ToString(fe.ast_body());
|
||||
@@ -133,10 +133,10 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Vector) {
|
||||
none
|
||||
__vec_2__u32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,10 +147,10 @@ VariableDeclStatement{
|
||||
none
|
||||
__vec_2__i32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,10 +161,10 @@ VariableDeclStatement{
|
||||
none
|
||||
__vec_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,17 +193,17 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Matrix) {
|
||||
none
|
||||
__mat_2_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__mat_2_2__f32
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,10 +234,10 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Array) {
|
||||
none
|
||||
__array__u32_2
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,12 +266,12 @@ TEST_F(SpvParserTestMiscInstruction, OpUndef_InFunction_Struct) {
|
||||
none
|
||||
__struct_S
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__struct_S
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{false}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ TEST_F(SpvParserTest, EmitFunctionVariables_ScalarInitializers) {
|
||||
function
|
||||
__bool
|
||||
{
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -224,7 +224,7 @@ VariableDeclStatement{
|
||||
function
|
||||
__bool
|
||||
{
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,7 +234,7 @@ VariableDeclStatement{
|
||||
function
|
||||
__i32
|
||||
{
|
||||
ScalarConstructor{-1}
|
||||
ScalarConstructor[not set]{-1}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ VariableDeclStatement{
|
||||
function
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,7 +254,7 @@ VariableDeclStatement{
|
||||
function
|
||||
__f32
|
||||
{
|
||||
ScalarConstructor{1.500000}
|
||||
ScalarConstructor[not set]{1.500000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -287,7 +287,7 @@ TEST_F(SpvParserTest, EmitFunctionVariables_ScalarNullInitializers) {
|
||||
function
|
||||
__bool
|
||||
{
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,7 +297,7 @@ VariableDeclStatement{
|
||||
function
|
||||
__i32
|
||||
{
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -307,7 +307,7 @@ VariableDeclStatement{
|
||||
function
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,7 +317,7 @@ VariableDeclStatement{
|
||||
function
|
||||
__f32
|
||||
{
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -346,10 +346,10 @@ TEST_F(SpvParserTest, EmitFunctionVariables_VectorInitializer) {
|
||||
function
|
||||
__vec_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{1.500000}
|
||||
ScalarConstructor{2.000000}
|
||||
ScalarConstructor[not set]{1.500000}
|
||||
ScalarConstructor[not set]{2.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -384,22 +384,22 @@ TEST_F(SpvParserTest, EmitFunctionVariables_MatrixInitializer) {
|
||||
function
|
||||
__mat_2_3__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__mat_2_3__f32
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{1.500000}
|
||||
ScalarConstructor{2.000000}
|
||||
ScalarConstructor[not set]{1.500000}
|
||||
ScalarConstructor[not set]{2.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{2.000000}
|
||||
ScalarConstructor{3.000000}
|
||||
ScalarConstructor[not set]{2.000000}
|
||||
ScalarConstructor[not set]{3.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{3.000000}
|
||||
ScalarConstructor{4.000000}
|
||||
ScalarConstructor[not set]{3.000000}
|
||||
ScalarConstructor[not set]{4.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -430,10 +430,10 @@ TEST_F(SpvParserTest, EmitFunctionVariables_ArrayInitializer) {
|
||||
function
|
||||
__array__u32_2
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor{2}
|
||||
ScalarConstructor[not set]{1}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -464,10 +464,10 @@ TEST_F(SpvParserTest, EmitFunctionVariables_ArrayInitializer_AliasType) {
|
||||
function
|
||||
__alias_Arr__array__u32_2_stride_16
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__alias_Arr__array__u32_2_stride_16
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor{2}
|
||||
ScalarConstructor[not set]{1}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,10 +497,10 @@ TEST_F(SpvParserTest, EmitFunctionVariables_ArrayInitializer_Null) {
|
||||
function
|
||||
__array__u32_2
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -531,10 +531,10 @@ TEST_F(SpvParserTest, EmitFunctionVariables_ArrayInitializer_AliasType_Null) {
|
||||
function
|
||||
__alias_Arr__array__u32_2_stride_16
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__alias_Arr__array__u32_2_stride_16
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -565,14 +565,14 @@ TEST_F(SpvParserTest, EmitFunctionVariables_StructInitializer) {
|
||||
function
|
||||
__struct_S
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__struct_S
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor{1.500000}
|
||||
TypeConstructor{
|
||||
ScalarConstructor[not set]{1}
|
||||
ScalarConstructor[not set]{1.500000}
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor{2}
|
||||
ScalarConstructor[not set]{1}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -604,14 +604,14 @@ TEST_F(SpvParserTest, EmitFunctionVariables_StructInitializer_Null) {
|
||||
function
|
||||
__struct_S
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__struct_S
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0.000000}
|
||||
TypeConstructor{
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -650,15 +650,15 @@ TEST_F(SpvParserTest,
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_25}
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_25}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_25}
|
||||
Binary{
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_25}
|
||||
Binary[not set]{
|
||||
ScalarConstructor[not set]{1}
|
||||
add
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
Return{}
|
||||
@@ -700,25 +700,25 @@ VariableDeclStatement{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Binary{
|
||||
ScalarConstructor{1}
|
||||
Binary[not set]{
|
||||
ScalarConstructor[not set]{1}
|
||||
add
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_25}
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_25}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_25}
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_25}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_25}
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_25}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
Return{}
|
||||
)")) << ToString(fe.ast_body());
|
||||
@@ -770,29 +770,29 @@ VariableDeclStatement{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Binary{
|
||||
ScalarConstructor{1}
|
||||
Binary[not set]{
|
||||
ScalarConstructor[not set]{1}
|
||||
add
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_25}
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_25}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
Loop{
|
||||
continuing {
|
||||
Assignment{
|
||||
Identifier{x_25}
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_25}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_25}
|
||||
ScalarConstructor{2}
|
||||
Identifier[not set]{x_25}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
Return{}
|
||||
)")) << ToString(fe.ast_body());
|
||||
@@ -855,8 +855,8 @@ TEST_F(
|
||||
EXPECT_TRUE(fe.EmitBody()) << p->error();
|
||||
|
||||
EXPECT_THAT(ToString(fe.ast_body()), Eq(R"(Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{0}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
Loop{
|
||||
VariableDeclStatement{
|
||||
@@ -867,32 +867,32 @@ Loop{
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
If{
|
||||
(
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
)
|
||||
{
|
||||
Break{}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{3}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{3}
|
||||
}
|
||||
If{
|
||||
(
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
)
|
||||
{
|
||||
Assignment{
|
||||
Identifier{x_2}
|
||||
Binary{
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_2}
|
||||
Binary[not set]{
|
||||
ScalarConstructor[not set]{1}
|
||||
add
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -903,17 +903,17 @@ Loop{
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
continuing {
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{4}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{4}
|
||||
}
|
||||
If{
|
||||
(
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
)
|
||||
{
|
||||
Break{}
|
||||
@@ -922,8 +922,8 @@ Loop{
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
ScalarConstructor{5}
|
||||
Identifier[not set]{x_1}
|
||||
ScalarConstructor[not set]{5}
|
||||
}
|
||||
Return{}
|
||||
)")) << ToString(fe.ast_body());
|
||||
@@ -976,13 +976,13 @@ TEST_F(
|
||||
none
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
If{
|
||||
(
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
)
|
||||
{
|
||||
}
|
||||
@@ -993,13 +993,13 @@ VariableDeclStatement{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_200}
|
||||
Identifier{x_3}
|
||||
Identifier[not set]{x_200}
|
||||
Identifier[not set]{x_3}
|
||||
}
|
||||
Return{}
|
||||
)")) << ToString(fe.ast_body());
|
||||
@@ -1055,7 +1055,7 @@ TEST_F(SpvParserTest,
|
||||
|
||||
EXPECT_THAT(ToString(fe.ast_body()), Eq(R"(If{
|
||||
(
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
)
|
||||
{
|
||||
VariableDeclStatement{
|
||||
@@ -1064,13 +1064,13 @@ TEST_F(SpvParserTest,
|
||||
none
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
If{
|
||||
(
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
)
|
||||
{
|
||||
}
|
||||
@@ -1081,13 +1081,13 @@ TEST_F(SpvParserTest,
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_200}
|
||||
Identifier{x_3}
|
||||
Identifier[not set]{x_200}
|
||||
Identifier[not set]{x_3}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1140,7 +1140,7 @@ TEST_F(
|
||||
|
||||
EXPECT_THAT(ToString(fe.ast_body()), Eq(R"(If{
|
||||
(
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
)
|
||||
{
|
||||
VariableDeclStatement{
|
||||
@@ -1149,12 +1149,12 @@ TEST_F(
|
||||
none
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
Switch{
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
{
|
||||
Case 0{
|
||||
}
|
||||
@@ -1168,13 +1168,13 @@ TEST_F(
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_200}
|
||||
Identifier{x_3}
|
||||
Identifier[not set]{x_200}
|
||||
Identifier[not set]{x_3}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1225,7 +1225,7 @@ TEST_F(SpvParserTest,
|
||||
none
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1235,13 +1235,13 @@ VariableDeclStatement{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_1}
|
||||
Identifier[not set]{x_1}
|
||||
}
|
||||
}
|
||||
}
|
||||
If{
|
||||
(
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
)
|
||||
{
|
||||
}
|
||||
@@ -1312,7 +1312,7 @@ TEST_F(SpvParserTest, EmitStatement_Phi_SingleBlockLoopIndex) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_7}
|
||||
Identifier[not set]{x_7}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1322,21 +1322,21 @@ TEST_F(SpvParserTest, EmitStatement_Phi_SingleBlockLoopIndex) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_8}
|
||||
Identifier[not set]{x_8}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_2_phi}
|
||||
ScalarConstructor{0}
|
||||
Identifier[not set]{x_2_phi}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_3_phi}
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_3_phi}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
If{
|
||||
(
|
||||
Identifier{x_101}
|
||||
Identifier[not set]{x_101}
|
||||
)
|
||||
{
|
||||
Break{}
|
||||
@@ -1349,7 +1349,7 @@ TEST_F(SpvParserTest, EmitStatement_Phi_SingleBlockLoopIndex) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_2_phi}
|
||||
Identifier[not set]{x_2_phi}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1359,25 +1359,25 @@ TEST_F(SpvParserTest, EmitStatement_Phi_SingleBlockLoopIndex) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_3_phi}
|
||||
Identifier[not set]{x_3_phi}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_2_phi}
|
||||
Binary{
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_2_phi}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_2}
|
||||
add
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_3_phi}
|
||||
Identifier{x_3}
|
||||
Identifier[not set]{x_3_phi}
|
||||
Identifier[not set]{x_3}
|
||||
}
|
||||
If{
|
||||
(
|
||||
Identifier{x_102}
|
||||
Identifier[not set]{x_102}
|
||||
)
|
||||
{
|
||||
Break{}
|
||||
@@ -1454,7 +1454,7 @@ TEST_F(SpvParserTest, EmitStatement_Phi_MultiBlockLoopIndex) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_7}
|
||||
Identifier[not set]{x_7}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1464,21 +1464,21 @@ TEST_F(SpvParserTest, EmitStatement_Phi_MultiBlockLoopIndex) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_8}
|
||||
Identifier[not set]{x_8}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_2_phi}
|
||||
ScalarConstructor{0}
|
||||
Identifier[not set]{x_2_phi}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_3_phi}
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_3_phi}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
If{
|
||||
(
|
||||
Identifier{x_101}
|
||||
Identifier[not set]{x_101}
|
||||
)
|
||||
{
|
||||
Break{}
|
||||
@@ -1498,7 +1498,7 @@ TEST_F(SpvParserTest, EmitStatement_Phi_MultiBlockLoopIndex) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_2_phi}
|
||||
Identifier[not set]{x_2_phi}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1508,13 +1508,13 @@ TEST_F(SpvParserTest, EmitStatement_Phi_MultiBlockLoopIndex) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_3_phi}
|
||||
Identifier[not set]{x_3_phi}
|
||||
}
|
||||
}
|
||||
}
|
||||
If{
|
||||
(
|
||||
Identifier{x_102}
|
||||
Identifier[not set]{x_102}
|
||||
)
|
||||
{
|
||||
Break{}
|
||||
@@ -1522,20 +1522,20 @@ TEST_F(SpvParserTest, EmitStatement_Phi_MultiBlockLoopIndex) {
|
||||
}
|
||||
continuing {
|
||||
Assignment{
|
||||
Identifier{x_4}
|
||||
Binary{
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_4}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_2}
|
||||
add
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_2_phi}
|
||||
Identifier{x_4}
|
||||
Identifier[not set]{x_2_phi}
|
||||
Identifier[not set]{x_4}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_3_phi}
|
||||
Identifier{x_3}
|
||||
Identifier[not set]{x_3_phi}
|
||||
Identifier[not set]{x_3}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1595,7 +1595,7 @@ TEST_F(SpvParserTest, EmitStatement_Phi_ValueFromLoopBodyAndContinuing) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_17}
|
||||
Identifier[not set]{x_17}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1615,12 +1615,12 @@ Loop{
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_2_phi}
|
||||
ScalarConstructor{0}
|
||||
Identifier[not set]{x_2_phi}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_5_phi}
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_5_phi}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
Loop{
|
||||
VariableDeclStatement{
|
||||
@@ -1636,7 +1636,7 @@ Loop{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_2_phi}
|
||||
Identifier[not set]{x_2_phi}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1646,7 +1646,7 @@ Loop{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_5_phi}
|
||||
Identifier[not set]{x_5_phi}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1656,10 +1656,10 @@ Loop{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Binary{
|
||||
Identifier{x_2}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_2}
|
||||
add
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1670,17 +1670,17 @@ Loop{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Binary{
|
||||
Identifier{x_4}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_4}
|
||||
add
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
If{
|
||||
(
|
||||
Identifier{x_101}
|
||||
Identifier[not set]{x_101}
|
||||
)
|
||||
{
|
||||
Break{}
|
||||
@@ -1688,20 +1688,20 @@ Loop{
|
||||
}
|
||||
continuing {
|
||||
Assignment{
|
||||
Identifier{x_7}
|
||||
Binary{
|
||||
Identifier{x_4}
|
||||
Identifier[not set]{x_7}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{x_4}
|
||||
add
|
||||
Identifier{x_6}
|
||||
Identifier[not set]{x_6}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_2_phi}
|
||||
Identifier{x_4}
|
||||
Identifier[not set]{x_2_phi}
|
||||
Identifier[not set]{x_4}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_5_phi}
|
||||
Identifier{x_7}
|
||||
Identifier[not set]{x_5_phi}
|
||||
Identifier[not set]{x_7}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1763,7 +1763,7 @@ TEST_F(SpvParserTest, EmitStatement_Phi_FromElseAndThen) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_7}
|
||||
Identifier[not set]{x_7}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1773,14 +1773,14 @@ VariableDeclStatement{
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_8}
|
||||
Identifier[not set]{x_8}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loop{
|
||||
If{
|
||||
(
|
||||
Identifier{x_101}
|
||||
Identifier[not set]{x_101}
|
||||
)
|
||||
{
|
||||
Break{}
|
||||
@@ -1795,12 +1795,12 @@ Loop{
|
||||
}
|
||||
If{
|
||||
(
|
||||
Identifier{x_102}
|
||||
Identifier[not set]{x_102}
|
||||
)
|
||||
{
|
||||
Assignment{
|
||||
Identifier{x_2_phi}
|
||||
ScalarConstructor{0}
|
||||
Identifier[not set]{x_2_phi}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
Continue{}
|
||||
}
|
||||
@@ -1808,8 +1808,8 @@ Loop{
|
||||
Else{
|
||||
{
|
||||
Assignment{
|
||||
Identifier{x_2_phi}
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_2_phi}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1820,13 +1820,13 @@ Loop{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_2_phi}
|
||||
Identifier[not set]{x_2_phi}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1883,7 +1883,7 @@ TEST_F(SpvParserTest, EmitStatement_Phi_FromHeaderAndThen) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_7}
|
||||
Identifier[not set]{x_7}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1893,14 +1893,14 @@ VariableDeclStatement{
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_8}
|
||||
Identifier[not set]{x_8}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loop{
|
||||
If{
|
||||
(
|
||||
Identifier{x_101}
|
||||
Identifier[not set]{x_101}
|
||||
)
|
||||
{
|
||||
Break{}
|
||||
@@ -1914,17 +1914,17 @@ Loop{
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_2_phi}
|
||||
ScalarConstructor{0}
|
||||
Identifier[not set]{x_2_phi}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
If{
|
||||
(
|
||||
Identifier{x_102}
|
||||
Identifier[not set]{x_102}
|
||||
)
|
||||
{
|
||||
Assignment{
|
||||
Identifier{x_2_phi}
|
||||
ScalarConstructor{1}
|
||||
Identifier[not set]{x_2_phi}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1935,13 +1935,13 @@ Loop{
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Identifier{x_2_phi}
|
||||
Identifier[not set]{x_2_phi}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_1}
|
||||
Identifier{x_2}
|
||||
Identifier[not set]{x_1}
|
||||
Identifier[not set]{x_2}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1996,10 +1996,10 @@ VariableDeclStatement{
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Binary{
|
||||
ScalarConstructor{true}
|
||||
Binary[not set]{
|
||||
ScalarConstructor[not set]{true}
|
||||
logical_and
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2010,25 +2010,25 @@ VariableDeclStatement{
|
||||
none
|
||||
__bool
|
||||
{
|
||||
UnaryOp{
|
||||
UnaryOp[not set]{
|
||||
not
|
||||
Identifier{x_11}
|
||||
Identifier[not set]{x_11}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Assignment{
|
||||
Identifier{x_101_phi}
|
||||
Identifier{x_11}
|
||||
Identifier[not set]{x_101_phi}
|
||||
Identifier[not set]{x_11}
|
||||
}
|
||||
If{
|
||||
(
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
)
|
||||
{
|
||||
Assignment{
|
||||
Identifier{x_101_phi}
|
||||
Identifier{x_12}
|
||||
Identifier[not set]{x_101_phi}
|
||||
Identifier[not set]{x_12}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2038,7 +2038,7 @@ VariableDeclStatement{
|
||||
none
|
||||
__bool
|
||||
{
|
||||
Identifier{x_101_phi}
|
||||
Identifier[not set]{x_101_phi}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@ TEST_F(SpvParserTest, EmitFunctions_CalleePrecedesCaller) {
|
||||
{
|
||||
Return{
|
||||
{
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -213,8 +213,8 @@ TEST_F(SpvParserTest, EmitFunctions_CalleePrecedesCaller) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Call{
|
||||
Identifier{leaf}
|
||||
Call[not set]{
|
||||
Identifier[not set]{leaf}
|
||||
(
|
||||
)
|
||||
}
|
||||
@@ -223,7 +223,7 @@ TEST_F(SpvParserTest, EmitFunctions_CalleePrecedesCaller) {
|
||||
}
|
||||
Return{
|
||||
{
|
||||
Identifier{leaf_result}
|
||||
Identifier[not set]{leaf_result}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,8 +236,8 @@ TEST_F(SpvParserTest, EmitFunctions_CalleePrecedesCaller) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
Call{
|
||||
Identifier{branch}
|
||||
Call[not set]{
|
||||
Identifier[not set]{branch}
|
||||
(
|
||||
)
|
||||
}
|
||||
@@ -267,7 +267,7 @@ TEST_F(SpvParserTest, EmitFunctions_NonVoidResultType) {
|
||||
{
|
||||
Return{
|
||||
{
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
|
||||
@@ -329,13 +329,13 @@ TEST_F(SpvParserTest, ModuleScopeVar_BuiltinPosition_StorePosition) {
|
||||
const auto module_str = p->module().to_str();
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(
|
||||
Assignment{
|
||||
Identifier{gl_Position}
|
||||
TypeConstructor{
|
||||
Identifier[not set]{gl_Position}
|
||||
TypeConstructor[not set]{
|
||||
__vec_4__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
})"))
|
||||
<< module_str;
|
||||
@@ -360,11 +360,11 @@ TEST_F(SpvParserTest,
|
||||
const auto module_str = p->module().to_str();
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(
|
||||
Assignment{
|
||||
MemberAccessor{
|
||||
Identifier{gl_Position}
|
||||
Identifier{y}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{gl_Position}
|
||||
Identifier[not set]{y}
|
||||
}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
})"))
|
||||
<< module_str;
|
||||
}
|
||||
@@ -392,11 +392,11 @@ TEST_F(SpvParserTest,
|
||||
EXPECT_THAT(module_str, HasSubstr(R"(
|
||||
{
|
||||
Assignment{
|
||||
MemberAccessor{
|
||||
Identifier{gl_Position}
|
||||
Identifier{y}
|
||||
MemberAccessor[not set]{
|
||||
Identifier[not set]{gl_Position}
|
||||
Identifier[not set]{y}
|
||||
}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
Return{}
|
||||
})"))
|
||||
@@ -518,7 +518,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarInitializers) {
|
||||
private
|
||||
__bool
|
||||
{
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
}
|
||||
}
|
||||
Variable{
|
||||
@@ -526,7 +526,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarInitializers) {
|
||||
private
|
||||
__bool
|
||||
{
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
}
|
||||
}
|
||||
Variable{
|
||||
@@ -534,7 +534,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarInitializers) {
|
||||
private
|
||||
__i32
|
||||
{
|
||||
ScalarConstructor{-1}
|
||||
ScalarConstructor[not set]{-1}
|
||||
}
|
||||
}
|
||||
Variable{
|
||||
@@ -542,7 +542,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarInitializers) {
|
||||
private
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor[not set]{1}
|
||||
}
|
||||
}
|
||||
Variable{
|
||||
@@ -550,7 +550,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarInitializers) {
|
||||
private
|
||||
__f32
|
||||
{
|
||||
ScalarConstructor{1.500000}
|
||||
ScalarConstructor[not set]{1.500000}
|
||||
}
|
||||
})"));
|
||||
}
|
||||
@@ -575,7 +575,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarNullInitializers) {
|
||||
private
|
||||
__bool
|
||||
{
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
}
|
||||
}
|
||||
Variable{
|
||||
@@ -583,7 +583,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarNullInitializers) {
|
||||
private
|
||||
__i32
|
||||
{
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
Variable{
|
||||
@@ -591,7 +591,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarNullInitializers) {
|
||||
private
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
Variable{
|
||||
@@ -599,7 +599,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarNullInitializers) {
|
||||
private
|
||||
__f32
|
||||
{
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
})"));
|
||||
}
|
||||
@@ -624,7 +624,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarUndefInitializers) {
|
||||
private
|
||||
__bool
|
||||
{
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
}
|
||||
}
|
||||
Variable{
|
||||
@@ -632,7 +632,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarUndefInitializers) {
|
||||
private
|
||||
__i32
|
||||
{
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
Variable{
|
||||
@@ -640,7 +640,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarUndefInitializers) {
|
||||
private
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
Variable{
|
||||
@@ -648,7 +648,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarUndefInitializers) {
|
||||
private
|
||||
__f32
|
||||
{
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
})"));
|
||||
}
|
||||
@@ -668,10 +668,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_VectorInitializer) {
|
||||
private
|
||||
__vec_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{1.500000}
|
||||
ScalarConstructor{2.000000}
|
||||
ScalarConstructor[not set]{1.500000}
|
||||
ScalarConstructor[not set]{2.000000}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -691,10 +691,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_VectorBoolNullInitializer) {
|
||||
private
|
||||
__vec_2__bool
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__bool
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -714,10 +714,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_VectorBoolUndefInitializer) {
|
||||
private
|
||||
__vec_2__bool
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__bool
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -737,10 +737,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_VectorUintNullInitializer) {
|
||||
private
|
||||
__vec_2__u32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -760,10 +760,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_VectorUintUndefInitializer) {
|
||||
private
|
||||
__vec_2__u32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__u32
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -783,10 +783,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_VectorIntNullInitializer) {
|
||||
private
|
||||
__vec_2__i32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -806,10 +806,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_VectorIntUndefInitializer) {
|
||||
private
|
||||
__vec_2__i32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__i32
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -829,10 +829,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_VectorFloatNullInitializer) {
|
||||
private
|
||||
__vec_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -852,10 +852,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_VectorFloatUndefInitializer) {
|
||||
private
|
||||
__vec_2__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -881,22 +881,22 @@ TEST_F(SpvParserTest, ModuleScopeVar_MatrixInitializer) {
|
||||
private
|
||||
__mat_2_3__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__mat_2_3__f32
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{1.500000}
|
||||
ScalarConstructor{2.000000}
|
||||
ScalarConstructor[not set]{1.500000}
|
||||
ScalarConstructor[not set]{2.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{2.000000}
|
||||
ScalarConstructor{3.000000}
|
||||
ScalarConstructor[not set]{2.000000}
|
||||
ScalarConstructor[not set]{3.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{3.000000}
|
||||
ScalarConstructor{4.000000}
|
||||
ScalarConstructor[not set]{3.000000}
|
||||
ScalarConstructor[not set]{4.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -917,22 +917,22 @@ TEST_F(SpvParserTest, ModuleScopeVar_MatrixNullInitializer) {
|
||||
private
|
||||
__mat_2_3__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__mat_2_3__f32
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -953,22 +953,22 @@ TEST_F(SpvParserTest, ModuleScopeVar_MatrixUndefInitializer) {
|
||||
private
|
||||
__mat_2_3__f32
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__mat_2_3__f32
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__vec_2__f32
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -990,10 +990,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_ArrayInitializer) {
|
||||
private
|
||||
__array__u32_2
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor{2}
|
||||
ScalarConstructor[not set]{1}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -1013,10 +1013,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_ArrayNullInitializer) {
|
||||
private
|
||||
__array__u32_2
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -1036,10 +1036,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_ArrayUndefInitializer) {
|
||||
private
|
||||
__array__u32_2
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
})"));
|
||||
@@ -1061,14 +1061,14 @@ TEST_F(SpvParserTest, ModuleScopeVar_StructInitializer) {
|
||||
private
|
||||
__struct_S
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__struct_S
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor{1.500000}
|
||||
TypeConstructor{
|
||||
ScalarConstructor[not set]{1}
|
||||
ScalarConstructor[not set]{1.500000}
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{1}
|
||||
ScalarConstructor{2}
|
||||
ScalarConstructor[not set]{1}
|
||||
ScalarConstructor[not set]{2}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1090,14 +1090,14 @@ TEST_F(SpvParserTest, ModuleScopeVar_StructNullInitializer) {
|
||||
private
|
||||
__struct_S
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__struct_S
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0.000000}
|
||||
TypeConstructor{
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1119,14 +1119,14 @@ TEST_F(SpvParserTest, ModuleScopeVar_StructUndefInitializer) {
|
||||
private
|
||||
__struct_S
|
||||
{
|
||||
TypeConstructor{
|
||||
TypeConstructor[not set]{
|
||||
__struct_S
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0.000000}
|
||||
TypeConstructor{
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0.000000}
|
||||
TypeConstructor[not set]{
|
||||
__array__u32_2
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
ScalarConstructor[not set]{0}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1509,7 +1509,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarSpecConstant_DeclareConst_True) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
ScalarConstructor{true}
|
||||
ScalarConstructor[not set]{true}
|
||||
}
|
||||
}
|
||||
})")) << module_str;
|
||||
@@ -1534,7 +1534,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarSpecConstant_DeclareConst_False) {
|
||||
none
|
||||
__bool
|
||||
{
|
||||
ScalarConstructor{false}
|
||||
ScalarConstructor[not set]{false}
|
||||
}
|
||||
}
|
||||
})")) << module_str;
|
||||
@@ -1559,7 +1559,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarSpecConstant_DeclareConst_U32) {
|
||||
none
|
||||
__u32
|
||||
{
|
||||
ScalarConstructor{42}
|
||||
ScalarConstructor[not set]{42}
|
||||
}
|
||||
}
|
||||
})")) << module_str;
|
||||
@@ -1584,7 +1584,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarSpecConstant_DeclareConst_I32) {
|
||||
none
|
||||
__i32
|
||||
{
|
||||
ScalarConstructor{42}
|
||||
ScalarConstructor[not set]{42}
|
||||
}
|
||||
}
|
||||
})")) << module_str;
|
||||
@@ -1609,7 +1609,7 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarSpecConstant_DeclareConst_F32) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
ScalarConstructor{2.500000}
|
||||
ScalarConstructor[not set]{2.500000}
|
||||
}
|
||||
}
|
||||
})")) << module_str;
|
||||
@@ -1632,7 +1632,7 @@ TEST_F(SpvParserTest,
|
||||
none
|
||||
__f32
|
||||
{
|
||||
ScalarConstructor{2.500000}
|
||||
ScalarConstructor[not set]{2.500000}
|
||||
}
|
||||
}
|
||||
})")) << module_str;
|
||||
@@ -1660,10 +1660,10 @@ TEST_F(SpvParserTest, ModuleScopeVar_ScalarSpecConstant_UsedInFunction) {
|
||||
none
|
||||
__f32
|
||||
{
|
||||
Binary{
|
||||
Identifier{myconst}
|
||||
Binary[not set]{
|
||||
Identifier[not set]{myconst}
|
||||
add
|
||||
Identifier{myconst}
|
||||
Identifier[not set]{myconst}
|
||||
}
|
||||
}
|
||||
})"))
|
||||
|
||||
Reference in New Issue
Block a user