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

Side by Side Diff: crosstest/test_global_main.cpp

Issue 435353002: Subzero: Fix and clean up some cross tests. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Fix newlines and filename Created 6 years, 4 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') | crosstest/test_icmp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/crosstest/test_global_main.cpp - 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 crosstesting global variable access operations.
11 //
12 //===----------------------------------------------------------------------===//
13
1 /* crosstest.py --test=test_global.cpp \ 14 /* crosstest.py --test=test_global.cpp \
2 --driver=test_global_main.cpp --prefix=Subzero_ --output=test_global */ 15 --driver=test_global_main.cpp --prefix=Subzero_ --output=test_global */
3 16
4 #include <stdint.h> 17 #include <stdint.h>
5 #include <cstdlib> 18 #include <cstdlib>
6 #include <iostream> 19 #include <iostream>
7 20
8 #include "test_global.h" 21 #include "test_global.h"
9 namespace Subzero_ { 22 namespace Subzero_ {
10 #include "test_global.h" 23 #include "test_global.h"
(...skipping 11 matching lines...) Expand all
22 for (size_t i = 0; i < NumArrays; ++i) { 35 for (size_t i = 0; i < NumArrays; ++i) {
23 LlcArrayLen = -1; 36 LlcArrayLen = -1;
24 SzArrayLen = -2; 37 SzArrayLen = -2;
25 LlcArray = getArray(i, LlcArrayLen); 38 LlcArray = getArray(i, LlcArrayLen);
26 SzArray = Subzero_::getArray(i, SzArrayLen); 39 SzArray = Subzero_::getArray(i, SzArrayLen);
27 ++TotalTests; 40 ++TotalTests;
28 if (LlcArrayLen == SzArrayLen) { 41 if (LlcArrayLen == SzArrayLen) {
29 ++Passes; 42 ++Passes;
30 } else { 43 } else {
31 std::cout << i << ":LlcArrayLen=" << LlcArrayLen 44 std::cout << i << ":LlcArrayLen=" << LlcArrayLen
32 << ", SzArrayLen=" << SzArrayLen << std::endl; 45 << ", SzArrayLen=" << SzArrayLen << "\n";
33 ++Failures; 46 ++Failures;
34 } 47 }
35 48
36 for (size_t i = 0; i < LlcArrayLen; ++i) { 49 for (size_t i = 0; i < LlcArrayLen; ++i) {
37 ++TotalTests; 50 ++TotalTests;
38 if (LlcArray[i] == SzArray[i]) { 51 if (LlcArray[i] == SzArray[i]) {
39 ++Passes; 52 ++Passes;
40 } else { 53 } else {
41 ++Failures; 54 ++Failures;
42 std::cout << i << ":LlcArray[" << i << "] = " << (int)LlcArray[i] 55 std::cout << i << ":LlcArray[" << i << "] = " << (int)LlcArray[i]
43 << ", SzArray[" << i << "] = " << (int)SzArray[i] 56 << ", SzArray[" << i << "] = " << (int)SzArray[i]
44 << std::endl; 57 << "\n";
45 } 58 }
46 } 59 }
47 } 60 }
48 61
49 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes 62 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes
50 << " Failures=" << Failures << "\n"; 63 << " Failures=" << Failures << "\n";
51 return Failures; 64 return Failures;
52 } 65 }
OLDNEW
« no previous file with comments | « crosstest/test_global.cpp ('k') | crosstest/test_icmp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698