OLD | NEW |
(Empty) | |
| 1 /* crosstest.py --test=test_global.cpp \ |
| 2 --driver=test_global_main.cpp --prefix=Subzero_ --output=test_global */ |
| 3 |
| 4 #include <stdint.h> |
| 5 #include <cstdlib> |
| 6 #include <iostream> |
| 7 |
| 8 #include "test_global.h" |
| 9 namespace Subzero_ { |
| 10 #include "test_global.h" |
| 11 } |
| 12 |
| 13 int main(int argc, char **argv) { |
| 14 size_t TotalTests = 0; |
| 15 size_t Passes = 0; |
| 16 size_t Failures = 0; |
| 17 |
| 18 const uint8_t *SzArray, *LlcArray; |
| 19 size_t SzArrayLen, LlcArrayLen; |
| 20 |
| 21 size_t NumArrays = getNumArrays(); |
| 22 for (size_t i = 0; i < NumArrays; ++i) { |
| 23 LlcArrayLen = -1; |
| 24 SzArrayLen = -2; |
| 25 LlcArray = getArray(i, LlcArrayLen); |
| 26 SzArray = Subzero_::getArray(i, SzArrayLen); |
| 27 if (LlcArrayLen == SzArrayLen) { |
| 28 ++Passes; |
| 29 } else { |
| 30 std::cout << i << ":LlcArrayLen=" << LlcArrayLen |
| 31 << ", SzArrayLen=" << SzArrayLen << std::endl; |
| 32 ++Failures; |
| 33 } |
| 34 |
| 35 for (size_t i = 0; i < LlcArrayLen; ++i) { |
| 36 if (LlcArray[i] == SzArray[i]) { |
| 37 ++Passes; |
| 38 } else { |
| 39 ++Failures; |
| 40 std::cout << i << ":LlcArray[" << i << "] = " << (int)LlcArray[i] |
| 41 << ", SzArray[" << i << "] = " << (int)SzArray[i] |
| 42 << std::endl; |
| 43 } |
| 44 } |
| 45 } |
| 46 |
| 47 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes |
| 48 << " Failures=" << Failures << "\n"; |
| 49 return Failures; |
| 50 } |
OLD | NEW |