]> Git Repo - qemu.git/blame - tests/tcg/cris/check_int64.c
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
[qemu.git] / tests / tcg / cris / check_int64.c
CommitLineData
dd43edf4
TS
1#include <stdio.h>
2#include <stdlib.h>
3#include <stdint.h>
4#include "sys.h"
5#include "crisutils.h"
6
7
4a6648f4
BS
8static inline int64_t add64(const int64_t a, const int64_t b)
9{
dd43edf4
TS
10 return a + b;
11}
12
4a6648f4
BS
13static inline int64_t sub64(const int64_t a, const int64_t b)
14{
dd43edf4
TS
15 return a - b;
16}
17
18int main(void)
19{
20 int64_t a = 1;
21 int64_t b = 2;
22
23 /* FIXME: add some tests. */
24 a = add64(a, b);
25 if (a != 3)
26 err();
27
28 a = sub64(a, b);
29 if (a != 1)
30 err();
31
32 a = add64(a, -4);
33 if (a != -3)
34 err();
35
36 a = add64(a, 3);
37 if (a != 0)
38 err();
39
40 a = 0;
41 a = sub64(a, 1);
42 if (a != -1)
43 err();
44
45 pass();
46 return 0;
47}
This page took 0.696218 seconds and 4 git commands to generate.