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

Unified 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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crosstest/test_global.cpp ('k') | src/IceInstX8632.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crosstest/test_global_main.cpp
diff --git a/crosstest/test_global_main.cpp b/crosstest/test_global_main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e533f9948c1e69897d0b7be5e4223b3837d7b3e5
--- /dev/null
+++ b/crosstest/test_global_main.cpp
@@ -0,0 +1,50 @@
+/* crosstest.py --test=test_global.cpp \
+ --driver=test_global_main.cpp --prefix=Subzero_ --output=test_global */
+
+#include <stdint.h>
+#include <cstdlib>
+#include <iostream>
+
+#include "test_global.h"
+namespace Subzero_ {
+#include "test_global.h"
+}
+
+int main(int argc, char **argv) {
+ size_t TotalTests = 0;
+ size_t Passes = 0;
+ size_t Failures = 0;
+
+ const uint8_t *SzArray, *LlcArray;
+ size_t SzArrayLen, LlcArrayLen;
+
+ size_t NumArrays = getNumArrays();
+ for (size_t i = 0; i < NumArrays; ++i) {
+ LlcArrayLen = -1;
+ SzArrayLen = -2;
+ LlcArray = getArray(i, LlcArrayLen);
+ SzArray = Subzero_::getArray(i, SzArrayLen);
+ if (LlcArrayLen == SzArrayLen) {
+ ++Passes;
+ } else {
+ std::cout << i << ":LlcArrayLen=" << LlcArrayLen
+ << ", SzArrayLen=" << SzArrayLen << std::endl;
+ ++Failures;
+ }
+
+ for (size_t i = 0; i < LlcArrayLen; ++i) {
+ if (LlcArray[i] == SzArray[i]) {
+ ++Passes;
+ } else {
+ ++Failures;
+ std::cout << i << ":LlcArray[" << i << "] = " << (int)LlcArray[i]
+ << ", SzArray[" << i << "] = " << (int)SzArray[i]
+ << std::endl;
+ }
+ }
+ }
+
+ std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes
+ << " Failures=" << Failures << "\n";
+ return Failures;
+}
« 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