OLD | NEW |
1 //===- subzero/crosstest/test_global_main.cpp - Driver for tests ----------===// | 1 //===- subzero/crosstest/test_global_main.cpp - Driver for tests ----------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // Driver for crosstesting global variable access operations. | 10 // Driver for crosstesting global variable access operations. |
11 // | 11 // |
12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
13 | 13 |
14 /* crosstest.py --test=test_global.cpp \ | 14 /* crosstest.py --test=test_global.cpp \ |
15 --driver=test_global_main.cpp --prefix=Subzero_ --output=test_global */ | 15 --driver=test_global_main.cpp --prefix=Subzero_ --output=test_global */ |
16 | 16 |
17 #include <stdint.h> | 17 #include <stdint.h> |
18 #include <cstdlib> | 18 #include <cstdlib> |
19 #include <iostream> | 19 #include <iostream> |
20 | 20 |
21 #include "test_global.h" | 21 #include "test_global.h" |
22 namespace Subzero_ { | 22 namespace Subzero_ { |
23 #include "test_global.h" | 23 #include "test_global.h" |
24 } | 24 } |
25 | 25 |
| 26 int ExternName1 = 36363; |
| 27 float ExternName2 = 357.05e-10; |
| 28 char ExternName3[] = {'a', 'b', 'c'}; |
| 29 struct { |
| 30 int a; |
| 31 float b; |
| 32 double d; |
| 33 } ExternName4 = {-111, 2.69, 55.19}; |
| 34 double ExternName5 = 3.44e26; |
| 35 |
26 int main(int argc, char **argv) { | 36 int main(int argc, char **argv) { |
27 size_t TotalTests = 0; | 37 size_t TotalTests = 0; |
28 size_t Passes = 0; | 38 size_t Passes = 0; |
29 size_t Failures = 0; | 39 size_t Failures = 0; |
30 | 40 |
31 const uint8_t *SzArray, *LlcArray; | 41 const uint8_t *SzArray, *LlcArray; |
32 size_t SzArrayLen, LlcArrayLen; | 42 size_t SzArrayLen, LlcArrayLen; |
33 | 43 |
34 size_t NumArrays = getNumArrays(); | 44 size_t NumArrays = getNumArrays(); |
35 for (size_t i = 0; i < NumArrays; ++i) { | 45 for (size_t i = 0; i < NumArrays; ++i) { |
(...skipping 20 matching lines...) Expand all Loading... |
56 << ", SzArray[" << i << "] = " << (int)SzArray[i] | 66 << ", SzArray[" << i << "] = " << (int)SzArray[i] |
57 << "\n"; | 67 << "\n"; |
58 } | 68 } |
59 } | 69 } |
60 } | 70 } |
61 | 71 |
62 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes | 72 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes |
63 << " Failures=" << Failures << "\n"; | 73 << " Failures=" << Failures << "\n"; |
64 return Failures; | 74 return Failures; |
65 } | 75 } |
OLD | NEW |