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. |
(...skipping 21 matching lines...) Expand all Loading... |
32 double d; | 32 double d; |
33 }; | 33 }; |
34 | 34 |
35 struct Data SimpleData = {-111, 2.69, 55.19}; | 35 struct Data SimpleData = {-111, 2.69, 55.19}; |
36 | 36 |
37 struct Data *ExternName4 = &SimpleData; | 37 struct Data *ExternName4 = &SimpleData; |
38 | 38 |
39 double ExternName5 = 3.44e26; | 39 double ExternName5 = 3.44e26; |
40 | 40 |
41 int main(int argc, char **argv) { | 41 int main(int argc, char **argv) { |
| 42 // Prevent pnacl-opt from deleting "unused" globals. |
| 43 if (argc < 0) { |
| 44 std::cout << &ExternName1 << &ExternName2 << &ExternName3 << &SimpleData |
| 45 << &ExternName4 << ExternName5; |
| 46 } |
42 size_t TotalTests = 0; | 47 size_t TotalTests = 0; |
43 size_t Passes = 0; | 48 size_t Passes = 0; |
44 size_t Failures = 0; | 49 size_t Failures = 0; |
45 | 50 |
46 const uint8_t *SzArray, *LlcArray; | 51 const uint8_t *SzArray, *LlcArray; |
47 size_t SzArrayLen, LlcArrayLen; | 52 size_t SzArrayLen, LlcArrayLen; |
48 | 53 |
49 size_t NumArrays = getNumArrays(); | 54 size_t NumArrays = getNumArrays(); |
50 for (size_t i = 0; i < NumArrays; ++i) { | 55 for (size_t i = 0; i < NumArrays; ++i) { |
51 LlcArrayLen = -1; | 56 LlcArrayLen = -1; |
(...skipping 18 matching lines...) Expand all Loading... |
70 std::cout << i << ":LlcArray[" << i << "] = " << (int)LlcArray[i] | 75 std::cout << i << ":LlcArray[" << i << "] = " << (int)LlcArray[i] |
71 << ", SzArray[" << i << "] = " << (int)SzArray[i] << "\n"; | 76 << ", SzArray[" << i << "] = " << (int)SzArray[i] << "\n"; |
72 } | 77 } |
73 } | 78 } |
74 } | 79 } |
75 | 80 |
76 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes | 81 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes |
77 << " Failures=" << Failures << "\n"; | 82 << " Failures=" << Failures << "\n"; |
78 return Failures; | 83 return Failures; |
79 } | 84 } |
OLD | NEW |