Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Side by Side Diff: crosstest/test_global_main.cpp

Issue 358013003: Subzero: Partial implementation of global initializers. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: After rebasing from laster master Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « crosstest/test_global.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « crosstest/test_global.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698