hw/omap1.c: Add fallthrough markers and breaks
[qemu/pbrook.git] / tests / tcg / cris / check_int64.c
blobfc600176e2329711988e056dd6af39e57aff40e3
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <stdint.h>
4 #include "sys.h"
5 #include "crisutils.h"
8 static inline int64_t add64(const int64_t a, const int64_t b)
10 return a + b;
13 static inline int64_t sub64(const int64_t a, const int64_t b)
15 return a - b;
18 int main(void)
20 int64_t a = 1;
21 int64_t b = 2;
23 /* FIXME: add some tests. */
24 a = add64(a, b);
25 if (a != 3)
26 err();
28 a = sub64(a, b);
29 if (a != 1)
30 err();
32 a = add64(a, -4);
33 if (a != -3)
34 err();
36 a = add64(a, 3);
37 if (a != 0)
38 err();
40 a = 0;
41 a = sub64(a, 1);
42 if (a != -1)
43 err();
45 pass();
46 return 0;