diff options
| author | Jeff Garzik <jgarzik@redhat.com> | 2003-09-11 15:07:23 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:01:14 -0700 |
| commit | b9233b60767bdab82759e4786562ad3c3df69be0 (patch) | |
| tree | 78b510e7692425a6ba46710d3955147d7b9cceb3 /validation | |
| parent | 05904883b31cd2b7f783a148955f9fbe0f3215c5 (diff) | |
| download | sparse-dev-b9233b60767bdab82759e4786562ad3c3df69be0.tar.gz | |
[be] temporarily ignore size of a callee func call's return value.
Now, we just assume it's the ABI size (32 bits) rather than
care about the distinction between what we want to return up the
parse tree stack (possibly not 32 bits), and what the ABI gives
us (32 bits).
Also, add new file validation/test-be.c, to house a growing
collection of basic sanity checks I can run, to help avoid
regressions.
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/test-be.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/validation/test-be.c b/validation/test-be.c new file mode 100644 index 00000000..6dfa55fe --- /dev/null +++ b/validation/test-be.c @@ -0,0 +1,43 @@ +#include <stdio.h> +#include <stdlib.h> + +#undef PRINT_OUTPUTS + +static void test_func_args(int x, int y) +{ + if (x == y) + exit(1); +} + +static int binop_s32(int x, int y) +{ + int a; + + a = a + x; + a = a / y; + a = a * x; + a = a - y; + + return a; +} + +static void test_binops(void) +{ + int tmp_s32 = binop_s32(987123, 234); + +#ifdef PRINT_OUTPUTS + printf("binop_s32(987123, 234) == %d\n", tmp_s32); +#else + if (tmp_s32 != -1470599007) + exit(2); +#endif +} + +int main (int argc, char *argv[]) +{ + test_func_args(1, 2); + test_binops(); + + return 0; +} + |
