Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / tests / tcg / cris / libc / check_int64.c
blob69caec1bb24de64673584d8edd85ee8a302b41c0
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <stdint.h>
4 #include "sys.h"
5 #include "crisutils.h"
8 static always_inline int64_t add64(const int64_t a, const int64_t b)
10 return a + b;
13 static always_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;