fix raw_pread_aligned return value
[qemu-kvm/fedora.git] / tests / cris / check_int64.c
blob99ca6f1158ed0c62adeed4915ff8f5bb5172a826
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <stdint.h>
4 #include "sys.h"
5 #include "crisutils.h"
8 extern inline int64_t add64(const int64_t a, const int64_t b) {
9 return a + b;
12 extern inline int64_t sub64(const int64_t a, const int64_t b) {
13 return a - b;
16 int main(void)
18 int64_t a = 1;
19 int64_t b = 2;
21 /* FIXME: add some tests. */
22 a = add64(a, b);
23 if (a != 3)
24 err();
26 a = sub64(a, b);
27 if (a != 1)
28 err();
30 a = add64(a, -4);
31 if (a != -3)
32 err();
34 a = add64(a, 3);
35 if (a != 0)
36 err();
38 a = 0;
39 a = sub64(a, 1);
40 if (a != -1)
41 err();
43 pass();
44 return 0;