repo.or.cz
/
qemu.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git]
/
tests
/
tcg
/
cris
/
libc
/
check_int64.c
blob
69caec1bb24de64673584d8edd85ee8a302b41c0
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <stdint.h>
4
#include
"sys.h"
5
#include
"crisutils.h"
6
7
8
static
always_inline
int64_t
add64
(
const int64_t
a
,
const int64_t
b
)
9
{
10
return
a
+
b
;
11
}
12
13
static
always_inline
int64_t
sub64
(
const int64_t
a
,
const int64_t
b
)
14
{
15
return
a
-
b
;
16
}
17
18
int
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
}