Changeset 7799f79 for tests/vector
- Timestamp:
- Dec 13, 2019, 7:41:58 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- ae09808
- Parents:
- ae3db00
- Location:
- tests/vector
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/vector/.expect/vec2_float.txt
rae3db00 r7799f79 14 14 s*v:<4.5,8.25> 15 15 ?*=?:<4.5,8.25> 16 ?*?(vec)<2.64,-17.4> 17 ?*=?(vec)<2.64,-17.4> 16 18 ?/?:<0.666667,-0.0333333> 17 19 ?/=?:<0.666667,-0.0333333> 20 ?/?(vec)<0.545455,-1.93333> 21 ?/=?(vec)<0.545455,-1.93333> 22 ++?<2.2,-2.5> 23 --?<2.2,-2.5> 24 ?++(part 1)<1.2,-3.5> 25 ?++(part 2)<2.2,-2.5> 26 ?--(part 1)<1.2,-3.5> 27 ?--(part 2)<0.2,-4.5> 18 28 dot_1:0. 19 29 dot_2:8.6 -
tests/vector/.expect/vec2_int.txt
rae3db00 r7799f79 14 14 s*v:<45,825> 15 15 ?*=?:<45,825> 16 ?*?(vec)<2,-15> 17 ?*=?(vec)<2,-15> 16 18 ?/?:<7,-3> 17 19 ?/=?:<7,-3> 20 ?/?(vec)<5,-1> 21 ?/=?(vec)<5,-1> 22 ++?<2,-2> 23 --?<2,-2> 24 ?++(part 1)<1,-3> 25 ?++(part 2)<2,-2> 26 ?--(part 1)<1,-3> 27 ?--(part 2)<0,-4> 28 ?%?(int)<0,1> 29 ?%=?(int)<0,1> 30 ?%?(vec)<-2,3> 31 ?%=?(vec)<-2,3> 32 ?&?(int)<0,8> 33 ?&=?(int)<0,8> 34 ?&?(vec)<1,6> 35 ?&=?(vec)<1,6> 36 ?|?(int)<7,3> 37 ?|=?(int)<7,3> 38 ?|?(vec)<7,1> 39 ?|=?(vec)<7,1> 40 ?^?(int)<12,0> 41 ?^=?(int)<12,0> 42 ?^?(vec)<12,5> 43 ?^=?(vec)<12,5> 44 ?<<?(int)<4,2> 45 ?<<=?(int)<4,2> 46 ?<<?(vec)<32,4> 47 ?<<=?(vec)<32,4> 48 ~?<-6,-3> 18 49 dot_1:0 19 50 dot_2:32 -
tests/vector/vec2_float.cfa
rae3db00 r7799f79 47 47 sout | "?*=?:" | v1; 48 48 49 { 50 vec2(float) u = {1.2f, -5.8f}; 51 vec2(float) v = {2.2f, 3}; 52 sout | "?*?(vec)" | (u * v); 53 sout | "?*=?(vec)" | (u *= v); 54 } 55 56 49 57 v1 = (vec2(float)){2, -0.1f}; 50 58 sout | "?/?:" | (v1 / 3); … … 52 60 v1 /= 3; 53 61 sout | "?/=?:" | v1; 62 63 { 64 vec2(float) u = {1.2f, -5.8f}; 65 vec2(float) v = {2.2f, 3}; 66 sout | "?/?(vec)" | (u / v); 67 sout | "?/=?(vec)" | (u /= v); 68 } 69 70 { 71 vec2(float) u = {1.2f, -3.5f}; 72 sout | "++?" | ++u; 73 } 74 { 75 vec2(float) u = {1.2f, -3.5f}; 76 sout | "--?" | ++u; 77 } 78 { 79 vec2(float) u = {1.2f, -3.5f}; 80 sout | "?++(part 1)" | u++; 81 sout | "?++(part 2)" | u; 82 } 83 { 84 vec2(float) u = {1.2f, -3.5f}; 85 sout | "?--(part 1)" | u--; 86 sout | "?--(part 2)" | u; 87 } 54 88 55 89 v1 = (vec2(float)){2, 3}; -
tests/vector/vec2_int.cfa
rae3db00 r7799f79 48 48 sout | "?*=?:" | v1; 49 49 50 { 51 vec2(int) u = {1, -5}; 52 vec2(int) v = {2, 3}; 53 sout | "?*?(vec)" | (u * v); 54 sout | "?*=?(vec)" | (u *= v); 55 } 56 50 57 v1 = (vec2(int)){21, -10}; 51 58 sout | "?/?:" | (v1 / 3); … … 53 60 v1 /= 3; 54 61 sout | "?/=?:" | v1; 62 63 { 64 vec2(int) u = {11, -5}; 65 vec2(int) v = {2, 3}; 66 sout | "?/?(vec)" | (u / v); 67 sout | "?/=?(vec)" | (u /= v); 68 } 69 70 { 71 vec2(int) u = {1, -3}; 72 sout | "++?" | ++u; 73 } 74 { 75 vec2(int) u = {1, -3}; 76 sout | "--?" | ++u; 77 } 78 { 79 vec2(int) u = {1, -3}; 80 sout | "?++(part 1)" | u++; 81 sout | "?++(part 2)" | u; 82 } 83 { 84 vec2(int) u = {1, -3}; 85 sout | "?--(part 1)" | u--; 86 sout | "?--(part 2)" | u; 87 } 88 89 // % 90 { 91 vec2(int) u = {-12, 123}; 92 sout | "?%?(int)" | (u % 2); 93 sout | "?%=?(int)" | (u %= 2); 94 } 95 { 96 vec2(int) u = {-12, 27}; 97 vec2(int) v = {5, 4}; 98 sout | "?%?(vec)" | (u % v); 99 sout | "?%=?(vec)" | (u %= v); 100 } 101 102 103 // & 104 { 105 vec2(int) u = {5, 8}; 106 sout | "?&?(int)" | (u & (1 << 3)); 107 sout | "?&=?(int)" | (u &= (1 << 3)); 108 } 109 { 110 vec2(int) u = {5, 6}; 111 vec2(int) v = {3, 7}; 112 sout | "?&?(vec)" | (u & v); 113 sout | "?&=?(vec)" | (u &= v); 114 } 115 116 // | 117 { 118 vec2(int) u = {5, 1}; 119 sout | "?|?(int)" | (u | 2); 120 sout | "?|=?(int)" | (u |= 2); 121 } 122 { 123 vec2(int) u = {5, 1}; 124 vec2(int) v = {2, 1}; 125 sout | "?|?(vec)" | (u | v); 126 sout | "?|=?(vec)" | (u |= v); 127 } 128 129 // ^ 130 { 131 vec2(int) u = {9, 5}; 132 sout | "?^?(int)" | (u ^ 5); 133 sout | "?^=?(int)" | (u ^= 5); 134 } 135 { 136 vec2(int) u = {9, 5}; 137 vec2(int) v = {5, 0}; 138 sout | "?^?(vec)" | (u ^ v); 139 sout | "?^=?(vec)" | (u ^= v); 140 } 141 142 // << 143 { 144 vec2(int) u = {2, 1}; 145 sout | "?<<?(int)" | (u << 1); 146 sout | "?<<=?(int)" | (u <<= 1); 147 } 148 { 149 vec2(int) u = {1, 1}; 150 vec2(int) v = {5, 2}; 151 sout | "?<<?(vec)" | (u << v); 152 sout | "?<<=?(vec)" | (u <<= v); 153 } 154 155 // ~ 156 { 157 vec2(int) u = {5, 2}; 158 sout | "~?" | (~u); 159 } 55 160 56 161 v1 = (vec2(int)){2, 3};
Note: See TracChangeset
for help on using the changeset viewer.