OLD | NEW |
1 //===- subzero/crosstest/test_stacksave_main.c - Driver for tests ---------===// | 1 //===- subzero/crosstest/test_stacksave_main.c - 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 cross testing stacksave/stackrestore intrinsics. | 10 // Driver for cross testing stacksave/stackrestore intrinsics. |
11 // | 11 // |
12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
13 | 13 |
14 /* crosstest.py --test=test_stacksave.c --driver=test_stacksave_main.c \ | 14 /* crosstest.py --test=test_stacksave.c --driver=test_stacksave_main.c \ |
15 --prefix=Subzero_ --output=test_stacksave */ | 15 --prefix=Subzero_ --output=test_stacksave */ |
16 | 16 |
17 #include <inttypes.h> | 17 #include <inttypes.h> |
18 #include <stdint.h> | 18 #include <stdint.h> |
19 #include <stdio.h> | 19 #include <stdio.h> |
20 | 20 |
21 #include "test_stacksave.h" | 21 #include "test_stacksave.h" |
22 DECLARE_TESTS() | 22 DECLARE_TESTS() |
23 DECLARE_TESTS(Subzero_) | 23 DECLARE_TESTS(Subzero_) |
24 | 24 |
25 #ifdef X8664_STACK_HACK | |
26 int wrapped_main(int argc, char *argv[]) { | |
27 #else // !defined(X8664_STACK_HACK) | |
28 int main(int argc, char *argv[]) { | 25 int main(int argc, char *argv[]) { |
29 #endif // X8664_STACK_HACK | |
30 size_t TotalTests = 0; | 26 size_t TotalTests = 0; |
31 size_t Passes = 0; | 27 size_t Passes = 0; |
32 size_t Failures = 0; | 28 size_t Failures = 0; |
33 typedef uint32_t (*FuncType)(uint32_t, uint32_t, uint32_t); | 29 typedef uint32_t (*FuncType)(uint32_t, uint32_t, uint32_t); |
34 static struct { | 30 static struct { |
35 const char *Name; | 31 const char *Name; |
36 FuncType FuncLlc; | 32 FuncType FuncLlc; |
37 FuncType FuncSz; | 33 FuncType FuncSz; |
38 } Funcs[] = {{"test_basic_vla", test_basic_vla, Subzero_test_basic_vla}, | 34 } Funcs[] = {{"test_basic_vla", test_basic_vla, Subzero_test_basic_vla}, |
39 {"test_vla_in_loop", test_vla_in_loop, Subzero_test_vla_in_loop}, | 35 {"test_vla_in_loop", test_vla_in_loop, Subzero_test_vla_in_loop}, |
(...skipping 14 matching lines...) Expand all Loading... |
54 printf("Failure %s: start=%" PRIu32 ", " | 50 printf("Failure %s: start=%" PRIu32 ", " |
55 "llc=%" PRIu32 ", sz=%" PRIu32 "\n", | 51 "llc=%" PRIu32 ", sz=%" PRIu32 "\n", |
56 Funcs[f].Name, start, llc_result, sz_result); | 52 Funcs[f].Name, start, llc_result, sz_result); |
57 } | 53 } |
58 } | 54 } |
59 } | 55 } |
60 printf("TotalTests=%zu Passes=%zu Failures=%zu\n", TotalTests, Passes, | 56 printf("TotalTests=%zu Passes=%zu Failures=%zu\n", TotalTests, Passes, |
61 Failures); | 57 Failures); |
62 return Failures; | 58 return Failures; |
63 } | 59 } |
OLD | NEW |