|
|
@@ -14,6 +14,7 @@
|
|
|
|
|
|
#include "source/fuzz/transformation_construct_composite.h"
|
|
|
#include "source/fuzz/data_descriptor.h"
|
|
|
+#include "source/fuzz/instruction_descriptor.h"
|
|
|
#include "test/fuzz/fuzz_test_util.h"
|
|
|
|
|
|
namespace spvtools {
|
|
|
@@ -144,11 +145,13 @@ TEST(TransformationConstructCompositeTest, ConstructArrays) {
|
|
|
FactManager fact_manager;
|
|
|
|
|
|
// Make a vec2[3]
|
|
|
- TransformationConstructComposite make_vec2_array_length_3(37, {41, 45, 27},
|
|
|
- 46, 0, 200);
|
|
|
+ TransformationConstructComposite make_vec2_array_length_3(
|
|
|
+ 37, {41, 45, 27}, MakeInstructionDescriptor(46, SpvOpAccessChain, 0),
|
|
|
+ 200);
|
|
|
// Bad: there are too many components
|
|
|
TransformationConstructComposite make_vec2_array_length_3_bad(
|
|
|
- 37, {41, 45, 27, 27}, 46, 0, 200);
|
|
|
+ 37, {41, 45, 27, 27}, MakeInstructionDescriptor(46, SpvOpAccessChain, 0),
|
|
|
+ 200);
|
|
|
ASSERT_TRUE(
|
|
|
make_vec2_array_length_3.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(
|
|
|
@@ -160,11 +163,11 @@ TEST(TransformationConstructCompositeTest, ConstructArrays) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 27, 200, {2}));
|
|
|
|
|
|
// Make a float[2]
|
|
|
- TransformationConstructComposite make_float_array_length_2(9, {24, 40}, 71, 1,
|
|
|
- 201);
|
|
|
+ TransformationConstructComposite make_float_array_length_2(
|
|
|
+ 9, {24, 40}, MakeInstructionDescriptor(71, SpvOpStore, 0), 201);
|
|
|
// Bad: %41 does not have type float
|
|
|
- TransformationConstructComposite make_float_array_length_2_bad(9, {41, 40},
|
|
|
- 71, 1, 201);
|
|
|
+ TransformationConstructComposite make_float_array_length_2_bad(
|
|
|
+ 9, {41, 40}, MakeInstructionDescriptor(71, SpvOpStore, 0), 201);
|
|
|
ASSERT_TRUE(
|
|
|
make_float_array_length_2.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(
|
|
|
@@ -175,11 +178,13 @@ TEST(TransformationConstructCompositeTest, ConstructArrays) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 40, 201, {1}));
|
|
|
|
|
|
// Make a bool[3]
|
|
|
- TransformationConstructComposite make_bool_array_length_3(47, {33, 50, 50},
|
|
|
- 33, 1, 202);
|
|
|
+ TransformationConstructComposite make_bool_array_length_3(
|
|
|
+ 47, {33, 50, 50}, MakeInstructionDescriptor(33, SpvOpSelectionMerge, 0),
|
|
|
+ 202);
|
|
|
// Bad: %54 is not available at the desired program point.
|
|
|
TransformationConstructComposite make_bool_array_length_3_bad(
|
|
|
- 47, {33, 54, 50}, 33, 1, 202);
|
|
|
+ 47, {33, 54, 50}, MakeInstructionDescriptor(33, SpvOpSelectionMerge, 0),
|
|
|
+ 202);
|
|
|
ASSERT_TRUE(
|
|
|
make_bool_array_length_3.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(
|
|
|
@@ -191,11 +196,11 @@ TEST(TransformationConstructCompositeTest, ConstructArrays) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 50, 202, {2}));
|
|
|
|
|
|
// make a uvec3[2][2]
|
|
|
- TransformationConstructComposite make_uvec3_array_length_2_2(58, {69, 100},
|
|
|
- 64, 1, 203);
|
|
|
- // Bad: Offset 100 is too large.
|
|
|
+ TransformationConstructComposite make_uvec3_array_length_2_2(
|
|
|
+ 58, {69, 100}, MakeInstructionDescriptor(64, SpvOpStore, 0), 203);
|
|
|
+ // Bad: Skip count 100 is too large.
|
|
|
TransformationConstructComposite make_uvec3_array_length_2_2_bad(
|
|
|
- 58, {33, 54}, 64, 100, 203);
|
|
|
+ 58, {33, 54}, MakeInstructionDescriptor(64, SpvOpStore, 100), 203);
|
|
|
ASSERT_TRUE(
|
|
|
make_uvec3_array_length_2_2.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_uvec3_array_length_2_2_bad.IsApplicable(context.get(),
|
|
|
@@ -393,9 +398,11 @@ TEST(TransformationConstructCompositeTest, ConstructMatrices) {
|
|
|
FactManager fact_manager;
|
|
|
|
|
|
// make a mat3x4
|
|
|
- TransformationConstructComposite make_mat34(32, {25, 28, 31}, 31, 2, 200);
|
|
|
+ TransformationConstructComposite make_mat34(
|
|
|
+ 32, {25, 28, 31}, MakeInstructionDescriptor(31, SpvOpReturn, 0), 200);
|
|
|
// Bad: %35 is mat4x3, not mat3x4.
|
|
|
- TransformationConstructComposite make_mat34_bad(35, {25, 28, 31}, 31, 2, 200);
|
|
|
+ TransformationConstructComposite make_mat34_bad(
|
|
|
+ 35, {25, 28, 31}, MakeInstructionDescriptor(31, SpvOpReturn, 0), 200);
|
|
|
ASSERT_TRUE(make_mat34.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_mat34_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_mat34.Apply(context.get(), &fact_manager);
|
|
|
@@ -405,11 +412,11 @@ TEST(TransformationConstructCompositeTest, ConstructMatrices) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 31, 200, {2}));
|
|
|
|
|
|
// make a mat4x3
|
|
|
- TransformationConstructComposite make_mat43(35, {11, 13, 16, 100}, 31, 1,
|
|
|
- 201);
|
|
|
+ TransformationConstructComposite make_mat43(
|
|
|
+ 35, {11, 13, 16, 100}, MakeInstructionDescriptor(31, SpvOpStore, 0), 201);
|
|
|
// Bad: %25 does not match the matrix's column type.
|
|
|
- TransformationConstructComposite make_mat43_bad(35, {25, 13, 16, 100}, 31, 1,
|
|
|
- 201);
|
|
|
+ TransformationConstructComposite make_mat43_bad(
|
|
|
+ 35, {25, 13, 16, 100}, MakeInstructionDescriptor(31, SpvOpStore, 0), 201);
|
|
|
ASSERT_TRUE(make_mat43.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_mat43_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_mat43.Apply(context.get(), &fact_manager);
|
|
|
@@ -592,9 +599,11 @@ TEST(TransformationConstructCompositeTest, ConstructStructs) {
|
|
|
FactManager fact_manager;
|
|
|
|
|
|
// make an Inner
|
|
|
- TransformationConstructComposite make_inner(9, {25, 19}, 57, 0, 200);
|
|
|
+ TransformationConstructComposite make_inner(
|
|
|
+ 9, {25, 19}, MakeInstructionDescriptor(57, SpvOpAccessChain, 0), 200);
|
|
|
// Bad: Too few fields to make the struct.
|
|
|
- TransformationConstructComposite make_inner_bad(9, {25}, 57, 0, 200);
|
|
|
+ TransformationConstructComposite make_inner_bad(
|
|
|
+ 9, {25}, MakeInstructionDescriptor(57, SpvOpAccessChain, 0), 200);
|
|
|
ASSERT_TRUE(make_inner.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_inner_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_inner.Apply(context.get(), &fact_manager);
|
|
|
@@ -603,10 +612,13 @@ TEST(TransformationConstructCompositeTest, ConstructStructs) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 19, 200, {1}));
|
|
|
|
|
|
// make an Outer
|
|
|
- TransformationConstructComposite make_outer(33, {46, 200, 56}, 200, 1, 201);
|
|
|
+ TransformationConstructComposite make_outer(
|
|
|
+ 33, {46, 200, 56}, MakeInstructionDescriptor(200, SpvOpAccessChain, 0),
|
|
|
+ 201);
|
|
|
// Bad: %200 is not available at the desired program point.
|
|
|
- TransformationConstructComposite make_outer_bad(33, {46, 200, 56}, 200, 0,
|
|
|
- 201);
|
|
|
+ TransformationConstructComposite make_outer_bad(
|
|
|
+ 33, {46, 200, 56},
|
|
|
+ MakeInstructionDescriptor(200, SpvOpCompositeConstruct, 0), 201);
|
|
|
ASSERT_TRUE(make_outer.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_outer_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_outer.Apply(context.get(), &fact_manager);
|
|
|
@@ -900,9 +912,11 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
|
|
|
FactManager fact_manager;
|
|
|
|
|
|
- TransformationConstructComposite make_vec2(7, {17, 11}, 100, 1, 200);
|
|
|
+ TransformationConstructComposite make_vec2(
|
|
|
+ 7, {17, 11}, MakeInstructionDescriptor(100, SpvOpStore, 0), 200);
|
|
|
// Bad: not enough data for a vec2
|
|
|
- TransformationConstructComposite make_vec2_bad(7, {11}, 100, 1, 200);
|
|
|
+ TransformationConstructComposite make_vec2_bad(
|
|
|
+ 7, {11}, MakeInstructionDescriptor(100, SpvOpStore, 0), 200);
|
|
|
ASSERT_TRUE(make_vec2.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_vec2_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_vec2.Apply(context.get(), &fact_manager);
|
|
|
@@ -910,9 +924,13 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 17, 200, {0}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 11, 200, {1}));
|
|
|
|
|
|
- TransformationConstructComposite make_vec3(25, {12, 32}, 35, 0, 201);
|
|
|
+ TransformationConstructComposite make_vec3(
|
|
|
+ 25, {12, 32}, MakeInstructionDescriptor(35, SpvOpCompositeConstruct, 0),
|
|
|
+ 201);
|
|
|
// Bad: too much data for a vec3
|
|
|
- TransformationConstructComposite make_vec3_bad(25, {12, 32, 32}, 35, 0, 201);
|
|
|
+ TransformationConstructComposite make_vec3_bad(
|
|
|
+ 25, {12, 32, 32},
|
|
|
+ MakeInstructionDescriptor(35, SpvOpCompositeConstruct, 0), 201);
|
|
|
ASSERT_TRUE(make_vec3.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_vec3_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_vec3.Apply(context.get(), &fact_manager);
|
|
|
@@ -920,10 +938,13 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 12, 201, {0}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 32, 201, {2}));
|
|
|
|
|
|
- TransformationConstructComposite make_vec4(44, {32, 32, 10, 11}, 75, 0, 202);
|
|
|
+ TransformationConstructComposite make_vec4(
|
|
|
+ 44, {32, 32, 10, 11}, MakeInstructionDescriptor(75, SpvOpAccessChain, 0),
|
|
|
+ 202);
|
|
|
// Bad: id 48 is not available at the insertion points
|
|
|
- TransformationConstructComposite make_vec4_bad(44, {48, 32, 10, 11}, 75, 0,
|
|
|
- 202);
|
|
|
+ TransformationConstructComposite make_vec4_bad(
|
|
|
+ 44, {48, 32, 10, 11}, MakeInstructionDescriptor(75, SpvOpAccessChain, 0),
|
|
|
+ 202);
|
|
|
ASSERT_TRUE(make_vec4.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_vec4_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_vec4.Apply(context.get(), &fact_manager);
|
|
|
@@ -933,9 +954,11 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 10, 202, {2}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 11, 202, {3}));
|
|
|
|
|
|
- TransformationConstructComposite make_ivec2(51, {126, 120}, 128, 0, 203);
|
|
|
+ TransformationConstructComposite make_ivec2(
|
|
|
+ 51, {126, 120}, MakeInstructionDescriptor(128, SpvOpLoad, 0), 203);
|
|
|
// Bad: if 128 is not available at the instruction that defines 128
|
|
|
- TransformationConstructComposite make_ivec2_bad(51, {128, 120}, 128, 0, 203);
|
|
|
+ TransformationConstructComposite make_ivec2_bad(
|
|
|
+ 51, {128, 120}, MakeInstructionDescriptor(128, SpvOpLoad, 0), 203);
|
|
|
ASSERT_TRUE(make_ivec2.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_ivec2_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_ivec2.Apply(context.get(), &fact_manager);
|
|
|
@@ -943,10 +966,13 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 126, 203, {0}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 120, 203, {1}));
|
|
|
|
|
|
- TransformationConstructComposite make_ivec3(114, {56, 117, 56}, 66, 1, 204);
|
|
|
+ TransformationConstructComposite make_ivec3(
|
|
|
+ 114, {56, 117, 56}, MakeInstructionDescriptor(66, SpvOpAccessChain, 0),
|
|
|
+ 204);
|
|
|
// Bad because 1300 is not an id
|
|
|
- TransformationConstructComposite make_ivec3_bad(114, {56, 117, 1300}, 66, 1,
|
|
|
- 204);
|
|
|
+ TransformationConstructComposite make_ivec3_bad(
|
|
|
+ 114, {56, 117, 1300}, MakeInstructionDescriptor(66, SpvOpAccessChain, 0),
|
|
|
+ 204);
|
|
|
ASSERT_TRUE(make_ivec3.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_ivec3_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_ivec3.Apply(context.get(), &fact_manager);
|
|
|
@@ -955,11 +981,13 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 117, 204, {1}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 56, 204, {2}));
|
|
|
|
|
|
- TransformationConstructComposite make_ivec4(122, {56, 117, 117, 117}, 66, 0,
|
|
|
- 205);
|
|
|
+ TransformationConstructComposite make_ivec4(
|
|
|
+ 122, {56, 117, 117, 117}, MakeInstructionDescriptor(66, SpvOpIAdd, 0),
|
|
|
+ 205);
|
|
|
// Bad because 86 is the wrong type.
|
|
|
- TransformationConstructComposite make_ivec4_bad(86, {56, 117, 117, 117}, 66,
|
|
|
- 0, 205);
|
|
|
+ TransformationConstructComposite make_ivec4_bad(
|
|
|
+ 86, {56, 117, 117, 117}, MakeInstructionDescriptor(66, SpvOpIAdd, 0),
|
|
|
+ 205);
|
|
|
ASSERT_TRUE(make_ivec4.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_ivec4_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_ivec4.Apply(context.get(), &fact_manager);
|
|
|
@@ -969,8 +997,10 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 117, 205, {2}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 117, 205, {3}));
|
|
|
|
|
|
- TransformationConstructComposite make_uvec2(86, {18, 38}, 133, 2, 206);
|
|
|
- TransformationConstructComposite make_uvec2_bad(86, {18, 38}, 133, 200, 206);
|
|
|
+ TransformationConstructComposite make_uvec2(
|
|
|
+ 86, {18, 38}, MakeInstructionDescriptor(133, SpvOpAccessChain, 0), 206);
|
|
|
+ TransformationConstructComposite make_uvec2_bad(
|
|
|
+ 86, {18, 38}, MakeInstructionDescriptor(133, SpvOpAccessChain, 200), 206);
|
|
|
ASSERT_TRUE(make_uvec2.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_uvec2_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_uvec2.Apply(context.get(), &fact_manager);
|
|
|
@@ -978,10 +1008,11 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 18, 206, {0}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 38, 206, {1}));
|
|
|
|
|
|
- TransformationConstructComposite make_uvec3(59, {14, 18, 136}, 137, 2, 207);
|
|
|
+ TransformationConstructComposite make_uvec3(
|
|
|
+ 59, {14, 18, 136}, MakeInstructionDescriptor(137, SpvOpReturn, 0), 207);
|
|
|
// Bad because 1300 is not an id
|
|
|
- TransformationConstructComposite make_uvec3_bad(59, {14, 18, 1300}, 137, 2,
|
|
|
- 207);
|
|
|
+ TransformationConstructComposite make_uvec3_bad(
|
|
|
+ 59, {14, 18, 1300}, MakeInstructionDescriptor(137, SpvOpReturn, 0), 207);
|
|
|
ASSERT_TRUE(make_uvec3.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_uvec3_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_uvec3.Apply(context.get(), &fact_manager);
|
|
|
@@ -990,11 +1021,13 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 18, 207, {1}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 136, 207, {2}));
|
|
|
|
|
|
- TransformationConstructComposite make_uvec4(131, {14, 18, 136, 136}, 137, 0,
|
|
|
- 208);
|
|
|
+ TransformationConstructComposite make_uvec4(
|
|
|
+ 131, {14, 18, 136, 136},
|
|
|
+ MakeInstructionDescriptor(137, SpvOpAccessChain, 0), 208);
|
|
|
// Bad because 86 is the wrong type.
|
|
|
- TransformationConstructComposite make_uvec4_bad(86, {14, 18, 136, 136}, 137,
|
|
|
- 0, 208);
|
|
|
+ TransformationConstructComposite make_uvec4_bad(
|
|
|
+ 86, {14, 18, 136, 136},
|
|
|
+ MakeInstructionDescriptor(137, SpvOpAccessChain, 0), 208);
|
|
|
ASSERT_TRUE(make_uvec4.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_uvec4_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_uvec4.Apply(context.get(), &fact_manager);
|
|
|
@@ -1004,19 +1037,21 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 136, 208, {2}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 136, 208, {3}));
|
|
|
|
|
|
- TransformationConstructComposite make_bvec2(102,
|
|
|
- {
|
|
|
- 111,
|
|
|
- 41,
|
|
|
- },
|
|
|
- 75, 0, 209);
|
|
|
+ TransformationConstructComposite make_bvec2(
|
|
|
+ 102,
|
|
|
+ {
|
|
|
+ 111,
|
|
|
+ 41,
|
|
|
+ },
|
|
|
+ MakeInstructionDescriptor(75, SpvOpAccessChain, 0), 209);
|
|
|
// Bad because 0 is not a valid base instruction id
|
|
|
- TransformationConstructComposite make_bvec2_bad(102,
|
|
|
- {
|
|
|
- 111,
|
|
|
- 41,
|
|
|
- },
|
|
|
- 0, 0, 209);
|
|
|
+ TransformationConstructComposite make_bvec2_bad(
|
|
|
+ 102,
|
|
|
+ {
|
|
|
+ 111,
|
|
|
+ 41,
|
|
|
+ },
|
|
|
+ MakeInstructionDescriptor(0, SpvOpExtInstImport, 0), 209);
|
|
|
ASSERT_TRUE(make_bvec2.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_bvec2_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_bvec2.Apply(context.get(), &fact_manager);
|
|
|
@@ -1024,9 +1059,11 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 111, 209, {0}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 41, 209, {1}));
|
|
|
|
|
|
- TransformationConstructComposite make_bvec3(93, {108, 73}, 108, 1, 210);
|
|
|
+ TransformationConstructComposite make_bvec3(
|
|
|
+ 93, {108, 73}, MakeInstructionDescriptor(108, SpvOpStore, 0), 210);
|
|
|
// Bad because there are too many components for a bvec3
|
|
|
- TransformationConstructComposite make_bvec3_bad(93, {108, 108}, 108, 1, 210);
|
|
|
+ TransformationConstructComposite make_bvec3_bad(
|
|
|
+ 93, {108, 108}, MakeInstructionDescriptor(108, SpvOpStore, 0), 210);
|
|
|
ASSERT_TRUE(make_bvec3.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_bvec3_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_bvec3.Apply(context.get(), &fact_manager);
|
|
|
@@ -1034,9 +1071,11 @@ TEST(TransformationConstructCompositeTest, ConstructVectors) {
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 108, 210, {0}));
|
|
|
ASSERT_TRUE(SynonymFactHolds(fact_manager, 73, 210, {2}));
|
|
|
|
|
|
- TransformationConstructComposite make_bvec4(70, {108, 108}, 108, 3, 211);
|
|
|
+ TransformationConstructComposite make_bvec4(
|
|
|
+ 70, {108, 108}, MakeInstructionDescriptor(108, SpvOpBranch, 0), 211);
|
|
|
// Bad because 21 is a type, not a result id
|
|
|
- TransformationConstructComposite make_bvec4_bad(70, {21, 108}, 108, 3, 211);
|
|
|
+ TransformationConstructComposite make_bvec4_bad(
|
|
|
+ 70, {21, 108}, MakeInstructionDescriptor(108, SpvOpBranch, 0), 211);
|
|
|
ASSERT_TRUE(make_bvec4.IsApplicable(context.get(), fact_manager));
|
|
|
ASSERT_FALSE(make_bvec4_bad.IsApplicable(context.get(), fact_manager));
|
|
|
make_bvec4.Apply(context.get(), &fact_manager);
|