| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #undef NDEBUG | 7 #undef NDEBUG |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdlib.h> | 10 #include <stdlib.h> |
| 11 #include <assert.h> | 11 #include <assert.h> |
| 12 #include <stdarg.h> | 12 #include <stdarg.h> |
| 13 #include <string.h> | 13 #include <string.h> |
| 14 #include <callingconv.h> | 14 #include <callingconv.h> |
| 15 | 15 |
| 16 /* Keep track of current function, call, and satisfied asserts */ | 16 /* Keep track of current function, call, and satisfied asserts */ |
| 17 int current_module = -1; | 17 int current_module = -1; |
| 18 int current_call = -1; | 18 int current_call = -1; |
| 19 int current_function = -1; | 19 int current_function = -1; |
| 20 int *current_index_p = NULL; | 20 int *current_index_p = NULL; |
| 21 int assert_count = 0; | 21 int assert_count = 0; |
| 22 | 22 |
| 23 const char *script_argv; | 23 const char *script_argv; |
| 24 void module0(void); | 24 void module0(void) __attribute__((weak)); |
| 25 void module1(void); | 25 void module1(void) __attribute__((weak)); |
| 26 void module2(void); | 26 void module2(void) __attribute__((weak)); |
| 27 void module3(void); | 27 void module3(void) __attribute__((weak)); |
| 28 void module4(void) __attribute__((weak)); |
| 29 void module5(void) __attribute__((weak)); |
| 28 | 30 |
| 29 int main(int argc, const char *argv[]) { | 31 int main(int argc, const char *argv[]) { |
| 30 module0(); | 32 if (module0) module0(); |
| 31 module1(); | 33 if (module1) module1(); |
| 32 module2(); | 34 if (module2) module2(); |
| 33 module3(); | 35 if (module3) module3(); |
| 36 if (module4) module4(); |
| 37 if (module5) module5(); |
| 34 | 38 |
| 35 printf("generate.py arguments: %s\n", script_argv); | 39 printf("generate.py arguments: %s\n", script_argv); |
| 36 printf("SUCCESS: %d calls OK.\n", assert_count); | 40 printf("SUCCESS: %d calls OK.\n", assert_count); |
| 37 return 0; | 41 return 0; |
| 38 } | 42 } |
| 39 | 43 |
| 40 | 44 |
| 41 /* Helper for setting values in tiny_t struct */ | 45 /* Helper for setting values in tiny_t struct */ |
| 42 void set_tiny_t(tiny_t *ptr, char a, short b) { | 46 void set_tiny_t(tiny_t *ptr, char a, short b) { |
| 43 ptr->a = a; | 47 ptr->a = a; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 85 |
| 82 int tiny_cmp(const tiny_t x, const tiny_t y) { | 86 int tiny_cmp(const tiny_t x, const tiny_t y) { |
| 83 return EQ(a) && EQ(b); | 87 return EQ(a) && EQ(b); |
| 84 } | 88 } |
| 85 | 89 |
| 86 int big_cmp(const big_t x, const big_t y) { | 90 int big_cmp(const big_t x, const big_t y) { |
| 87 return EQ(a) && EQ(b) && EQ(c) && EQ(d) && | 91 return EQ(a) && EQ(b) && EQ(c) && EQ(d) && |
| 88 EQ(e) && EQ(f) && EQ(g) && EQ(h) && | 92 EQ(e) && EQ(f) && EQ(g) && EQ(h) && |
| 89 EQ(i) && EQ(j) && EQ(k) && EQ(l) && EQ(m); | 93 EQ(i) && EQ(j) && EQ(k) && EQ(l) && EQ(m); |
| 90 } | 94 } |
| OLD | NEW |