OLD | NEW |
1 //===- subzero/crosstest/test_cast_main.cpp - Driver for tests ------------===// | 1 //===- subzero/crosstest/test_cast_main.cpp - Driver for tests ------------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // Driver for crosstesting cast operations. | 10 // Driver for crosstesting cast operations. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Initialize the test vectors. | 107 // Initialize the test vectors. |
108 FromType Value; | 108 FromType Value; |
109 for (size_t j = 0; j < NumElementsInType; ++j) { | 109 for (size_t j = 0; j < NumElementsInType; ++j) { |
110 Value[j] = Values[Index() % NumValues]; | 110 Value[j] = Values[Index() % NumValues]; |
111 } | 111 } |
112 COMPARE_VEC(cast, FromType, ToType, Value, FromTypeString, ToTypeString); | 112 COMPARE_VEC(cast, FromType, ToType, Value, FromTypeString, ToTypeString); |
113 } | 113 } |
114 #endif // ARM32 | 114 #endif // ARM32 |
115 } | 115 } |
116 | 116 |
117 #ifdef X8664_STACK_HACK | |
118 extern "C" int wrapped_main(int argc, char *argv[]) { | |
119 #else // !defined(X8664_STACK_HACK) | |
120 int main(int argc, char *argv[]) { | 117 int main(int argc, char *argv[]) { |
121 #endif // X8664_STACK_HACK | |
122 size_t TotalTests = 0; | 118 size_t TotalTests = 0; |
123 size_t Passes = 0; | 119 size_t Passes = 0; |
124 size_t Failures = 0; | 120 size_t Failures = 0; |
125 | 121 |
126 volatile bool ValsUi1[] = {false, true}; | 122 volatile bool ValsUi1[] = {false, true}; |
127 static const size_t NumValsUi1 = sizeof(ValsUi1) / sizeof(*ValsUi1); | 123 static const size_t NumValsUi1 = sizeof(ValsUi1) / sizeof(*ValsUi1); |
128 volatile uint8_t ValsUi8[] = {0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff}; | 124 volatile uint8_t ValsUi8[] = {0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff}; |
129 static const size_t NumValsUi8 = sizeof(ValsUi8) / sizeof(*ValsUi8); | 125 static const size_t NumValsUi8 = sizeof(ValsUi8) / sizeof(*ValsUi8); |
130 | 126 |
131 volatile myint8_t ValsSi8[] = {0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff}; | 127 volatile myint8_t ValsSi8[] = {0, 1, 0x7e, 0x7f, 0x80, 0x81, 0xfe, 0xff}; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 235 } |
240 testVector<v4ui32, v4f32>(TotalTests, Passes, Failures, "v4ui32", "v4f32"); | 236 testVector<v4ui32, v4f32>(TotalTests, Passes, Failures, "v4ui32", "v4f32"); |
241 testVector<v4si32, v4f32>(TotalTests, Passes, Failures, "v4si32", "v4f32"); | 237 testVector<v4si32, v4f32>(TotalTests, Passes, Failures, "v4si32", "v4f32"); |
242 testVector<v4f32, v4si32>(TotalTests, Passes, Failures, "v4f32", "v4si32"); | 238 testVector<v4f32, v4si32>(TotalTests, Passes, Failures, "v4f32", "v4si32"); |
243 testVector<v4f32, v4ui32>(TotalTests, Passes, Failures, "v4f32", "v4ui32"); | 239 testVector<v4f32, v4ui32>(TotalTests, Passes, Failures, "v4f32", "v4ui32"); |
244 | 240 |
245 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes | 241 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes |
246 << " Failures=" << Failures << "\n"; | 242 << " Failures=" << Failures << "\n"; |
247 return Failures; | 243 return Failures; |
248 } | 244 } |
OLD | NEW |