Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CertiCompil
CompCert-KVX
Commits
28db3119
Commit
28db3119
authored
Apr 25, 2018
by
Cyril SIX
Browse files
MPPA - Added test for division int by 2
parent
31d718c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/mppa/Makefile
View file @
28db3119
DIR
=
general
BINDIR
=
bin
ASMDIR
=
asm
TESTNAMES
=
simple call branch
for
forvar forvarl branchz branchzu
TESTNAMES
=
simple call branch
for
forvar forvarl branchz branchzu
div2
CCOMP
=
../../ccomp
#TESTS=$(addprefix $(DIR)/,$(TESTNAMES))
...
...
test/mppa/general/div2.c
0 → 100644
View file @
28db3119
#define SIZE 10
int
main
(
void
){
int
a
[
SIZE
],
b
[
SIZE
],
c
[
SIZE
];
int
i
;
for
(
i
=
0
;
i
<
SIZE
;
i
++
){
a
[
i
]
=
i
-
5
;
b
[
i
]
=
-
i
+
2
;
c
[
i
]
=
(
a
[
i
]
+
b
[
i
])
/
2
;
}
/* a = {-5, -4, .., 5}
* b = { 2, 1, .., -8}
*/
for
(
i
=
0
;
i
<
SIZE
;
i
++
)
if
(
c
[
i
]
!=
-
1
)
return
c
[
i
];
return
42
;
}
/* RETURN VALUE: 42 */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment