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

Unified Diff: crosstest/simple_loop_main.c

Issue 265703002: Add Om1 lowering with no optimizations (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Merge changed from Karl's committed CL Created 6 years, 7 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/simple_loop.c ('k') | crosstest/test_arith.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crosstest/simple_loop_main.c
diff --git a/crosstest/simple_loop_main.c b/crosstest/simple_loop_main.c
new file mode 100644
index 0000000000000000000000000000000000000000..5ff36b87a109affc2f3d0ded533825e0ec978b4f
--- /dev/null
+++ b/crosstest/simple_loop_main.c
@@ -0,0 +1,29 @@
+/* crosstest.py --test=simple_loop.c --driver=simple_loop_main.c \
+ --prefix=Subzero_ --output=simple_loop */
+
+#include <stdio.h>
+
+int simple_loop(int *a, int n);
+int Subzero_simple_loop(int *a, int n);
+
+int main(int argc, char **argv) {
+ unsigned TotalTests = 0;
+ unsigned Passes = 0;
+ unsigned Failures = 0;
+ int a[100];
+ for (int i = 0; i < 100; ++i)
+ a[i] = i * 2 - 100;
+ for (int i = -2; i < 100; ++i) {
+ ++TotalTests;
+ int llc_result = simple_loop(a, i);
+ int sz_result = Subzero_simple_loop(a, i);
+ if (llc_result == sz_result) {
+ ++Passes;
+ } else {
+ ++Failures;
+ printf("Failure: i=%d, llc=%d, sz=%d\n", i, llc_result, sz_result);
+ }
+ }
+ printf("TotalTests=%u Passes=%u Failures=%u\n", TotalTests, Passes, Failures);
+ return Failures;
+}
« no previous file with comments | « crosstest/simple_loop.c ('k') | crosstest/test_arith.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698