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

Side by Side Diff: crosstest/test_stacksave_main.c

Issue 396993009: Lower stacksave and restore intrinsics. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: rebase 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_stacksave.c ('k') | src/IceTargetLoweringX8632.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 //===- subzero/crosstest/test_stacksave_main.c - Driver for tests ---------===//
2 //
3 // The Subzero Code Generator
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Driver for cross testing stacksave/stackrestore intrinsics.
11 //
12 //===----------------------------------------------------------------------===//
13
14 /* crosstest.py --test=test_stacksave.c --driver=test_stacksave_main.c \
15 --prefix=Subzero_ --output=test_stacksave */
16
17 #include <inttypes.h>
18 #include <stdint.h>
19 #include <stdio.h>
20
21 #include "test_stacksave.h"
22 DECLARE_TESTS()
23 DECLARE_TESTS(Subzero_)
24
25 int main(int argc, char **argv) {
26 size_t TotalTests = 0;
27 size_t Passes = 0;
28 size_t Failures = 0;
29 typedef uint32_t (*FuncType)(uint32_t, uint32_t, uint32_t);
30 static struct {
31 const char *Name;
32 FuncType FuncLlc;
33 FuncType FuncSz;
34 } Funcs[] = {
35 { "test_basic_vla", test_basic_vla, Subzero_test_basic_vla },
36 { "test_vla_in_loop", test_vla_in_loop, Subzero_test_vla_in_loop },
37 { "test_two_vlas_in_loops", test_two_vlas_in_loops,
38 Subzero_test_two_vlas_in_loops }
39 };
40 const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs);
41 const uint32_t size_to_test = 128;
42 for (size_t f = 0; f < NumFuncs; ++f) {
43 for (uint32_t start = 0; start < size_to_test / 2; ++start) {
44 ++TotalTests;
45 uint32_t inc = (start / 10) + 1;
46 uint32_t llc_result = Funcs[f].FuncLlc(size_to_test, start, inc);
47 uint32_t sz_result = Funcs[f].FuncSz(size_to_test, start, inc);
48 if (llc_result == sz_result) {
49 ++Passes;
50 } else {
51 ++Failures;
52 printf("Failure %s: start=%" PRIu32 ", "
53 "llc=%" PRIu32 ", sz=%" PRIu32 "\n",
54 Funcs[f].Name, start, llc_result, sz_result);
55 }
56 }
57 }
58 printf("TotalTests=%zu Passes=%zu Failures=%zu\n",
59 TotalTests, Passes, Failures);
60 return Failures;
61 }
OLDNEW
« no previous file with comments | « crosstest/test_stacksave.c ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698