#include "src/tint/lang/wgsl/sem/materialize.h"
#include "src/tint/lang/core/type/helper_test.h"
#include "src/tint/lang/wgsl/resolver/resolver.h"
#include "src/tint/lang/wgsl/resolver/resolver_helper_test.h"
#include "src/tint/lang/wgsl/sem/array.h"
#include "src/tint/utils/rtti/switch.h"
#include "gmock/gmock.h"
namespace tint::resolver {
namespace {
usingnamespacetint::core::fluent_types;
usingnamespacetint::core::number_suffixes;
AFloatV;
AFloatM;
AFloatA;
AIntV;
AIntA;
f32V;
f16V;
i32V;
u32V;
f32M;
f16M;
f32A;
f16A;
i32A;
u32A;
constexpr double kTooBigF32 = …;
constexpr double kTooBigF16 = …;
constexpr double kPiF64 = …;
constexpr double kPiF32 = …;
constexpr double kPiF16 = …;
constexpr double kSubnormalF32 = …;
constexpr double kSubnormalF16 = …;
enum class Expectation { … };
static std::ostream& operator<<(std::ostream& o, Expectation m) { … }
template <typename CASE>
class MaterializeTest : public resolver::ResolverTestWithParam<CASE> { … };
namespace materialize_abstract_numeric_to_concrete_type {
enum class Method { … };
static std::ostream& operator<<(std::ostream& o, Method m) { … }
struct Data { … };
template <typename TARGET_TYPE, typename ABSTRACT_TYPE, typename MATERIALIZED_TYPE>
Data Types(MATERIALIZED_TYPE materialized_value, double literal_value) { … }
template <typename TARGET_TYPE, typename ABSTRACT_TYPE>
Data Types() { … }
static std::ostream& operator<<(std::ostream& o, const Data& c) { … }
MaterializeAbstractNumericToConcreteType;
TEST_P(MaterializeAbstractNumericToConcreteType, Test) { … }
constexpr Method kScalarMethods[] = …;
constexpr Method kVectorMethods[] = …;
constexpr Method kMatrixMethods[] = …;
constexpr Method kArrayMethods[] = …;
constexpr Method kSwitchMethods[] = …;
constexpr Method kNoMaterializeMethods[] = …;
constexpr Method kNoMaterializeScalarVectorMethods[] = …;
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
}
namespace materialize_abstract_numeric_to_default_type {
enum class Method { … };
static std::ostream& operator<<(std::ostream& o, Method m) { … }
struct Data { … };
template <typename EXPECTED_TYPE, typename ABSTRACT_TYPE, typename MATERIALIZED_TYPE>
Data Types(MATERIALIZED_TYPE materialized_value, double literal_value) { … }
static std::ostream& operator<<(std::ostream& o, const Data& c) { … }
MaterializeAbstractNumericToDefaultType;
TEST_P(MaterializeAbstractNumericToDefaultType, Test) { … }
constexpr Method kScalarMethods[] = …;
constexpr Method kVectorMethods[] = …;
constexpr Method kMatrixMethods[] = …;
constexpr Method kArrayMethods[] = …;
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
}
namespace materialize_abstract_numeric_to_unrelated_type {
MaterializeAbstractNumericToUnrelatedType;
TEST_F(MaterializeAbstractNumericToUnrelatedType, AIntToStructVarInit) { … }
TEST_F(MaterializeAbstractNumericToUnrelatedType, AIntToStructLetInit) { … }
}
namespace materialize_abstract_structure {
MaterializeAbstractStructure;
TEST_F(MaterializeAbstractStructure, Modf_Scalar_DefaultType) { … }
TEST_F(MaterializeAbstractStructure, Modf_Vector_DefaultType) { … }
TEST_F(MaterializeAbstractStructure, Modf_Scalar_ExplicitType) { … }
TEST_F(MaterializeAbstractStructure, Modf_Vector_ExplicitType) { … }
TEST_F(MaterializeAbstractStructure, Frexp_Scalar_DefaultType) { … }
TEST_F(MaterializeAbstractStructure, Frexp_Vector_DefaultType) { … }
TEST_F(MaterializeAbstractStructure, Frexp_Scalar_ExplicitType) { … }
TEST_F(MaterializeAbstractStructure, Frexp_Vector_ExplicitType) { … }
}
}
}