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

Side by Side Diff: crosstest/simple_loop_main.c

Issue 1706883003: Subzero. Removes X8664_STACK_HACK from the crosstests. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: removes code setting the stack size Created 4 years, 10 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/mem_intrin_main.cpp ('k') | crosstest/stack_hack.x8664.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* crosstest.py --test=simple_loop.c --driver=simple_loop_main.c \ 1 /* crosstest.py --test=simple_loop.c --driver=simple_loop_main.c \
2 --prefix=Subzero_ --output=simple_loop */ 2 --prefix=Subzero_ --output=simple_loop */
3 3
4 #include <stdio.h> 4 #include <stdio.h>
5 5
6 int simple_loop(int *a, int n); 6 int simple_loop(int *a, int n);
7 int Subzero_simple_loop(int *a, int n); 7 int Subzero_simple_loop(int *a, int n);
8 8
9 #ifdef X8664_STACK_HACK
10 int wrapped_main(int argc, char *argv[]) {
11 #else // !defined(X8664_STACK_HACK)
12 int main(int argc, char *argv[]) { 9 int main(int argc, char *argv[]) {
13 #endif // X8664_STACK_HACK
14 unsigned TotalTests = 0; 10 unsigned TotalTests = 0;
15 unsigned Passes = 0; 11 unsigned Passes = 0;
16 unsigned Failures = 0; 12 unsigned Failures = 0;
17 int a[100]; 13 int a[100];
18 for (int i = 0; i < 100; ++i) 14 for (int i = 0; i < 100; ++i)
19 a[i] = i * 2 - 100; 15 a[i] = i * 2 - 100;
20 for (int i = -2; i < 100; ++i) { 16 for (int i = -2; i < 100; ++i) {
21 ++TotalTests; 17 ++TotalTests;
22 int llc_result = simple_loop(a, i); 18 int llc_result = simple_loop(a, i);
23 int sz_result = Subzero_simple_loop(a, i); 19 int sz_result = Subzero_simple_loop(a, i);
24 if (llc_result == sz_result) { 20 if (llc_result == sz_result) {
25 ++Passes; 21 ++Passes;
26 } else { 22 } else {
27 ++Failures; 23 ++Failures;
28 printf("Failure: i=%d, llc=%d, sz=%d\n", i, llc_result, sz_result); 24 printf("Failure: i=%d, llc=%d, sz=%d\n", i, llc_result, sz_result);
29 } 25 }
30 } 26 }
31 printf("TotalTests=%u Passes=%u Failures=%u\n", TotalTests, Passes, Failures); 27 printf("TotalTests=%u Passes=%u Failures=%u\n", TotalTests, Passes, Failures);
32 return Failures; 28 return Failures;
33 } 29 }
OLDNEW
« no previous file with comments | « crosstest/mem_intrin_main.cpp ('k') | crosstest/stack_hack.x8664.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698