32 #define _TYPE_TEST(a, b, c)
33 #define _TYPE_TEST_ERR(a, b)
35 #if defined(VC_GCC) && VC_GCC == 0x40801
37 #define _TYPE_TEST(a, b, c) \
38 COMPARE(typeid(a() * b()), typeid(c)); \
39 COMPARE(typeid(a() / b()), typeid(c)); \
40 COMPARE(typeid(a() + b()), typeid(c)); \
41 COMPARE(typeid(a() - b()), typeid(c)); \
42 COMPARE(typeid(a() | b()), typeid(c)); \
43 COMPARE(typeid(a() ^ b()), typeid(c)); \
44 COMPARE(typeid(a() == b()), typeid(c::Mask)); \
45 COMPARE(typeid(a() != b()), typeid(c::Mask)); \
46 COMPARE(typeid(a() <= b()), typeid(c::Mask)); \
47 COMPARE(typeid(a() >= b()), typeid(c::Mask)); \
48 COMPARE(typeid(a() < b()), typeid(c::Mask));
50 #define _TYPE_TEST(a, b, c) \
51 COMPARE(typeid(a() * b()), typeid(c)); \
52 COMPARE(typeid(a() / b()), typeid(c)); \
53 COMPARE(typeid(a() + b()), typeid(c)); \
54 COMPARE(typeid(a() - b()), typeid(c)); \
55 COMPARE(typeid(a() & b()), typeid(c)); \
56 COMPARE(typeid(a() | b()), typeid(c)); \
57 COMPARE(typeid(a() ^ b()), typeid(c)); \
58 COMPARE(typeid(a() == b()), typeid(c::Mask)); \
59 COMPARE(typeid(a() != b()), typeid(c::Mask)); \
60 COMPARE(typeid(a() <= b()), typeid(c::Mask)); \
61 COMPARE(typeid(a() >= b()), typeid(c::Mask)); \
62 COMPARE(typeid(a() < b()), typeid(c::Mask));
64 #define _TYPE_TEST_ERR(a, b) \
65 COMPARE(typeid(a() * b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
66 COMPARE(typeid(a() / b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
67 COMPARE(typeid(a() + b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
68 COMPARE(typeid(a() - b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
69 COMPARE(typeid(a() & b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
70 COMPARE(typeid(a() | b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
71 COMPARE(typeid(a() ^ b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
72 COMPARE(typeid(a() == b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
73 COMPARE(typeid(a() != b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
74 COMPARE(typeid(a() <= b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
75 COMPARE(typeid(a() >= b()), typeid(Vc::Error::invalid_operands_of_types<a, b>)); \
76 COMPARE(typeid(a() < b()), typeid(Vc::Error::invalid_operands_of_types<a, b>));
79 #define TYPE_TEST(a, b, c) \
81 COMPARE(typeid(a() > b()), typeid(c::Mask))
84 struct TestImplicitCast {
85 static bool test(
const T &) {
return true; }
86 static bool test( ... ) {
return false; }
94 VERIFY( TestImplicitCast< int>::test(
double()));
95 VERIFY( TestImplicitCast< int>::test(
float()));
96 VERIFY( TestImplicitCast< int>::test(
Enum()));
97 VERIFY( TestImplicitCast< int>::test(
short()));
99 VERIFY( TestImplicitCast< int>::test(
char()));
100 VERIFY( TestImplicitCast< int>::test(
uint()));
101 VERIFY( TestImplicitCast< int>::test(
long()));
103 VERIFY( TestImplicitCast< int>::test(
bool()));
104 VERIFY( TestImplicitCast<double_v>::test(
double()));
105 VERIFY(!TestImplicitCast<double_v>::test(
float()));
106 VERIFY(!TestImplicitCast<double_v>::test(
int()));
107 VERIFY( TestImplicitCast< float_v>::test(
float()));
108 VERIFY( TestImplicitCast<sfloat_v>::test(
float()));
109 VERIFY( TestImplicitCast< int_v>::test(
int()));
110 VERIFY( TestImplicitCast< uint_v>::test(
uint()));
111 VERIFY( TestImplicitCast< short_v>::test(
short()));
270 int main(
int argc,
char **argv)
VECTOR_NAMESPACE::uint_v uint_v
void testImplicitTypeConversions()
VECTOR_NAMESPACE::sfloat_v sfloat_v
void initTest(int argc, char **argv)
VECTOR_NAMESPACE::short_v short_v
VECTOR_NAMESPACE::ushort_v ushort_v
int main(int argc, char **argv)
VECTOR_NAMESPACE::int_v int_v
VECTOR_NAMESPACE::double_v double_v
unsigned long long ulonglong
#define TYPE_TEST(a, b, c)
VECTOR_NAMESPACE::float_v float_v