From fd2e6ac2f0c1b2596835e2ef28d7c72a0f6f394e Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Fri, 20 Jan 2017 13:52:02 -0600 Subject: [PATCH] added more test coverage for vector data types Change-Id: I9f57a8b597bd2ee4b265eadfd0859531497a6ada --- hipamd/tests/src/deviceLib/hipVectorTypes.cpp | 4606 ++++++++++++++++- 1 file changed, 4479 insertions(+), 127 deletions(-) diff --git a/hipamd/tests/src/deviceLib/hipVectorTypes.cpp b/hipamd/tests/src/deviceLib/hipVectorTypes.cpp index 957439c27e..12a8cc76a3 100644 --- a/hipamd/tests/src/deviceLib/hipVectorTypes.cpp +++ b/hipamd/tests/src/deviceLib/hipVectorTypes.cpp @@ -157,8 +157,28 @@ bool TestUChar1() { cmpVal1(f1, 3); f1 = (signed long)1 * f1; cmpVal1(f1, 3); + f1 = f1 * (double)1; + cmpVal1(f1, 3); + f1 = (double)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3); + + uchar1 fa((unsigned char)1); + uchar1 fb((signed char)1); + uchar1 fc((unsigned short)1); + uchar1 fd((signed short)1); + uchar1 fe((unsigned int)1); + uchar1 fg((signed int)1); + uchar1 fh((float)1); + uchar1 fi((double)1); + uchar1 fj((unsigned long)1); + uchar1 fk((signed long)1); + uchar1 fl((unsigned long long)1); + uchar1 fm((signed long long)1); -// signed char sc = 1; f1.x = 3; f2.x = 4; @@ -250,6 +270,79 @@ bool TestUChar2() { cmpVal2(f2, 253); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (float)1; + cmpVal2(f1, 3); + f1 = (float)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (double)1; + cmpVal2(f1, 3); + f1 = (double)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3); + + uchar2 fa1((unsigned char)1); + uchar2 fa2((unsigned char)1, (unsigned char)1); + uchar2 fb1((signed char)1); + uchar2 fb2((signed char)1, (signed char)1); + uchar2 fc1((unsigned short)1); + uchar2 fc2((unsigned short)1,(unsigned short)1); + uchar2 fd1((signed short)1); + uchar2 fd2((signed short)1, (signed short)1); + uchar2 fe1((unsigned int)1); + uchar2 fe2((unsigned int)1, (unsigned int)1); + uchar2 fg1((signed int)1); + uchar2 fg2((signed int)1, (signed int)1); + uchar2 fh1((float)1); + uchar2 fh2((float)1, (float)1); + uchar2 fi1((double)1); + uchar2 fi2((double)1, (double)1); + uchar2 fj1((unsigned long)1); + uchar2 fj2((unsigned long)1, (unsigned long)1); + uchar2 fk1((signed long)1); + uchar2 fk2((signed long)1, (signed long)1); + uchar2 fl1((unsigned long long)1); + uchar2 fl2((unsigned long long)1, (unsigned long long)1); + uchar2 fm1((signed long long)1); + uchar2 fm2((signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f2.x = 4; @@ -351,6 +444,79 @@ bool TestUChar3() { cmpVal3(f2, 253); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + uchar3 fa1((unsigned char)1); + uchar3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + uchar3 fb1((signed char)1); + uchar3 fb2((signed char)1, (signed char)1, (signed char)1); + uchar3 fc1((unsigned short)1); + uchar3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + uchar3 fd1((signed short)1); + uchar3 fd2((signed short)1, (signed short)1, (signed short)1); + uchar3 fe1((unsigned int)1); + uchar3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + uchar3 fg1((signed int)1); + uchar3 fg2((signed int)1, (signed int)1, (signed int)1); + uchar3 fh1((float)1); + uchar3 fh2((float)1, (float)1, (float)1); + uchar3 fi1((double)1); + uchar3 fi2((double)1, (double)1, (double)1); + uchar3 fj1((unsigned long)1); + uchar3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + uchar3 fk1((signed long)1); + uchar3 fk2((signed long)1, (signed long)1, (signed long)1); + uchar3 fl1((unsigned long long)1); + uchar3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + uchar3 fm1((signed long long)1); + uchar3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + f1.x = 3; f1.y = 3; f1.z = 3; @@ -463,6 +629,81 @@ bool TestUChar4() { cmpVal4(f2, 253); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (float)1; + cmpVal4(f1, 3); + f1 = (float)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (double)1; + cmpVal4(f1, 3); + f1 = (double)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3); + + + uchar4 fa1((unsigned char)1); + uchar4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + uchar4 fb1((signed char)1); + uchar4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + uchar4 fc1((unsigned short)1); + uchar4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + uchar4 fd1((signed short)1); + uchar4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + uchar4 fe1((unsigned int)1); + uchar4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + uchar4 fg1((signed int)1); + uchar4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + uchar4 fh1((float)1); + uchar4 fh2((float)1, (float)1, (float)1, (float)1); + uchar4 fi1((double)1); + uchar4 fi2((double)1, (double)1, (double)1, (double)1); + uchar4 fj1((unsigned long)1); + uchar4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + uchar4 fk1((signed long)1); + uchar4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + uchar4 fl1((unsigned long long)1); + uchar4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + uchar4 fm1((signed long long)1); + uchar4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + f1.x = 3; f1.y = 3; f1.z = 3; @@ -487,6 +728,7 @@ bool TestUChar4() { return true; } + bool TestChar1() { char1 f1, f2, f3; f1.x = 1; @@ -554,6 +796,66 @@ bool TestChar1() { cmpVal1(f2, (char)253); assert(!f1 == false); + f1.x = 3; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (float)1; + cmpVal1(f1, 3); + f1 = (float)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (double)1; + cmpVal1(f1, 3); + f1 = (double)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3); + + char1 fa((unsigned char)1); + char1 fb((signed char)1); + char1 fc((unsigned short)1); + char1 fd((signed short)1); + char1 fe((unsigned int)1); + char1 fg((signed int)1); + char1 fh((float)1); + char1 fi((double)1); + char1 fj((unsigned long)1); + char1 fk((signed long)1); + char1 fl((unsigned long long)1); + char1 fm((signed long long)1); + + f1.x = 3; f2.x = 4; f3.x = 3; @@ -644,6 +946,79 @@ bool TestChar2() { cmpVal2(f2, (char)253); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (float)1; + cmpVal2(f1, 3); + f1 = (float)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (double)1; + cmpVal2(f1, 3); + f1 = (double)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3); + + char2 fa1((unsigned char)1); + char2 fa2((unsigned char)1, (unsigned char)1); + char2 fb1((signed char)1); + char2 fb2((signed char)1, (signed char)1); + char2 fc1((unsigned short)1); + char2 fc2((unsigned short)1,(unsigned short)1); + char2 fd1((signed short)1); + char2 fd2((signed short)1, (signed short)1); + char2 fe1((unsigned int)1); + char2 fe2((unsigned int)1, (unsigned int)1); + char2 fg1((signed int)1); + char2 fg2((signed int)1, (signed int)1); + char2 fh1((float)1); + char2 fh2((float)1, (float)1); + char2 fi1((double)1); + char2 fi2((double)1, (double)1); + char2 fj1((unsigned long)1); + char2 fj2((unsigned long)1, (unsigned long)1); + char2 fk1((signed long)1); + char2 fk2((signed long)1, (signed long)1); + char2 fl1((unsigned long long)1); + char2 fl2((unsigned long long)1, (unsigned long long)1); + char2 fm1((signed long long)1); + char2 fm2((signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f2.x = 4; @@ -745,6 +1120,80 @@ bool TestChar3() { cmpVal3(f2, (char)253); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + char3 fa1((unsigned char)1); + char3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + char3 fb1((signed char)1); + char3 fb2((signed char)1, (signed char)1, (signed char)1); + char3 fc1((unsigned short)1); + char3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + char3 fd1((signed short)1); + char3 fd2((signed short)1, (signed short)1, (signed short)1); + char3 fe1((unsigned int)1); + char3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + char3 fg1((signed int)1); + char3 fg2((signed int)1, (signed int)1, (signed int)1); + char3 fh1((float)1); + char3 fh2((float)1, (float)1, (float)1); + char3 fi1((double)1); + char3 fi2((double)1, (double)1, (double)1); + char3 fj1((unsigned long)1); + char3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + char3 fk1((signed long)1); + char3 fk2((signed long)1, (signed long)1, (signed long)1); + char3 fl1((unsigned long long)1); + char3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + char3 fm1((signed long long)1); + char3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -857,6 +1306,81 @@ bool TestChar4() { cmpVal4(f2, (char)253); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (float)1; + cmpVal4(f1, 3); + f1 = (float)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (double)1; + cmpVal4(f1, 3); + f1 = (double)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3); + + char4 fa1((unsigned char)1); + char4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + char4 fb1((signed char)1); + char4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + char4 fc1((unsigned short)1); + char4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + char4 fd1((signed short)1); + char4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + char4 fe1((unsigned int)1); + char4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + char4 fg1((signed int)1); + char4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + char4 fh1((float)1); + char4 fh2((float)1, (float)1, (float)1, (float)1); + char4 fi1((double)1); + char4 fi2((double)1, (double)1, (double)1, (double)1); + char4 fj1((unsigned long)1); + char4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + char4 fk1((signed long)1); + char4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + char4 fl1((unsigned long long)1); + char4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + char4 fm1((signed long long)1); + char4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -881,6 +1405,7 @@ bool TestChar4() { return true; } + bool TestUShort1() { ushort1 f1, f2, f3; f1.x = 1; @@ -948,6 +1473,66 @@ bool TestUShort1() { cmpVal1(f2, (unsigned short)65533); assert(!f1 == false); + f1.x = 3; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (float)1; + cmpVal1(f1, 3); + f1 = (float)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (double)1; + cmpVal1(f1, 3); + f1 = (double)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3); + + ushort1 fa((unsigned char)1); + ushort1 fb((signed char)1); + ushort1 fc((unsigned short)1); + ushort1 fd((signed short)1); + ushort1 fe((unsigned int)1); + ushort1 fg((signed int)1); + ushort1 fh((float)1); + ushort1 fi((double)1); + ushort1 fj((unsigned long)1); + ushort1 fk((signed long)1); + ushort1 fl((unsigned long long)1); + ushort1 fm((signed long long)1); + + f1.x = 3; f2.x = 4; f3.x = 3; @@ -1038,6 +1623,79 @@ bool TestUShort2() { cmpVal2(f2, (unsigned short)65533); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (float)1; + cmpVal2(f1, 3); + f1 = (float)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (double)1; + cmpVal2(f1, 3); + f1 = (double)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3); + + ushort2 fa1((unsigned char)1); + ushort2 fa2((unsigned char)1, (unsigned char)1); + ushort2 fb1((signed char)1); + ushort2 fb2((signed char)1, (signed char)1); + ushort2 fc1((unsigned short)1); + ushort2 fc2((unsigned short)1, (unsigned short)1); + ushort2 fd1((signed short)1); + ushort2 fd2((signed short)1, (signed short)1); + ushort2 fe1((unsigned int)1); + ushort2 fe2((unsigned int)1, (unsigned int)1); + ushort2 fg1((signed int)1); + ushort2 fg2((signed int)1, (signed int)1); + ushort2 fh1((float)1); + ushort2 fh2((float)1, (float)1); + ushort2 fi1((double)1); + ushort2 fi2((double)1, (double)1); + ushort2 fj1((unsigned long)1); + ushort2 fj2((unsigned long)1, (unsigned long)1); + ushort2 fk1((signed long)1); + ushort2 fk2((signed long)1, (signed long)1); + ushort2 fl1((unsigned long long)1); + ushort2 fl2((unsigned long long)1, (unsigned long long)1); + ushort2 fm1((signed long long)1); + ushort2 fm2((signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f2.x = 4; @@ -1139,6 +1797,80 @@ bool TestUShort3() { cmpVal3(f2, (unsigned short)65533); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + ushort3 fa1((unsigned char)1); + ushort3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + ushort3 fb1((signed char)1); + ushort3 fb2((signed char)1, (signed char)1, (signed char)1); + ushort3 fc1((unsigned short)1); + ushort3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + ushort3 fd1((signed short)1); + ushort3 fd2((signed short)1, (signed short)1, (signed short)1); + ushort3 fe1((unsigned int)1); + ushort3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + ushort3 fg1((signed int)1); + ushort3 fg2((signed int)1, (signed int)1, (signed int)1); + ushort3 fh1((float)1); + ushort3 fh2((float)1, (float)1, (float)1); + ushort3 fi1((double)1); + ushort3 fi2((double)1, (double)1, (double)1); + ushort3 fj1((unsigned long)1); + ushort3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + ushort3 fk1((signed long)1); + ushort3 fk2((signed long)1, (signed long)1, (signed long)1); + ushort3 fl1((unsigned long long)1); + ushort3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + ushort3 fm1((signed long long)1); + ushort3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -1251,6 +1983,80 @@ bool TestUShort4() { cmpVal4(f2, (unsigned short)65533); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (float)1; + cmpVal4(f1, 3); + f1 = (float)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (double)1; + cmpVal4(f1, 3); + f1 = (double)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3); + + ushort4 fa1((unsigned char)1); + ushort4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + ushort4 fb1((signed char)1); + ushort4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + ushort4 fc1((unsigned short)1); + ushort4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + ushort4 fd1((signed short)1); + ushort4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + ushort4 fe1((unsigned int)1); + ushort4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + ushort4 fg1((signed int)1); + ushort4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + ushort4 fh1((float)1); + ushort4 fh2((float)1, (float)1, (float)1, (float)1); + ushort4 fi1((double)1); + ushort4 fi2((double)1, (double)1, (double)1, (double)1); + ushort4 fj1((unsigned long)1); + ushort4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + ushort4 fk1((signed long)1); + ushort4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + ushort4 fl1((unsigned long long)1); + ushort4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + ushort4 fm1((signed long long)1); + ushort4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + f1.x = 3; f1.y = 3; f1.z = 3; @@ -1275,6 +2081,7 @@ bool TestUShort4() { return true; } + bool TestShort1() { short1 f1, f2, f3; f1.x = 1; @@ -1342,6 +2149,66 @@ bool TestShort1() { cmpVal1(f2, (signed short)65533); assert(!f1 == false); + f1.x = 3; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (float)1; + cmpVal1(f1, 3); + f1 = (float)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (double)1; + cmpVal1(f1, 3); + f1 = (double)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3); + + short1 fa((unsigned char)1); + short1 fb((signed char)1); + short1 fc((unsigned short)1); + short1 fd((signed short)1); + short1 fe((unsigned int)1); + short1 fg((signed int)1); + short1 fh((float)1); + short1 fi((double)1); + short1 fj((unsigned long)1); + short1 fk((signed long)1); + short1 fl((unsigned long long)1); + short1 fm((signed long long)1); + + f1.x = 3; f2.x = 4; f3.x = 3; @@ -1432,6 +2299,80 @@ bool TestShort2() { cmpVal2(f2, (signed short)65533); assert(!f1 == false); + cmpVal2(f1, 3); + f1.x = 3; + f1.y = 3; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (float)1; + cmpVal2(f1, 3); + f1 = (float)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (double)1; + cmpVal2(f1, 3); + f1 = (double)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3); + + short2 fa1((unsigned char)1); + short2 fa2((unsigned char)1, (unsigned char)1); + short2 fb1((signed char)1); + short2 fb2((signed char)1, (signed char)1); + short2 fc1((unsigned short)1); + short2 fc2((unsigned short)1,(unsigned short)1); + short2 fd1((signed short)1); + short2 fd2((signed short)1, (signed short)1); + short2 fe1((unsigned int)1); + short2 fe2((unsigned int)1, (unsigned int)1); + short2 fg1((signed int)1); + short2 fg2((signed int)1, (signed int)1); + short2 fh1((float)1); + short2 fh2((float)1, (float)1); + short2 fi1((double)1); + short2 fi2((double)1, (double)1); + short2 fj1((unsigned long)1); + short2 fj2((unsigned long)1, (unsigned long)1); + short2 fk1((signed long)1); + short2 fk2((signed long)1, (signed long)1); + short2 fl1((unsigned long long)1); + short2 fl2((unsigned long long)1, (unsigned long long)1); + short2 fm1((signed long long)1); + short2 fm2((signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f2.x = 4; @@ -1533,6 +2474,79 @@ bool TestShort3() { cmpVal3(f2, (signed short)65533); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + short3 fa1((unsigned char)1); + short3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + short3 fb1((signed char)1); + short3 fb2((signed char)1, (signed char)1, (signed char)1); + short3 fc1((unsigned short)1); + short3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + short3 fd1((signed short)1); + short3 fd2((signed short)1, (signed short)1, (signed short)1); + short3 fe1((unsigned int)1); + short3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + short3 fg1((signed int)1); + short3 fg2((signed int)1, (signed int)1, (signed int)1); + short3 fh1((float)1); + short3 fh2((float)1, (float)1, (float)1); + short3 fi1((double)1); + short3 fi2((double)1, (double)1, (double)1); + short3 fj1((unsigned long)1); + short3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + short3 fk1((signed long)1); + short3 fk2((signed long)1, (signed long)1, (signed long)1); + short3 fl1((unsigned long long)1); + short3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + short3 fm1((signed long long)1); + short3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + f1.x = 3; f1.y = 3; f1.z = 3; @@ -1645,6 +2659,81 @@ bool TestShort4() { cmpVal4(f2, (signed short)65533); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (float)1; + cmpVal4(f1, 3); + f1 = (float)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (double)1; + cmpVal4(f1, 3); + f1 = (double)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3); + + short4 fa1((unsigned char)1); + short4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + short4 fb1((signed char)1); + short4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + short4 fc1((unsigned short)1); + short4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + short4 fd1((signed short)1); + short4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + short4 fe1((unsigned int)1); + short4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + short4 fg1((signed int)1); + short4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + short4 fh1((float)1); + short4 fh2((float)1, (float)1, (float)1, (float)1); + short4 fi1((double)1); + short4 fi2((double)1, (double)1, (double)1, (double)1); + short4 fj1((unsigned long)1); + short4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + short4 fk1((signed long)1); + short4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + short4 fl1((unsigned long long)1); + short4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + short4 fm1((signed long long)1); + short4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -1737,6 +2826,66 @@ bool TestUInt1() { cmpVal1(f2, (unsigned int)4294967293); assert(!f1 == false); + f1.x = 3; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (float)1; + cmpVal1(f1, 3); + f1 = (float)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (double)1; + cmpVal1(f1, 3); + f1 = (double)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3); + + uint1 fa((unsigned char)1); + uint1 fb((signed char)1); + uint1 fc((unsigned short)1); + uint1 fd((signed short)1); + uint1 fe((unsigned int)1); + uint1 fg((signed int)1); + uint1 fh((float)1); + uint1 fi((double)1); + uint1 fj((unsigned long)1); + uint1 fk((signed long)1); + uint1 fl((unsigned long long)1); + uint1 fm((signed long long)1); + + f1.x = 3; f2.x = 4; f3.x = 3; @@ -1827,6 +2976,79 @@ bool TestUInt2() { cmpVal2(f2, (unsigned int)4294967293); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (float)1; + cmpVal2(f1, 3); + f1 = (float)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (double)1; + cmpVal2(f1, 3); + f1 = (double)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3); + + uint2 fa1((unsigned char)1); + uint2 fa2((unsigned char)1, (unsigned char)1); + uint2 fb1((signed char)1); + uint2 fb2((signed char)1, (signed char)1); + uint2 fc1((unsigned short)1); + uint2 fc2((unsigned short)1,(unsigned short)1); + uint2 fd1((signed short)1); + uint2 fd2((signed short)1, (signed short)1); + uint2 fe1((unsigned int)1); + uint2 fe2((unsigned int)1, (unsigned int)1); + uint2 fg1((signed int)1); + uint2 fg2((signed int)1, (signed int)1); + uint2 fh1((float)1); + uint2 fh2((float)1, (float)1); + uint2 fi1((double)1); + uint2 fi2((double)1, (double)1); + uint2 fj1((unsigned long)1); + uint2 fj2((unsigned long)1, (unsigned long)1); + uint2 fk1((signed long)1); + uint2 fk2((signed long)1, (signed long)1); + uint2 fl1((unsigned long long)1); + uint2 fl2((unsigned long long)1, (unsigned long long)1); + uint2 fm1((signed long long)1); + uint2 fm2((signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f2.x = 4; @@ -1928,6 +3150,80 @@ bool TestUInt3() { cmpVal3(f2, (unsigned int)4294967293); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + uint3 fa1((unsigned char)1); + uint3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + uint3 fb1((signed char)1); + uint3 fb2((signed char)1, (signed char)1, (signed char)1); + uint3 fc1((unsigned short)1); + uint3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + uint3 fd1((signed short)1); + uint3 fd2((signed short)1, (signed short)1, (signed short)1); + uint3 fe1((unsigned int)1); + uint3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + uint3 fg1((signed int)1); + uint3 fg2((signed int)1, (signed int)1, (signed int)1); + uint3 fh1((float)1); + uint3 fh2((float)1, (float)1, (float)1); + uint3 fi1((double)1); + uint3 fi2((double)1, (double)1, (double)1); + uint3 fj1((unsigned long)1); + uint3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + uint3 fk1((signed long)1); + uint3 fk2((signed long)1, (signed long)1, (signed long)1); + uint3 fl1((unsigned long long)1); + uint3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + uint3 fm1((signed long long)1); + uint3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -2040,6 +3336,81 @@ bool TestUInt4() { cmpVal4(f2, (unsigned int)4294967293); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (float)1; + cmpVal4(f1, 3); + f1 = (float)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (double)1; + cmpVal4(f1, 3); + f1 = (double)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3); + + uint4 fa1((unsigned char)1); + uint4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + uint4 fb1((signed char)1); + uint4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + uint4 fc1((unsigned short)1); + uint4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + uint4 fd1((signed short)1); + uint4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + uint4 fe1((unsigned int)1); + uint4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + uint4 fg1((signed int)1); + uint4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + uint4 fh1((float)1); + uint4 fh2((float)1, (float)1, (float)1, (float)1); + uint4 fi1((double)1); + uint4 fi2((double)1, (double)1, (double)1, (double)1); + uint4 fj1((unsigned long)1); + uint4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + uint4 fk1((signed long)1); + uint4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + uint4 fl1((unsigned long long)1); + uint4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + uint4 fm1((signed long long)1); + uint4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -2064,6 +3435,7 @@ bool TestUInt4() { return true; } + bool TestInt1() { int1 f1, f2, f3; f1.x = 1; @@ -2131,6 +3503,66 @@ bool TestInt1() { cmpVal1(f2, (signed int)4294967293); assert(!f1 == false); + f1.x = 3; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (float)1; + cmpVal1(f1, 3); + f1 = (float)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (double)1; + cmpVal1(f1, 3); + f1 = (double)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3); + + int1 fa((unsigned char)1); + int1 fb((signed char)1); + int1 fc((unsigned short)1); + int1 fd((signed short)1); + int1 fe((unsigned int)1); + int1 fg((signed int)1); + int1 fh((float)1); + int1 fi((double)1); + int1 fj((unsigned long)1); + int1 fk((signed long)1); + int1 fl((unsigned long long)1); + int1 fm((signed long long)1); + + f1.x = 3; f2.x = 4; f3.x = 3; @@ -2221,6 +3653,79 @@ bool TestInt2() { cmpVal2(f2, (signed int)4294967293); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (float)1; + cmpVal2(f1, 3); + f1 = (float)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (double)1; + cmpVal2(f1, 3); + f1 = (double)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3); + + int2 fa1((unsigned char)1); + int2 fa2((unsigned char)1, (unsigned char)1); + int2 fb1((signed char)1); + int2 fb2((signed char)1, (signed char)1); + int2 fc1((unsigned short)1); + int2 fc2((unsigned short)1,(unsigned short)1); + int2 fd1((signed short)1); + int2 fd2((signed short)1, (signed short)1); + int2 fe1((unsigned int)1); + int2 fe2((unsigned int)1, (unsigned int)1); + int2 fg1((signed int)1); + int2 fg2((signed int)1, (signed int)1); + int2 fh1((float)1); + int2 fh2((float)1, (float)1); + int2 fi1((double)1); + int2 fi2((double)1, (double)1); + int2 fj1((unsigned long)1); + int2 fj2((unsigned long)1, (unsigned long)1); + int2 fk1((signed long)1); + int2 fk2((signed long)1, (signed long)1); + int2 fl1((unsigned long long)1); + int2 fl2((unsigned long long)1, (unsigned long long)1); + int2 fm1((signed long long)1); + int2 fm2((signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f2.x = 4; @@ -2322,6 +3827,80 @@ bool TestInt3() { cmpVal3(f2, (signed int)4294967293); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + int3 fa1((unsigned char)1); + int3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + int3 fb1((signed char)1); + int3 fb2((signed char)1, (signed char)1, (signed char)1); + int3 fc1((unsigned short)1); + int3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + int3 fd1((signed short)1); + int3 fd2((signed short)1, (signed short)1, (signed short)1); + int3 fe1((unsigned int)1); + int3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + int3 fg1((signed int)1); + int3 fg2((signed int)1, (signed int)1, (signed int)1); + int3 fh1((float)1); + int3 fh2((float)1, (float)1, (float)1); + int3 fi1((double)1); + int3 fi2((double)1, (double)1, (double)1); + int3 fj1((unsigned long)1); + int3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + int3 fk1((signed long)1); + int3 fk2((signed long)1, (signed long)1, (signed long)1); + int3 fl1((unsigned long long)1); + int3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + int3 fm1((signed long long)1); + int3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -2434,6 +4013,81 @@ bool TestInt4() { cmpVal4(f2, (signed int)4294967293); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (float)1; + cmpVal4(f1, 3); + f1 = (float)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (double)1; + cmpVal4(f1, 3); + f1 = (double)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3); + + int4 fa1((unsigned char)1); + int4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + int4 fb1((signed char)1); + int4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + int4 fc1((unsigned short)1); + int4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + int4 fd1((signed short)1); + int4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + int4 fe1((unsigned int)1); + int4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + int4 fg1((signed int)1); + int4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + int4 fh1((float)1); + int4 fh2((float)1, (float)1, (float)1, (float)1); + int4 fi1((double)1); + int4 fi2((double)1, (double)1, (double)1, (double)1); + int4 fj1((unsigned long)1); + int4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + int4 fk1((signed long)1); + int4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + int4 fl1((unsigned long long)1); + int4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + int4 fm1((signed long long)1); + int4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -2458,6 +4112,505 @@ bool TestInt4() { return true; } + +bool TestFloat1() { + float1 f1, f2, f3; + f1.x = 1.0f; + f2.x = 1.0f; + f3 = f1 + f2; + cmpVal1(f3, 2.0f); + f2 = f3 - f1; + cmpVal1(f2, 1.0f); + f1 = f2 * f3; + cmpVal1(f1, 2.0f); + f2 = f1 / f3; + cmpVal1(f2, 2.0f/2.0f); + f1 += f2; + cmpVal1(f1, 3.0f); + f1 -= f2; + cmpVal1(f1, 2.0f); + f1 *= f2; + cmpVal1(f1, 2.0f); + f1 /= f2; + cmpVal1(f1, 2.0f); + f2 = f1++; + cmpVal1(f1, 3.0f); + cmpVal1(f2, 2.0f); + f2 = f1--; + cmpVal1(f2, 3.0f); + cmpVal1(f1, 2.0f); + f2 = ++f1; + cmpVal1(f1, 3.0f); + cmpVal1(f2, 3.0f); + f2 = --f1; + cmpVal1(f1, 2.0f); + cmpVal1(f1, 2.0f); + + f1.x = 3.0f; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3.0f); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3.0f); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3.0f); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3.0f); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3.0f); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3.0f); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3.0f); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3.0f); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3.0f); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3.0f); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3.0f); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3.0f); + f1 = f1 * (float)1; + cmpVal1(f1, 3.0f); + f1 = (float)1 * f1; + cmpVal1(f1, 3.0f); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3.0f); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3.0f); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3.0f); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3.0f); + f1 = f1 * (double)1; + cmpVal1(f1, 3.0f); + f1 = (double)1 * f1; + cmpVal1(f1, 3.0f); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3.0f); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3.0f); + + float1 fa((unsigned char)1); + float1 fb((signed char)1); + float1 fc((unsigned short)1); + float1 fd((signed short)1); + float1 fe((unsigned int)1); + float1 fg((signed int)1); + float1 fh((float)1); + float1 fi((double)1); + float1 fj((unsigned long)1); + float1 fk((signed long)1); + float1 fl((unsigned long long)1); + float1 fm((signed long long)1); + + + f1.x = 3.0f; + f2.x = 4.0f; + f3.x = 3.0f; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + return true; +} + +bool TestFloat2() { + float2 f1, f2, f3; + f1.x = 1.0f; + f1.y = 1.0f; + f2.x = 1.0f; + f2.y = 1.0f; + f3 = f1 + f2; + cmpVal2(f3, 2.0f); + f2 = f3 - f1; + cmpVal2(f2, 1.0f); + f1 = f2 * f3; + cmpVal2(f1, 2.0f); + f2 = f1 / f3; + cmpVal2(f2, 2.0f/2.0f); + f1 += f2; + cmpVal2(f1, 3.0f); + f1 -= f2; + cmpVal2(f1, 2.0f); + f1 *= f2; + cmpVal2(f1, 2.0f); + f1 /= f2; + cmpVal2(f1, 2.0f); + + f2 = f1++; + cmpVal2(f1, 3.0f); + cmpVal2(f2, 2.0f); + f2 = f1--; + cmpVal2(f2, 3.0f); + cmpVal2(f1, 2.0f); + f2 = ++f1; + cmpVal2(f1, 3.0f); + cmpVal2(f2, 3.0f); + f2 = --f1; + cmpVal2(f1, 2.0f); + cmpVal2(f1, 2.0f); + + f1.x = 3.0f; + f1.y = 3.0f; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3.0f); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3.0f); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3.0f); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3.0f); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3.0f); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3.0f); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3.0f); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3.0f); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3.0f); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3.0f); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3.0f); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3.0f); + f1 = f1 * (float)1; + cmpVal2(f1, 3.0f); + f1 = (float)1 * f1; + cmpVal2(f1, 3.0f); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3.0f); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3.0f); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3.0f); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3.0f); + f1 = f1 * (double)1; + cmpVal2(f1, 3.0f); + f1 = (double)1 * f1; + cmpVal2(f1, 3.0f); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3.0f); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3.0f); + + float2 fa1((unsigned char)1); + float2 fa2((unsigned char)1, (unsigned char)1); + float2 fb1((signed char)1); + float2 fb2((signed char)1, (signed char)1); + float2 fc1((unsigned short)1); + float2 fc2((unsigned short)1,(unsigned short)1); + float2 fd1((signed short)1); + float2 fd2((signed short)1, (signed short)1); + float2 fe1((unsigned int)1); + float2 fe2((unsigned int)1, (unsigned int)1); + float2 fg1((signed int)1); + float2 fg2((signed int)1, (signed int)1); + float2 fh1((float)1); + float2 fh2((float)1, (float)1); + float2 fi1((double)1); + float2 fi2((double)1, (double)1); + float2 fj1((unsigned long)1); + float2 fj2((unsigned long)1, (unsigned long)1); + float2 fk1((signed long)1); + float2 fk2((signed long)1, (signed long)1); + float2 fl1((unsigned long long)1); + float2 fl2((unsigned long long)1, (unsigned long long)1); + float2 fm1((signed long long)1); + float2 fm2((signed long long)1, (signed long long)1); + + + f1.x = 3.0f; + f1.y = 3.0f; + f2.x = 4.0f; + f2.y = 4.0f; + f3.x = 3.0f; + f3.y = 3.0f; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + + return true; +} + +bool TestFloat3() { + float3 f1, f2, f3; + f1.x = 1.0f; + f1.y = 1.0f; + f1.z = 1.0f; + f2.x = 1.0f; + f2.y = 1.0f; + f2.z = 1.0f; + f3 = f1 + f2; + cmpVal3(f3, 2.0f); + f2 = f3 - f1; + cmpVal3(f2, 1.0f); + f1 = f2 * f3; + cmpVal3(f1, 2.0f); + f2 = f1 / f3; + cmpVal3(f2, 2.0f/2.0f); + f1 += f2; + cmpVal3(f1, 3.0f); + f1 -= f2; + cmpVal3(f1, 2.0f); + f1 *= f2; + cmpVal3(f1, 2.0f); + f1 /= f2; + f2 = f1++; + cmpVal3(f1, 3.0f); + cmpVal3(f2, 2.0f); + f2 = f1--; + cmpVal3(f2, 3.0f); + cmpVal3(f1, 2.0f); + f2 = ++f1; + cmpVal3(f1, 3.0f); + cmpVal3(f2, 3.0f); + f2 = --f1; + cmpVal3(f1, 2.0f); + cmpVal3(f1, 2.0f); + + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + float3 fa1((unsigned char)1); + float3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + float3 fb1((signed char)1); + float3 fb2((signed char)1, (signed char)1, (signed char)1); + float3 fc1((unsigned short)1); + float3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + float3 fd1((signed short)1); + float3 fd2((signed short)1, (signed short)1, (signed short)1); + float3 fe1((unsigned int)1); + float3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + float3 fg1((signed int)1); + float3 fg2((signed int)1, (signed int)1, (signed int)1); + float3 fh1((float)1); + float3 fh2((float)1, (float)1, (float)1); + float3 fi1((double)1); + float3 fi2((double)1, (double)1, (double)1); + float3 fj1((unsigned long)1); + float3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + float3 fk1((signed long)1); + float3 fk2((signed long)1, (signed long)1, (signed long)1); + float3 fl1((unsigned long long)1); + float3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + float3 fm1((signed long long)1); + float3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + + + f1.x = 3.0f; + f1.y = 3.0f; + f1.z = 3.0f; + f2.x = 4.0f; + f2.y = 4.0f; + f2.z = 4.0f; + f3.x = 3.0f; + f3.y = 3.0f; + f3.z = 3.0f; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + + return true; +} + +bool TestFloat4() { + float4 f1, f2, f3; + f1.x = 1.0f; + f1.y = 1.0f; + f1.z = 1.0f; + f1.w = 1.0f; + f2.x = 1.0f; + f2.y = 1.0f; + f2.z = 1.0f; + f2.w = 1.0f; + f3 = f1 + f2; + cmpVal4(f3, 2.0f); + f2 = f3 - f1; + cmpVal4(f2, 1.0f); + f1 = f2 * f3; + cmpVal4(f1, 2.0f); + f2 = f1 / f3; + cmpVal4(f2, 2.0f/2.0f); + f1 += f2; + cmpVal4(f1, 3.0f); + f1 -= f2; + cmpVal4(f1, 2.0f); + f1 *= f2; + cmpVal4(f1, 2.0f); + f1 /= f2; + f2 = f1++; + cmpVal4(f1, 3.0f); + cmpVal4(f2, 2.0f); + f2 = f1--; + cmpVal4(f2, 3.0f); + cmpVal4(f1, 2.0f); + f2 = ++f1; + cmpVal4(f1, 3.0f); + cmpVal4(f2, 3.0f); + f2 = --f1; + cmpVal4(f1, 2.0f); + cmpVal4(f1, 2.0f); + + f1.x = 3.0f; + f1.y = 3.0f; + f1.z = 3.0f; + f1.w = 3.0f; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3.0f); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3.0f); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3.0f); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3.0f); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3.0f); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3.0f); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3.0f); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3.0f); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3.0f); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3.0f); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3.0f); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3.0f); + f1 = f1 * (float)1; + cmpVal4(f1, 3.0f); + f1 = (float)1 * f1; + cmpVal4(f1, 3.0f); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3.0f); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3.0f); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3.0f); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3.0f); + f1 = f1 * (double)1; + cmpVal4(f1, 3.0f); + f1 = (double)1 * f1; + cmpVal4(f1, 3.0f); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3.0f); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3.0f); + + float4 fa1((unsigned char)1); + float4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + float4 fb1((signed char)1); + float4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + float4 fc1((unsigned short)1); + float4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + float4 fd1((signed short)1); + float4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + float4 fe1((unsigned int)1); + float4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + float4 fg1((signed int)1); + float4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + float4 fh1((float)1); + float4 fh2((float)1, (float)1, (float)1, (float)1); + float4 fi1((double)1); + float4 fi2((double)1, (double)1, (double)1, (double)1); + float4 fj1((unsigned long)1); + float4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + float4 fk1((signed long)1); + float4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + float4 fl1((unsigned long long)1); + float4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + float4 fm1((signed long long)1); + float4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + + + f1.x = 3.0f; + f1.y = 3.0f; + f1.z = 3.0f; + f1.w = 3.0f; + f2.x = 4.0f; + f2.y = 4.0f; + f2.z = 4.0f; + f2.w = 4.0f; + f3.x = 3.0f; + f3.y = 3.0f; + f3.z = 3.0f; + f3.w = 3.0f; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + return true; +} + + bool TestULong1() { ulong1 f1, f2, f3; f1.x = 1; @@ -2525,6 +4678,66 @@ bool TestULong1() { cmpVal1(f2, 18446744073709551613UL); assert(!f1 == false); + f1.x = 3; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (float)1; + cmpVal1(f1, 3); + f1 = (float)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (double)1; + cmpVal1(f1, 3); + f1 = (double)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3); + + ulong1 fa((unsigned char)1); + ulong1 fb((signed char)1); + ulong1 fc((unsigned short)1); + ulong1 fd((signed short)1); + ulong1 fe((unsigned int)1); + ulong1 fg((signed int)1); + ulong1 fh((float)1); + ulong1 fi((double)1); + ulong1 fj((unsigned long)1); + ulong1 fk((signed long)1); + ulong1 fl((unsigned long long)1); + ulong1 fm((signed long long)1); + + f1.x = 3; f2.x = 4; f3.x = 3; @@ -2615,6 +4828,79 @@ bool TestULong2() { cmpVal2(f2, 18446744073709551613UL); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (float)1; + cmpVal2(f1, 3); + f1 = (float)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (double)1; + cmpVal2(f1, 3); + f1 = (double)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3); + + ulong2 fa1((unsigned char)1); + ulong2 fa2((unsigned char)1, (unsigned char)1); + ulong2 fb1((signed char)1); + ulong2 fb2((signed char)1, (signed char)1); + ulong2 fc1((unsigned short)1); + ulong2 fc2((unsigned short)1,(unsigned short)1); + ulong2 fd1((signed short)1); + ulong2 fd2((signed short)1, (signed short)1); + ulong2 fe1((unsigned int)1); + ulong2 fe2((unsigned int)1, (unsigned int)1); + ulong2 fg1((signed int)1); + ulong2 fg2((signed int)1, (signed int)1); + ulong2 fh1((float)1); + ulong2 fh2((float)1, (float)1); + ulong2 fi1((double)1); + ulong2 fi2((double)1, (double)1); + ulong2 fj1((unsigned long)1); + ulong2 fj2((unsigned long)1, (unsigned long)1); + ulong2 fk1((signed long)1); + ulong2 fk2((signed long)1, (signed long)1); + ulong2 fl1((unsigned long long)1); + ulong2 fl2((unsigned long long)1, (unsigned long long)1); + ulong2 fm1((signed long long)1); + ulong2 fm2((signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f2.x = 4; @@ -2716,6 +5002,80 @@ bool TestULong3() { cmpVal3(f2, 18446744073709551613UL); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + ulong3 fa1((unsigned char)1); + ulong3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + ulong3 fb1((signed char)1); + ulong3 fb2((signed char)1, (signed char)1, (signed char)1); + ulong3 fc1((unsigned short)1); + ulong3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + ulong3 fd1((signed short)1); + ulong3 fd2((signed short)1, (signed short)1, (signed short)1); + ulong3 fe1((unsigned int)1); + ulong3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + ulong3 fg1((signed int)1); + ulong3 fg2((signed int)1, (signed int)1, (signed int)1); + ulong3 fh1((float)1); + ulong3 fh2((float)1, (float)1, (float)1); + ulong3 fi1((double)1); + ulong3 fi2((double)1, (double)1, (double)1); + ulong3 fj1((unsigned long)1); + ulong3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + ulong3 fk1((signed long)1); + ulong3 fk2((signed long)1, (signed long)1, (signed long)1); + ulong3 fl1((unsigned long long)1); + ulong3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + ulong3 fm1((signed long long)1); + ulong3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -2828,6 +5188,81 @@ bool TestULong4() { cmpVal4(f2, 18446744073709551613UL); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (float)1; + cmpVal4(f1, 3); + f1 = (float)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (double)1; + cmpVal4(f1, 3); + f1 = (double)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3); + + ulong4 fa1((unsigned char)1); + ulong4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + ulong4 fb1((signed char)1); + ulong4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + ulong4 fc1((unsigned short)1); + ulong4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + ulong4 fd1((signed short)1); + ulong4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + ulong4 fe1((unsigned int)1); + ulong4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + ulong4 fg1((signed int)1); + ulong4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + ulong4 fh1((float)1); + ulong4 fh2((float)1, (float)1, (float)1, (float)1); + ulong4 fi1((double)1); + ulong4 fi2((double)1, (double)1, (double)1, (double)1); + ulong4 fj1((unsigned long)1); + ulong4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + ulong4 fk1((signed long)1); + ulong4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + ulong4 fl1((unsigned long long)1); + ulong4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + ulong4 fm1((signed long long)1); + ulong4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -2852,6 +5287,7 @@ bool TestULong4() { return true; } + bool TestLong1() { long1 f1, f2, f3; f1.x = 1; @@ -2919,6 +5355,66 @@ bool TestLong1() { cmpVal1(f2, -3); assert(!f1 == false); + f1.x = 3; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (float)1; + cmpVal1(f1, 3); + f1 = (float)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (double)1; + cmpVal1(f1, 3); + f1 = (double)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3); + + long1 fa((unsigned char)1); + long1 fb((signed char)1); + long1 fc((unsigned short)1); + long1 fd((signed short)1); + long1 fe((unsigned int)1); + long1 fg((signed int)1); + long1 fh((float)1); + long1 fi((double)1); + long1 fj((unsigned long)1); + long1 fk((signed long)1); + long1 fl((unsigned long long)1); + long1 fm((signed long long)1); + + f1.x = 3; f2.x = 4; f3.x = 3; @@ -3009,6 +5505,79 @@ bool TestLong2() { cmpVal2(f2, -3); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (float)1; + cmpVal2(f1, 3); + f1 = (float)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (double)1; + cmpVal2(f1, 3); + f1 = (double)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3); + + long2 fa1((unsigned char)1); + long2 fa2((unsigned char)1, (unsigned char)1); + long2 fb1((signed char)1); + long2 fb2((signed char)1, (signed char)1); + long2 fc1((unsigned short)1); + long2 fc2((unsigned short)1,(unsigned short)1); + long2 fd1((signed short)1); + long2 fd2((signed short)1, (signed short)1); + long2 fe1((unsigned int)1); + long2 fe2((unsigned int)1, (unsigned int)1); + long2 fg1((signed int)1); + long2 fg2((signed int)1, (signed int)1); + long2 fh1((float)1); + long2 fh2((float)1, (float)1); + long2 fi1((double)1); + long2 fi2((double)1, (double)1); + long2 fj1((unsigned long)1); + long2 fj2((unsigned long)1, (unsigned long)1); + long2 fk1((signed long)1); + long2 fk2((signed long)1, (signed long)1); + long2 fl1((unsigned long long)1); + long2 fl2((unsigned long long)1, (unsigned long long)1); + long2 fm1((signed long long)1); + long2 fm2((signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f2.x = 4; @@ -3110,6 +5679,80 @@ bool TestLong3() { cmpVal3(f2, -3); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + + long3 fa1((unsigned char)1); + long3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + long3 fb1((signed char)1); + long3 fb2((signed char)1, (signed char)1, (signed char)1); + long3 fc1((unsigned short)1); + long3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + long3 fd1((signed short)1); + long3 fd2((signed short)1, (signed short)1, (signed short)1); + long3 fe1((unsigned int)1); + long3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + long3 fg1((signed int)1); + long3 fg2((signed int)1, (signed int)1, (signed int)1); + long3 fh1((float)1); + long3 fh2((float)1, (float)1, (float)1); + long3 fi1((double)1); + long3 fi2((double)1, (double)1, (double)1); + long3 fj1((unsigned long)1); + long3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + long3 fk1((signed long)1); + long3 fk2((signed long)1, (signed long)1, (signed long)1); + long3 fl1((unsigned long long)1); + long3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + long3 fm1((signed long long)1); + long3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + f1.x = 3; f1.y = 3; f1.z = 3; @@ -3222,6 +5865,81 @@ bool TestLong4() { cmpVal4(f2, -3); assert(!f1 == false); + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (float)1; + cmpVal4(f1, 3); + f1 = (float)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (double)1; + cmpVal4(f1, 3); + f1 = (double)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3); + + long4 fa1((unsigned char)1); + long4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + long4 fb1((signed char)1); + long4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + long4 fc1((unsigned short)1); + long4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + long4 fd1((signed short)1); + long4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + long4 fe1((unsigned int)1); + long4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + long4 fg1((signed int)1); + long4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + long4 fh1((float)1); + long4 fh2((float)1, (float)1, (float)1, (float)1); + long4 fi1((double)1); + long4 fi2((double)1, (double)1, (double)1, (double)1); + long4 fj1((unsigned long)1); + long4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + long4 fk1((signed long)1); + long4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + long4 fl1((unsigned long long)1); + long4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + long4 fm1((signed long long)1); + long4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + + f1.x = 3; f1.y = 3; f1.z = 3; @@ -3247,46 +5965,102 @@ bool TestLong4() { } -bool TestFloat1() { - float1 f1, f2, f3; -// float1 f4(1); -// cmpVal1(f4, 1.0f); -// float1 f5(2.0f); -// cmpVal1(f5, 2.0f); - f1.x = 1.0f; - f2.x = 1.0f; +bool TestDouble1() { + double1 f1, f2, f3; + f1.x = 1.0; + f2.x = 1.0; f3 = f1 + f2; - cmpVal1(f3, 2.0f); + cmpVal1(f3, 2.0); f2 = f3 - f1; - cmpVal1(f2, 1.0f); + cmpVal1(f2, 1.0); f1 = f2 * f3; - cmpVal1(f1, 2.0f); + cmpVal1(f1, 2.0); f2 = f1 / f3; - cmpVal1(f2, 2.0f/2.0f); + cmpVal1(f2, 2.0/2.0); f1 += f2; - cmpVal1(f1, 3.0f); + cmpVal1(f1, 3.0); f1 -= f2; - cmpVal1(f1, 2.0f); + cmpVal1(f1, 2.0); f1 *= f2; - cmpVal1(f1, 2.0f); + cmpVal1(f1, 2.0); f1 /= f2; - cmpVal1(f1, 2.0f); + cmpVal1(f1, 2.0); f2 = f1++; - cmpVal1(f1, 3.0f); - cmpVal1(f2, 2.0f); + cmpVal1(f1, 3.0); + cmpVal1(f2, 2.0); f2 = f1--; - cmpVal1(f2, 3.0f); - cmpVal1(f1, 2.0f); + cmpVal1(f2, 3.0); + cmpVal1(f1, 2.0); f2 = ++f1; - cmpVal1(f1, 3.0f); - cmpVal1(f2, 3.0f); + cmpVal1(f1, 3.0); + cmpVal1(f2, 3.0); f2 = --f1; - cmpVal1(f1, 2.0f); - cmpVal1(f1, 2.0f); + cmpVal1(f1, 2.0); + cmpVal1(f1, 2.0); - f1.x = 3.0f; - f2.x = 4.0f; - f3.x = 3.0f; + f1.x = 3.0; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3.0); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3.0); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3.0); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3.0); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3.0); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3.0); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3.0); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3.0); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3.0); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3.0); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3.0); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3.0); + f1 = f1 * (float)1; + cmpVal1(f1, 3.0); + f1 = (float)1 * f1; + cmpVal1(f1, 3.0); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3.0); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3.0); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3.0); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3.0); + f1 = f1 * (double)1; + cmpVal1(f1, 3.0); + f1 = (double)1 * f1; + cmpVal1(f1, 3.0); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3.0); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3.0); + + double1 fa((unsigned char)1); + double1 fb((signed char)1); + double1 fc((unsigned short)1); + double1 fd((signed short)1); + double1 fe((unsigned int)1); + double1 fg((signed int)1); + double1 fh((float)1); + double1 fi((double)1); + double1 fj((unsigned long)1); + double1 fk((signed long)1); + double1 fl((unsigned long long)1); + double1 fm((signed long long)1); + + + f1.x = 3.0; + f2.x = 4.0; + f3.x = 3.0; assert((f1 == f2) == false); assert((f1 != f2) == true); assert((f1 < f2) == true); @@ -3297,48 +6071,121 @@ bool TestFloat1() { return true; } -bool TestFloat2() { - float2 f1, f2, f3; - f1.x = 1.0f; - f1.y = 1.0f; - f2.x = 1.0f; - f2.y = 1.0f; +bool TestDouble2() { + double2 f1, f2, f3; + f1.x = 1.0; + f1.y = 1.0; + f2.x = 1.0; + f2.y = 1.0; f3 = f1 + f2; - cmpVal2(f3, 2.0f); + cmpVal2(f3, 2.0); f2 = f3 - f1; - cmpVal2(f2, 1.0f); + cmpVal2(f2, 1.0); f1 = f2 * f3; - cmpVal2(f1, 2.0f); + cmpVal2(f1, 2.0); f2 = f1 / f3; - cmpVal2(f2, 2.0f/2.0f); + cmpVal2(f2, 2.0f/2.0); f1 += f2; - cmpVal2(f1, 3.0f); + cmpVal2(f1, 3.0); f1 -= f2; - cmpVal2(f1, 2.0f); + cmpVal2(f1, 2.0); f1 *= f2; - cmpVal2(f1, 2.0f); + cmpVal2(f1, 2.0); f1 /= f2; - cmpVal2(f1, 2.0f); + cmpVal2(f1, 2.0); f2 = f1++; - cmpVal2(f1, 3.0f); - cmpVal2(f2, 2.0f); + cmpVal2(f1, 3.0); + cmpVal2(f2, 2.0); f2 = f1--; - cmpVal2(f2, 3.0f); - cmpVal2(f1, 2.0f); + cmpVal2(f2, 3.0); + cmpVal2(f1, 2.0); f2 = ++f1; - cmpVal2(f1, 3.0f); - cmpVal2(f2, 3.0f); + cmpVal2(f1, 3.0); + cmpVal2(f2, 3.0); f2 = --f1; - cmpVal2(f1, 2.0f); - cmpVal2(f1, 2.0f); + cmpVal2(f1, 2.0); + cmpVal2(f1, 2.0); - f1.x = 3.0f; - f1.y = 3.0f; - f2.x = 4.0f; - f2.y = 4.0f; - f3.x = 3.0f; - f3.y = 3.0f; + f1.x = 3.0; + f1.y = 3.0; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3.0); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3.0); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3.0); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3.0); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3.0); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3.0); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3.0); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3.0); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3.0); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3.0); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3.0); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3.0); + f1 = f1 * (float)1; + cmpVal2(f1, 3.0); + f1 = (float)1 * f1; + cmpVal2(f1, 3.0); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3.0); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3.0); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3.0); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3.0); + f1 = f1 * (double)1; + cmpVal2(f1, 3.0); + f1 = (double)1 * f1; + cmpVal2(f1, 3.0); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3.0); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3.0); + + double2 fa1((unsigned char)1); + double2 fa2((unsigned char)1, (unsigned char)1); + double2 fb1((signed char)1); + double2 fb2((signed char)1, (signed char)1); + double2 fc1((unsigned short)1); + double2 fc2((unsigned short)1,(unsigned short)1); + double2 fd1((signed short)1); + double2 fd2((signed short)1, (signed short)1); + double2 fe1((unsigned int)1); + double2 fe2((unsigned int)1, (unsigned int)1); + double2 fg1((signed int)1); + double2 fg2((signed int)1, (signed int)1); + double2 fh1((float)1); + double2 fh2((float)1, (float)1); + double2 fi1((double)1); + double2 fi2((double)1, (double)1); + double2 fj1((unsigned long)1); + double2 fj2((unsigned long)1, (unsigned long)1); + double2 fk1((signed long)1); + double2 fk2((signed long)1, (signed long)1); + double2 fl1((unsigned long long)1); + double2 fl2((unsigned long long)1, (unsigned long long)1); + double2 fm1((signed long long)1); + double2 fm2((signed long long)1, (signed long long)1); + + + f1.x = 3.0; + f1.y = 3.0; + f2.x = 4.0; + f2.y = 4.0; + f3.x = 3.0; + f3.y = 3.0; assert((f1 == f2) == false); assert((f1 != f2) == true); assert((f1 < f2) == true); @@ -3350,51 +6197,125 @@ bool TestFloat2() { return true; } -bool TestFloat3() { - float3 f1, f2, f3; - f1.x = 1.0f; - f1.y = 1.0f; - f1.z = 1.0f; - f2.x = 1.0f; - f2.y = 1.0f; - f2.z = 1.0f; +bool TestDouble3() { + double3 f1, f2, f3; + f1.x = 1.0; + f1.y = 1.0; + f1.z = 1.0; + f2.x = 1.0; + f2.y = 1.0; + f2.z = 1.0; f3 = f1 + f2; - cmpVal3(f3, 2.0f); + cmpVal3(f3, 2.0); f2 = f3 - f1; - cmpVal3(f2, 1.0f); + cmpVal3(f2, 1.0); f1 = f2 * f3; - cmpVal3(f1, 2.0f); + cmpVal3(f1, 2.0); f2 = f1 / f3; - cmpVal3(f2, 2.0f/2.0f); + cmpVal3(f2, 2.0f/2.0); f1 += f2; - cmpVal3(f1, 3.0f); + cmpVal3(f1, 3.0); f1 -= f2; - cmpVal3(f1, 2.0f); + cmpVal3(f1, 2.0); f1 *= f2; - cmpVal3(f1, 2.0f); + cmpVal3(f1, 2.0); f1 /= f2; f2 = f1++; - cmpVal3(f1, 3.0f); - cmpVal3(f2, 2.0f); + cmpVal3(f1, 3.0); + cmpVal3(f2, 2.0); f2 = f1--; - cmpVal3(f2, 3.0f); - cmpVal3(f1, 2.0f); + cmpVal3(f2, 3.0); + cmpVal3(f1, 2.0); f2 = ++f1; - cmpVal3(f1, 3.0f); - cmpVal3(f2, 3.0f); + cmpVal3(f1, 3.0); + cmpVal3(f2, 3.0); f2 = --f1; - cmpVal3(f1, 2.0f); - cmpVal3(f1, 2.0f); + cmpVal3(f1, 2.0); + cmpVal3(f1, 2.0); - f1.x = 3.0f; - f1.y = 3.0f; - f1.z = 3.0f; - f2.x = 4.0f; - f2.y = 4.0f; - f2.z = 4.0f; - f3.x = 3.0f; - f3.y = 3.0f; - f3.z = 3.0f; + f1.x = 3.0; + f1.y = 3.0; + f1.z = 3.0; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3.0); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3.0); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3.0); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3.0); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3.0); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3.0); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3.0); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3.0); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3.0); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3.0); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3.0); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3.0); + f1 = f1 * (float)1; + cmpVal3(f1, 3.0); + f1 = (float)1 * f1; + cmpVal3(f1, 3.0); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3.0); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3.0); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3.0); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3.0); + f1 = f1 * (double)1; + cmpVal3(f1, 3.0); + f1 = (double)1 * f1; + cmpVal3(f1, 3.0); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3.0); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3.0); + + double3 fa1((unsigned char)1); + double3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + double3 fb1((signed char)1); + double3 fb2((signed char)1, (signed char)1, (signed char)1); + double3 fc1((unsigned short)1); + double3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + double3 fd1((signed short)1); + double3 fd2((signed short)1, (signed short)1, (signed short)1); + double3 fe1((unsigned int)1); + double3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + double3 fg1((signed int)1); + double3 fg2((signed int)1, (signed int)1, (signed int)1); + double3 fh1((float)1); + double3 fh2((float)1, (float)1, (float)1); + double3 fi1((double)1); + double3 fi2((double)1, (double)1, (double)1); + double3 fj1((unsigned long)1); + double3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + double3 fk1((signed long)1); + double3 fk2((signed long)1, (signed long)1, (signed long)1); + double3 fl1((unsigned long long)1); + double3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + double3 fm1((signed long long)1); + double3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + + + f1.x = 3.0; + f1.y = 3.0; + f1.z = 3.0; + f2.x = 4.0; + f2.y = 4.0; + f2.z = 4.0; + f3.x = 3.0; + f3.y = 3.0; + f3.z = 3.0; assert((f1 == f2) == false); assert((f1 != f2) == true); assert((f1 < f2) == true); @@ -3406,57 +6327,131 @@ bool TestFloat3() { return true; } - -bool TestFloat4() { - float4 f1, f2, f3; - f1.x = 1.0f; - f1.y = 1.0f; - f1.z = 1.0f; - f1.w = 1.0f; - f2.x = 1.0f; - f2.y = 1.0f; - f2.z = 1.0f; - f2.w = 1.0f; +bool TestDouble4() { + double4 f1, f2, f3; + f1.x = 1.0; + f1.y = 1.0; + f1.z = 1.0; + f1.w = 1.0; + f2.x = 1.0; + f2.y = 1.0; + f2.z = 1.0; + f2.w = 1.0; f3 = f1 + f2; - cmpVal4(f3, 2.0f); + cmpVal4(f3, 2.0); f2 = f3 - f1; - cmpVal4(f2, 1.0f); + cmpVal4(f2, 1.0); f1 = f2 * f3; - cmpVal4(f1, 2.0f); + cmpVal4(f1, 2.0); f2 = f1 / f3; - cmpVal4(f2, 2.0f/2.0f); + cmpVal4(f2, 2.0f/2.0); f1 += f2; - cmpVal4(f1, 3.0f); + cmpVal4(f1, 3.0); f1 -= f2; - cmpVal4(f1, 2.0f); + cmpVal4(f1, 2.0); f1 *= f2; - cmpVal4(f1, 2.0f); + cmpVal4(f1, 2.0); f1 /= f2; f2 = f1++; - cmpVal4(f1, 3.0f); - cmpVal4(f2, 2.0f); + cmpVal4(f1, 3.0); + cmpVal4(f2, 2.0); f2 = f1--; - cmpVal4(f2, 3.0f); - cmpVal4(f1, 2.0f); + cmpVal4(f2, 3.0); + cmpVal4(f1, 2.0); f2 = ++f1; - cmpVal4(f1, 3.0f); - cmpVal4(f2, 3.0f); + cmpVal4(f1, 3.0); + cmpVal4(f2, 3.0); f2 = --f1; - cmpVal4(f1, 2.0f); - cmpVal4(f1, 2.0f); + cmpVal4(f1, 2.0); + cmpVal4(f1, 2.0); - f1.x = 3.0f; - f1.y = 3.0f; - f1.z = 3.0f; - f1.w = 3.0f; - f2.x = 4.0f; - f2.y = 4.0f; - f2.z = 4.0f; - f2.w = 4.0f; - f3.x = 3.0f; - f3.y = 3.0f; - f3.z = 3.0f; - f3.w = 3.0f; + f1.x = 3.0; + f1.y = 3.0; + f1.z = 3.0; + f1.w = 3.0; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3.0); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3.0); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3.0); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3.0); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3.0); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3.0); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3.0); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3.0); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3.0); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3.0); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3.0); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3.0); + f1 = f1 * (float)1; + cmpVal4(f1, 3.0); + f1 = (float)1 * f1; + cmpVal4(f1, 3.0); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3.0); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3.0); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3.0); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3.0); + f1 = f1 * (double)1; + cmpVal4(f1, 3.0); + f1 = (double)1 * f1; + cmpVal4(f1, 3.0); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3.0); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3.0); + + double4 fa1((unsigned char)1); + double4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + double4 fb1((signed char)1); + double4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + double4 fc1((unsigned short)1); + double4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + double4 fd1((signed short)1); + double4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + double4 fe1((unsigned int)1); + double4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + double4 fg1((signed int)1); + double4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + double4 fh1((float)1); + double4 fh2((float)1, (float)1, (float)1, (float)1); + double4 fi1((double)1); + double4 fi2((double)1, (double)1, (double)1, (double)1); + double4 fj1((unsigned long)1); + double4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + double4 fk1((signed long)1); + double4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + double4 fl1((unsigned long long)1); + double4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + double4 fm1((signed long long)1); + double4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + + + f1.x = 3.0; + f1.y = 3.0; + f1.z = 3.0; + f1.w = 3.0; + f2.x = 4.0; + f2.y = 4.0; + f2.z = 4.0; + f2.w = 4.0; + f3.x = 3.0; + f3.y = 3.0; + f3.z = 3.0; + f3.w = 3.0; assert((f1 == f2) == false); assert((f1 != f2) == true); assert((f1 < f2) == true); @@ -3467,12 +6462,1367 @@ bool TestFloat4() { return true; } + +bool TestULongLong1() { + long1 f1, f2, f3; + f1.x = 1; + f2.x = 1; + f3 = f1 + f2; + cmpVal1(f3, 2); + f2 = f3 - f1; + cmpVal1(f2, 1); + f1 = f2 * f3; + cmpVal1(f1, 2); + f2 = f1 / f3; + cmpVal1(f2, 2/2); + f3 = f1 % f2; + cmpVal1(f3, 0); + f1 = f3 & f2; + cmpVal1(f1, 0); + f2 = f1 ^ f3; + cmpVal1(f2, 0); + f1.x = 1; + f2.x = 2; + f3 = f1 << f2; + cmpVal1(f3, 4); + f2 = f3 >> f1; + cmpVal1(f2, 2); + + f1.x = 2; + f2.x = 1; + f1 += f2; + cmpVal1(f1, 3); + f1 -= f2; + cmpVal1(f1, 2); + f1 *= f2; + cmpVal1(f1, 2); + f1 /= f2; + cmpVal1(f1, 2); + f1 %= f2; + cmpVal1(f1, 0); + f1 &= f2; + cmpVal1(f1, 0); + f1 |= f2; + cmpVal1(f1, 1); + f1 ^= f2; + cmpVal1(f1, 0); + f1.x = 1; + f1 <<= f2; + cmpVal1(f1, 2); + f1 >>= f2; + cmpVal1(f1, 1); + + f1.x = 2; + f2 = f1++; + cmpVal1(f1, 3); + cmpVal1(f2, 2); + f2 = f1--; + cmpVal1(f2, 3); + cmpVal1(f1, 2); + f2 = ++f1; + cmpVal1(f1, 3); + cmpVal1(f2, 3); + f2 = --f1; + cmpVal1(f1, 2); + cmpVal1(f2, 2); + + f2 = ~f1; + cmpVal1(f2, -3); + assert(!f1 == false); + + f1.x = 3; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (float)1; + cmpVal1(f1, 3); + f1 = (float)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (double)1; + cmpVal1(f1, 3); + f1 = (double)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3); + + ulonglong1 fa((unsigned char)1); + ulonglong1 fb((signed char)1); + ulonglong1 fc((unsigned short)1); + ulonglong1 fd((signed short)1); + ulonglong1 fe((unsigned int)1); + ulonglong1 fg((signed int)1); + ulonglong1 fh((float)1); + ulonglong1 fi((double)1); + ulonglong1 fj((unsigned long)1); + ulonglong1 fk((signed long)1); + ulonglong1 fl((unsigned long long)1); + ulonglong1 fm((signed long long)1); + + + f1.x = 3; + f2.x = 4; + f3.x = 3; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + assert((f1 && f2) == true); + assert((f1 || f2) == true); + return true; +} + +bool TestULongLong2() { + long2 f1, f2, f3; + f1.x = 1; + f1.y = 1; + f2.x = 1; + f2.y = 1; + f3 = f1 + f2; + cmpVal2(f3, 2); + f2 = f3 - f1; + cmpVal2(f2, 1); + f1 = f2 * f3; + cmpVal2(f1, 2); + f2 = f1 / f3; + cmpVal2(f2, 2/2); + f3 = f1 % f2; + cmpVal2(f3, 0); + f1 = f3 & f2; + cmpVal2(f1, 0); + f2 = f1 ^ f3; + cmpVal2(f2, 0); + f1.x = 1; + f1.y = 1; + f2.x = 2; + f2.y = 2; + f3 = f1 << f2; + cmpVal2(f3, 4); + f2 = f3 >> f1; + cmpVal2(f2, 2); + + f1.x = 2; + f1.y = 2; + f2.x = 1; + f2.y = 1; + f1 += f2; + cmpVal2(f1, 3); + f1 -= f2; + cmpVal2(f1, 2); + f1 *= f2; + cmpVal2(f1, 2); + f1 /= f2; + cmpVal2(f1, 2); + f1 %= f2; + cmpVal2(f1, 0); + f1 &= f2; + cmpVal2(f1, 0); + f1 |= f2; + cmpVal2(f1, 1); + f1 ^= f2; + cmpVal2(f1, 0); + f1.x = 1; + f1.y = 1; + f1 <<= f2; + cmpVal2(f1, 2); + f1 >>= f2; + cmpVal2(f1, 1); + + f1.x = 2; + f1.y = 2; + f2 = f1++; + cmpVal2(f1, 3); + cmpVal2(f2, 2); + f2 = f1--; + cmpVal2(f2, 3); + cmpVal2(f1, 2); + f2 = ++f1; + cmpVal2(f1, 3); + cmpVal2(f2, 3); + f2 = --f1; + cmpVal2(f1, 2); + cmpVal2(f2, 2); + + f2 = ~f1; + cmpVal2(f2, -3); + assert(!f1 == false); + + f1.x = 3; + f1.y = 3; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (float)1; + cmpVal2(f1, 3); + f1 = (float)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (double)1; + cmpVal2(f1, 3); + f1 = (double)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3); + + ulonglong2 fa1((unsigned char)1); + ulonglong2 fa2((unsigned char)1, (unsigned char)1); + ulonglong2 fb1((signed char)1); + ulonglong2 fb2((signed char)1, (signed char)1); + ulonglong2 fc1((unsigned short)1); + ulonglong2 fc2((unsigned short)1,(unsigned short)1); + ulonglong2 fd1((signed short)1); + ulonglong2 fd2((signed short)1, (signed short)1); + ulonglong2 fe1((unsigned int)1); + ulonglong2 fe2((unsigned int)1, (unsigned int)1); + ulonglong2 fg1((signed int)1); + ulonglong2 fg2((signed int)1, (signed int)1); + ulonglong2 fh1((float)1); + ulonglong2 fh2((float)1, (float)1); + ulonglong2 fi1((double)1); + ulonglong2 fi2((double)1, (double)1); + ulonglong2 fj1((unsigned long)1); + ulonglong2 fj2((unsigned long)1, (unsigned long)1); + ulonglong2 fk1((signed long)1); + ulonglong2 fk2((signed long)1, (signed long)1); + ulonglong2 fl1((unsigned long long)1); + ulonglong2 fl2((unsigned long long)1, (unsigned long long)1); + ulonglong2 fm1((signed long long)1); + ulonglong2 fm2((signed long long)1, (signed long long)1); + + + f1.x = 3; + f1.y = 3; + f2.x = 4; + f2.y = 4; + f3.x = 3; + f3.y = 3; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + assert((f1 && f2) == true); + assert((f1 || f2) == true); + return true; +} + +bool TestULongLong3() { + long3 f1, f2, f3; + f1.x = 1; + f1.y = 1; + f1.z = 1; + f2.x = 1; + f2.y = 1; + f2.z = 1; + f3 = f1 + f2; + cmpVal3(f3, 2); + f2 = f3 - f1; + cmpVal3(f2, 1); + f1 = f2 * f3; + cmpVal3(f1, 2); + f2 = f1 / f3; + cmpVal3(f2, 2/2); + f3 = f1 % f2; + cmpVal3(f3, 0); + f1 = f3 & f2; + cmpVal3(f1, 0); + f2 = f1 ^ f3; + cmpVal3(f2, 0); + f1.x = 1; + f1.y = 1; + f1.z = 1; + f2.x = 2; + f2.y = 2; + f2.z = 2; + f3 = f1 << f2; + cmpVal3(f3, 4); + f2 = f3 >> f1; + cmpVal3(f2, 2); + + f1.x = 2; + f1.y = 2; + f1.z = 2; + f2.x = 1; + f2.y = 1; + f2.z = 1; + f1 += f2; + cmpVal3(f1, 3); + f1 -= f2; + cmpVal3(f1, 2); + f1 *= f2; + cmpVal3(f1, 2); + f1 /= f2; + cmpVal3(f1, 2); + f1 %= f2; + cmpVal3(f1, 0); + f1 &= f2; + cmpVal3(f1, 0); + f1 |= f2; + cmpVal3(f1, 1); + f1 ^= f2; + cmpVal3(f1, 0); + f1.x = 1; + f1.y = 1; + f1.z = 1; + f1 <<= f2; + cmpVal3(f1, 2); + f1 >>= f2; + cmpVal3(f1, 1); + + f1.x = 2; + f1.y = 2; + f1.z = 2; + f2 = f1++; + cmpVal3(f1, 3); + cmpVal3(f2, 2); + f2 = f1--; + cmpVal3(f2, 3); + cmpVal3(f1, 2); + f2 = ++f1; + cmpVal3(f1, 3); + cmpVal3(f2, 3); + f2 = --f1; + cmpVal3(f1, 2); + cmpVal3(f2, 2); + + f2 = ~f1; + cmpVal3(f2, -3); + assert(!f1 == false); + + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + ulonglong3 fa1((unsigned char)1); + ulonglong3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + ulonglong3 fb1((signed char)1); + ulonglong3 fb2((signed char)1, (signed char)1, (signed char)1); + ulonglong3 fc1((unsigned short)1); + ulonglong3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + ulonglong3 fd1((signed short)1); + ulonglong3 fd2((signed short)1, (signed short)1, (signed short)1); + ulonglong3 fe1((unsigned int)1); + ulonglong3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + ulonglong3 fg1((signed int)1); + ulonglong3 fg2((signed int)1, (signed int)1, (signed int)1); + ulonglong3 fh1((float)1); + ulonglong3 fh2((float)1, (float)1, (float)1); + ulonglong3 fi1((double)1); + ulonglong3 fi2((double)1, (double)1, (double)1); + ulonglong3 fj1((unsigned long)1); + ulonglong3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + ulonglong3 fk1((signed long)1); + ulonglong3 fk2((signed long)1, (signed long)1, (signed long)1); + ulonglong3 fl1((unsigned long long)1); + ulonglong3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + ulonglong3 fm1((signed long long)1); + ulonglong3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + + + f1.x = 3; + f1.y = 3; + f1.z = 3; + f2.x = 4; + f2.y = 4; + f2.z = 4; + f3.x = 3; + f3.y = 3; + f3.z = 3; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + assert((f1 && f2) == true); + assert((f1 || f2) == true); + return true; +} + +bool TestULongLong4() { + long4 f1, f2, f3; + f1.x = 1; + f1.y = 1; + f1.z = 1; + f1.w = 1; + f2.x = 1; + f2.y = 1; + f2.z = 1; + f2.w = 1; + f3 = f1 + f2; + cmpVal4(f3, 2); + f2 = f3 - f1; + cmpVal4(f2, 1); + f1 = f2 * f3; + cmpVal4(f1, 2); + f2 = f1 / f3; + cmpVal4(f2, 2/2); + f3 = f1 % f2; + cmpVal4(f3, 0); + f1 = f3 & f2; + cmpVal4(f1, 0); + f2 = f1 ^ f3; + cmpVal4(f2, 0); + f1.x = 1; + f1.y = 1; + f1.z = 1; + f1.w = 1; + f2.x = 2; + f2.y = 2; + f2.z = 2; + f2.w = 2; + f3 = f1 << f2; + cmpVal4(f3, 4); + f2 = f3 >> f1; + cmpVal4(f2, 2); + + f1.x = 2; + f1.y = 2; + f1.z = 2; + f1.w = 2; + f2.x = 1; + f2.y = 1; + f2.z = 1; + f2.w = 1; + f1 += f2; + cmpVal4(f1, 3); + f1 -= f2; + cmpVal4(f1, 2); + f1 *= f2; + cmpVal4(f1, 2); + f1 /= f2; + cmpVal4(f1, 2); + f1 %= f2; + cmpVal4(f1, 0); + f1 &= f2; + cmpVal4(f1, 0); + f1 |= f2; + cmpVal4(f1, 1); + f1 ^= f2; + cmpVal4(f1, 0); + f1.x = 1; + f1.y = 1; + f1.z = 1; + f1.w = 1; + f1 <<= f2; + cmpVal4(f1, 2); + f1 >>= f2; + cmpVal4(f1, 1); + + f1.x = 2; + f1.y = 2; + f1.z = 2; + f1.w = 2; + f2 = f1++; + cmpVal4(f1, 3); + cmpVal4(f2, 2); + f2 = f1--; + cmpVal4(f2, 3); + cmpVal4(f1, 2); + f2 = ++f1; + cmpVal4(f1, 3); + cmpVal4(f2, 3); + f2 = --f1; + cmpVal4(f1, 2); + cmpVal4(f2, 2); + + f2 = ~f1; + cmpVal4(f2, -3); + assert(!f1 == false); + + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (float)1; + cmpVal4(f1, 3); + f1 = (float)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (double)1; + cmpVal4(f1, 3); + f1 = (double)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3); + + ulonglong4 fa1((unsigned char)1); + ulonglong4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + ulonglong4 fb1((signed char)1); + ulonglong4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + ulonglong4 fc1((unsigned short)1); + ulonglong4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + ulonglong4 fd1((signed short)1); + ulonglong4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + ulonglong4 fe1((unsigned int)1); + ulonglong4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + ulonglong4 fg1((signed int)1); + ulonglong4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + ulonglong4 fh1((float)1); + ulonglong4 fh2((float)1, (float)1, (float)1, (float)1); + ulonglong4 fi1((double)1); + ulonglong4 fi2((double)1, (double)1, (double)1, (double)1); + ulonglong4 fj1((unsigned long)1); + ulonglong4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + ulonglong4 fk1((signed long)1); + ulonglong4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + ulonglong4 fl1((unsigned long long)1); + ulonglong4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + ulonglong4 fm1((signed long long)1); + ulonglong4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + + + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f2.x = 4; + f2.y = 4; + f2.z = 4; + f2.w = 4; + f3.x = 3; + f3.y = 3; + f3.z = 3; + f3.w = 3; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + assert((f1 && f2) == true); + assert((f1 || f2) == true); + return true; +} + + +bool TestLongLong1() { + long1 f1, f2, f3; + f1.x = 1; + f2.x = 1; + f3 = f1 + f2; + cmpVal1(f3, 2); + f2 = f3 - f1; + cmpVal1(f2, 1); + f1 = f2 * f3; + cmpVal1(f1, 2); + f2 = f1 / f3; + cmpVal1(f2, 2/2); + f3 = f1 % f2; + cmpVal1(f3, 0); + f1 = f3 & f2; + cmpVal1(f1, 0); + f2 = f1 ^ f3; + cmpVal1(f2, 0); + f1.x = 1; + f2.x = 2; + f3 = f1 << f2; + cmpVal1(f3, 4); + f2 = f3 >> f1; + cmpVal1(f2, 2); + + f1.x = 2; + f2.x = 1; + f1 += f2; + cmpVal1(f1, 3); + f1 -= f2; + cmpVal1(f1, 2); + f1 *= f2; + cmpVal1(f1, 2); + f1 /= f2; + cmpVal1(f1, 2); + f1 %= f2; + cmpVal1(f1, 0); + f1 &= f2; + cmpVal1(f1, 0); + f1 |= f2; + cmpVal1(f1, 1); + f1 ^= f2; + cmpVal1(f1, 0); + f1.x = 1; + f1 <<= f2; + cmpVal1(f1, 2); + f1 >>= f2; + cmpVal1(f1, 1); + + f1.x = 2; + f2 = f1++; + cmpVal1(f1, 3); + cmpVal1(f2, 2); + f2 = f1--; + cmpVal1(f2, 3); + cmpVal1(f1, 2); + f2 = ++f1; + cmpVal1(f1, 3); + cmpVal1(f2, 3); + f2 = --f1; + cmpVal1(f1, 2); + cmpVal1(f2, 2); + + f2 = ~f1; + cmpVal1(f2, -3); + assert(!f1 == false); + + f1.x = 3; + f1 = f1 * (unsigned char)1; + cmpVal1(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed char)1; + cmpVal1(f1, 3); + f1 = (signed char)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal1(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed short)1; + cmpVal1(f1, 3); + f1 = (signed short)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal1(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed int)1; + cmpVal1(f1, 3); + f1 = (signed int)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (float)1; + cmpVal1(f1, 3); + f1 = (float)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal1(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (signed long)1; + cmpVal1(f1, 3); + f1 = (signed long)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (double)1; + cmpVal1(f1, 3); + f1 = (double)1 * f1; + cmpVal1(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal1(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal1(f1, 3); + + longlong1 fa((unsigned char)1); + longlong1 fb((signed char)1); + longlong1 fc((unsigned short)1); + longlong1 fd((signed short)1); + longlong1 fe((unsigned int)1); + longlong1 fg((signed int)1); + longlong1 fh((float)1); + longlong1 fi((double)1); + longlong1 fj((unsigned long)1); + longlong1 fk((signed long)1); + longlong1 fl((unsigned long long)1); + longlong1 fm((signed long long)1); + + + f1.x = 3; + f2.x = 4; + f3.x = 3; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + assert((f1 && f2) == true); + assert((f1 || f2) == true); + return true; +} + +bool TestLongLong2() { + long2 f1, f2, f3; + f1.x = 1; + f1.y = 1; + f2.x = 1; + f2.y = 1; + f3 = f1 + f2; + cmpVal2(f3, 2); + f2 = f3 - f1; + cmpVal2(f2, 1); + f1 = f2 * f3; + cmpVal2(f1, 2); + f2 = f1 / f3; + cmpVal2(f2, 2/2); + f3 = f1 % f2; + cmpVal2(f3, 0); + f1 = f3 & f2; + cmpVal2(f1, 0); + f2 = f1 ^ f3; + cmpVal2(f2, 0); + f1.x = 1; + f1.y = 1; + f2.x = 2; + f2.y = 2; + f3 = f1 << f2; + cmpVal2(f3, 4); + f2 = f3 >> f1; + cmpVal2(f2, 2); + + f1.x = 2; + f1.y = 2; + f2.x = 1; + f2.y = 1; + f1 += f2; + cmpVal2(f1, 3); + f1 -= f2; + cmpVal2(f1, 2); + f1 *= f2; + cmpVal2(f1, 2); + f1 /= f2; + cmpVal2(f1, 2); + f1 %= f2; + cmpVal2(f1, 0); + f1 &= f2; + cmpVal2(f1, 0); + f1 |= f2; + cmpVal2(f1, 1); + f1 ^= f2; + cmpVal2(f1, 0); + f1.x = 1; + f1.y = 1; + f1 <<= f2; + cmpVal2(f1, 2); + f1 >>= f2; + cmpVal2(f1, 1); + + f1.x = 2; + f1.y = 2; + f2 = f1++; + cmpVal2(f1, 3); + cmpVal2(f2, 2); + f2 = f1--; + cmpVal2(f2, 3); + cmpVal2(f1, 2); + f2 = ++f1; + cmpVal2(f1, 3); + cmpVal2(f2, 3); + f2 = --f1; + cmpVal2(f1, 2); + cmpVal2(f2, 2); + + f2 = ~f1; + cmpVal2(f2, -3); + assert(!f1 == false); + + f1.x = 3; + f1.y = 3; + f1 = f1 * (unsigned char)1; + cmpVal2(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed char)1; + cmpVal2(f1, 3); + f1 = (signed char)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal2(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed short)1; + cmpVal2(f1, 3); + f1 = (signed short)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal2(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed int)1; + cmpVal2(f1, 3); + f1 = (signed int)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (float)1; + cmpVal2(f1, 3); + f1 = (float)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal2(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (signed long)1; + cmpVal2(f1, 3); + f1 = (signed long)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (double)1; + cmpVal2(f1, 3); + f1 = (double)1 * f1; + cmpVal2(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal2(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal2(f1, 3); + + longlong2 fa1((unsigned char)1); + longlong2 fa2((unsigned char)1, (unsigned char)1); + longlong2 fb1((signed char)1); + longlong2 fb2((signed char)1, (signed char)1); + longlong2 fc1((unsigned short)1); + longlong2 fc2((unsigned short)1,(unsigned short)1); + longlong2 fd1((signed short)1); + longlong2 fd2((signed short)1, (signed short)1); + longlong2 fe1((unsigned int)1); + longlong2 fe2((unsigned int)1, (unsigned int)1); + longlong2 fg1((signed int)1); + longlong2 fg2((signed int)1, (signed int)1); + longlong2 fh1((float)1); + longlong2 fh2((float)1, (float)1); + longlong2 fi1((double)1); + longlong2 fi2((double)1, (double)1); + longlong2 fj1((unsigned long)1); + longlong2 fj2((unsigned long)1, (unsigned long)1); + longlong2 fk1((signed long)1); + longlong2 fk2((signed long)1, (signed long)1); + longlong2 fl1((unsigned long long)1); + longlong2 fl2((unsigned long long)1, (unsigned long long)1); + longlong2 fm1((signed long long)1); + longlong2 fm2((signed long long)1, (signed long long)1); + + + f1.x = 3; + f1.y = 3; + f2.x = 4; + f2.y = 4; + f3.x = 3; + f3.y = 3; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + assert((f1 && f2) == true); + assert((f1 || f2) == true); + return true; +} + +bool TestLongLong3() { + long3 f1, f2, f3; + f1.x = 1; + f1.y = 1; + f1.z = 1; + f2.x = 1; + f2.y = 1; + f2.z = 1; + f3 = f1 + f2; + cmpVal3(f3, 2); + f2 = f3 - f1; + cmpVal3(f2, 1); + f1 = f2 * f3; + cmpVal3(f1, 2); + f2 = f1 / f3; + cmpVal3(f2, 2/2); + f3 = f1 % f2; + cmpVal3(f3, 0); + f1 = f3 & f2; + cmpVal3(f1, 0); + f2 = f1 ^ f3; + cmpVal3(f2, 0); + f1.x = 1; + f1.y = 1; + f1.z = 1; + f2.x = 2; + f2.y = 2; + f2.z = 2; + f3 = f1 << f2; + cmpVal3(f3, 4); + f2 = f3 >> f1; + cmpVal3(f2, 2); + + f1.x = 2; + f1.y = 2; + f1.z = 2; + f2.x = 1; + f2.y = 1; + f2.z = 1; + f1 += f2; + cmpVal3(f1, 3); + f1 -= f2; + cmpVal3(f1, 2); + f1 *= f2; + cmpVal3(f1, 2); + f1 /= f2; + cmpVal3(f1, 2); + f1 %= f2; + cmpVal3(f1, 0); + f1 &= f2; + cmpVal3(f1, 0); + f1 |= f2; + cmpVal3(f1, 1); + f1 ^= f2; + cmpVal3(f1, 0); + f1.x = 1; + f1.y = 1; + f1.z = 1; + f1 <<= f2; + cmpVal3(f1, 2); + f1 >>= f2; + cmpVal3(f1, 1); + + f1.x = 2; + f1.y = 2; + f1.z = 2; + f2 = f1++; + cmpVal3(f1, 3); + cmpVal3(f2, 2); + f2 = f1--; + cmpVal3(f2, 3); + cmpVal3(f1, 2); + f2 = ++f1; + cmpVal3(f1, 3); + cmpVal3(f2, 3); + f2 = --f1; + cmpVal3(f1, 2); + cmpVal3(f2, 2); + + f2 = ~f1; + cmpVal3(f2, -3); + assert(!f1 == false); + + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1 = f1 * (unsigned char)1; + cmpVal3(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed char)1; + cmpVal3(f1, 3); + f1 = (signed char)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal3(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed short)1; + cmpVal3(f1, 3); + f1 = (signed short)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal3(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed int)1; + cmpVal3(f1, 3); + f1 = (signed int)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (float)1; + cmpVal3(f1, 3); + f1 = (float)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal3(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (signed long)1; + cmpVal3(f1, 3); + f1 = (signed long)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (double)1; + cmpVal3(f1, 3); + f1 = (double)1 * f1; + cmpVal3(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal3(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal3(f1, 3); + + longlong3 fa1((unsigned char)1); + longlong3 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1); + longlong3 fb1((signed char)1); + longlong3 fb2((signed char)1, (signed char)1, (signed char)1); + longlong3 fc1((unsigned short)1); + longlong3 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1); + longlong3 fd1((signed short)1); + longlong3 fd2((signed short)1, (signed short)1, (signed short)1); + longlong3 fe1((unsigned int)1); + longlong3 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1); + longlong3 fg1((signed int)1); + longlong3 fg2((signed int)1, (signed int)1, (signed int)1); + longlong3 fh1((float)1); + longlong3 fh2((float)1, (float)1, (float)1); + longlong3 fi1((double)1); + longlong3 fi2((double)1, (double)1, (double)1); + longlong3 fj1((unsigned long)1); + longlong3 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1); + longlong3 fk1((signed long)1); + longlong3 fk2((signed long)1, (signed long)1, (signed long)1); + longlong3 fl1((unsigned long long)1); + longlong3 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + longlong3 fm1((signed long long)1); + longlong3 fm2((signed long long)1, (signed long long)1, (signed long long)1); + + + f1.x = 3; + f1.y = 3; + f1.z = 3; + f2.x = 4; + f2.y = 4; + f2.z = 4; + f3.x = 3; + f3.y = 3; + f3.z = 3; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + assert((f1 && f2) == true); + assert((f1 || f2) == true); + return true; +} + +bool TestLongLong4() { + long4 f1, f2, f3; + f1.x = 1; + f1.y = 1; + f1.z = 1; + f1.w = 1; + f2.x = 1; + f2.y = 1; + f2.z = 1; + f2.w = 1; + f3 = f1 + f2; + cmpVal4(f3, 2); + f2 = f3 - f1; + cmpVal4(f2, 1); + f1 = f2 * f3; + cmpVal4(f1, 2); + f2 = f1 / f3; + cmpVal4(f2, 2/2); + f3 = f1 % f2; + cmpVal4(f3, 0); + f1 = f3 & f2; + cmpVal4(f1, 0); + f2 = f1 ^ f3; + cmpVal4(f2, 0); + f1.x = 1; + f1.y = 1; + f1.z = 1; + f1.w = 1; + f2.x = 2; + f2.y = 2; + f2.z = 2; + f2.w = 2; + f3 = f1 << f2; + cmpVal4(f3, 4); + f2 = f3 >> f1; + cmpVal4(f2, 2); + + f1.x = 2; + f1.y = 2; + f1.z = 2; + f1.w = 2; + f2.x = 1; + f2.y = 1; + f2.z = 1; + f2.w = 1; + f1 += f2; + cmpVal4(f1, 3); + f1 -= f2; + cmpVal4(f1, 2); + f1 *= f2; + cmpVal4(f1, 2); + f1 /= f2; + cmpVal4(f1, 2); + f1 %= f2; + cmpVal4(f1, 0); + f1 &= f2; + cmpVal4(f1, 0); + f1 |= f2; + cmpVal4(f1, 1); + f1 ^= f2; + cmpVal4(f1, 0); + f1.x = 1; + f1.y = 1; + f1.z = 1; + f1.w = 1; + f1 <<= f2; + cmpVal4(f1, 2); + f1 >>= f2; + cmpVal4(f1, 1); + + f1.x = 2; + f1.y = 2; + f1.z = 2; + f1.w = 2; + f2 = f1++; + cmpVal4(f1, 3); + cmpVal4(f2, 2); + f2 = f1--; + cmpVal4(f2, 3); + cmpVal4(f1, 2); + f2 = ++f1; + cmpVal4(f1, 3); + cmpVal4(f2, 3); + f2 = --f1; + cmpVal4(f1, 2); + cmpVal4(f2, 2); + + f2 = ~f1; + cmpVal4(f2, -3); + assert(!f1 == false); + + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f1 = f1 * (unsigned char)1; + cmpVal4(f1, 3); + f1 = (unsigned char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed char)1; + cmpVal4(f1, 3); + f1 = (signed char)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned short)1; + cmpVal4(f1, 3); + f1 = (unsigned short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed short)1; + cmpVal4(f1, 3); + f1 = (signed short)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned int)1; + cmpVal4(f1, 3); + f1 = (unsigned int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed int)1; + cmpVal4(f1, 3); + f1 = (signed int)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (float)1; + cmpVal4(f1, 3); + f1 = (float)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long)1; + cmpVal4(f1, 3); + f1 = (unsigned long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (signed long)1; + cmpVal4(f1, 3); + f1 = (signed long)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (double)1; + cmpVal4(f1, 3); + f1 = (double)1 * f1; + cmpVal4(f1, 3); + f1 = f1 * (unsigned long long)1; + cmpVal4(f1, 3); + f1 = (unsigned long long)1 * f1; + cmpVal4(f1, 3); + + longlong4 fa1((unsigned char)1); + longlong4 fa2((unsigned char)1, (unsigned char)1, (unsigned char)1, (unsigned char)1); + longlong4 fb1((signed char)1); + longlong4 fb2((signed char)1, (signed char)1, (signed char)1, (signed char)1); + longlong4 fc1((unsigned short)1); + longlong4 fc2((unsigned short)1, (unsigned short)1, (unsigned short)1, (unsigned short)1); + longlong4 fd1((signed short)1); + longlong4 fd2((signed short)1, (signed short)1, (signed short)1, (signed short)1); + longlong4 fe1((unsigned int)1); + longlong4 fe2((unsigned int)1, (unsigned int)1, (unsigned int)1, (unsigned int)1); + longlong4 fg1((signed int)1); + longlong4 fg2((signed int)1, (signed int)1, (signed int)1, (signed int)1); + longlong4 fh1((float)1); + longlong4 fh2((float)1, (float)1, (float)1, (float)1); + longlong4 fi1((double)1); + longlong4 fi2((double)1, (double)1, (double)1, (double)1); + longlong4 fj1((unsigned long)1); + longlong4 fj2((unsigned long)1, (unsigned long)1, (unsigned long)1, (unsigned long)1); + longlong4 fk1((signed long)1); + longlong4 fk2((signed long)1, (signed long)1, (signed long)1, (signed long)1); + longlong4 fl1((unsigned long long)1); + longlong4 fl2((unsigned long long)1, (unsigned long long)1, (unsigned long long)1, (unsigned long long)1); + longlong4 fm1((signed long long)1); + longlong4 fm2((signed long long)1, (signed long long)1, (signed long long)1, (signed long long)1); + + + f1.x = 3; + f1.y = 3; + f1.z = 3; + f1.w = 3; + f2.x = 4; + f2.y = 4; + f2.z = 4; + f2.w = 4; + f3.x = 3; + f3.y = 3; + f3.z = 3; + f3.w = 3; + assert((f1 == f2) == false); + assert((f1 != f2) == true); + assert((f1 < f2) == true); + assert((f2 > f1) == true); + assert((f1 >= f3) == true); + assert((f1 <= f3) == true); + + assert((f1 && f2) == true); + assert((f1 || f2) == true); + return true; +} + int main() { assert(sizeof(float1) == 4); assert(sizeof(float2) == 8); assert(sizeof(float3) == 12); assert(sizeof(float4) == 16); assert(TestFloat1() && TestFloat2() && TestFloat3() && TestFloat4() + && TestDouble1() && TestDouble2() && TestDouble3() && TestDouble4() && TestUChar1() && TestUChar2() && TestUChar3() && TestUChar4() && TestChar1() && TestChar2() && TestChar3() && TestChar4() && TestUShort1() && TestUShort2() && TestUShort3() && TestUShort4() @@ -3480,7 +7830,9 @@ int main() { && TestUInt1() && TestUInt2() && TestUInt3() && TestUInt4() && TestInt1() && TestInt2() && TestInt3() && TestInt4() && TestULong1() && TestULong2() && TestULong3() && TestULong4() - && TestLong1() && TestLong2() && TestLong3() && TestLong4() == true); + && TestLong1() && TestLong2() && TestLong3() && TestLong4() + && TestULongLong1() && TestULongLong2() && TestULongLong3() && TestULongLong4() + && TestLongLong1() && TestLongLong2() && TestLongLong3() && TestLongLong4() == true); passed(); float1 f1 = make_float1(1.0f); }