| 1 |
// Stub for a main function which reads arguments from the command line, to be |
| 2 |
// used by the Eva plug-in. |
| 3 |
// This stub emulates non-deterministic input of up to 5 arguments, each up |
| 4 |
// to 256 characters long. This is sufficient to ensure arbitrary input in |
| 5 |
// virtually every case. |
| 6 |
// Do not forget to add option '-main eva_main' in order to use this stub. |
| 7 |
|
| 8 |
#ifdef __FRAMAC__ |
| 9 |
# include "__fc_builtin.h" |
| 10 |
int main(int, char **); |
| 11 |
static volatile int nondet; |
| 12 |
int eva_main() { |
| 13 |
int argc = Frama_C_interval(0, 5); |
| 14 |
char argv0[256], argv1[256], argv2[256], argv3[256], argv4[256]; |
| 15 |
char *argv[6] = {argv0, argv1, argv2, argv3, argv4, 0}; |
| 16 |
//@ loop unroll 5; |
| 17 |
for (int i = 0; i < 5; i++) { |
| 18 |
Frama_C_make_unknown(argv[i], 255); |
| 19 |
argv[i][255] = 0; |
| 20 |
} |
| 21 |
return main(argc, argv); |
| 22 |
} |
| 23 |
#endif // __FRAMAC__ |