Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-fast
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
40
Issues
40
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
mu
mu-impl-fast
Commits
04711fe7
Commit
04711fe7
authored
Nov 16, 2016
by
John Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix result type of function pointers
parent
4b638cbf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
test_binops.py
tests/test_jit/test_binops.py
+10
-9
test_cmpops.py
tests/test_jit/test_cmpops.py
+6
-5
test_convops.py
tests/test_jit/test_convops.py
+2
-2
No files found.
tests/test_jit/test_binops.py
View file @
04711fe7
from
util
import
fncptr_from_c_script
import
ctypes
def
test_add
():
fn
,
_
=
fncptr_from_c_script
(
"test_add.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_add.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint8
)
assert
fn
()
==
9
def
test_sub
():
fn
,
_
=
fncptr_from_c_script
(
"test_sub.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_sub.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint8
)
assert
fn
()
==
11
def
test_mul
():
fn
,
_
=
fncptr_from_c_script
(
"test_mul.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_mul.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint8
)
assert
fn
()
==
0xf6
def
test_sdiv
():
fn
,
_
=
fncptr_from_c_script
(
"test_sdiv.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_sdiv.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint8
)
assert
fn
()
==
0xf4
def
test_urem
():
fn
,
_
=
fncptr_from_c_script
(
"test_urem.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_urem.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint8
)
assert
fn
()
==
5
def
test_shl
():
fn
,
_
=
fncptr_from_c_script
(
"test_shl.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_shl.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint64
)
assert
fn
()
==
0x7e707560c92d5400
def
test_lshr
():
fn
,
_
=
fncptr_from_c_script
(
"test_lshr.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_lshr.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint64
)
assert
fn
()
==
0x2367e707560c92
def
test_and
():
fn
,
_
=
fncptr_from_c_script
(
"test_and.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_and.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint64
)
assert
fn
()
==
0x8588901c10004b14
def
test_xor
():
fn
,
_
=
fncptr_from_c_script
(
"test_xor.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_xor.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint64
)
assert
fn
()
==
0x58376ec3e83fa0e1
tests/test_jit/test_cmpops.py
View file @
04711fe7
from
util
import
fncptr_from_c_script
import
ctypes
def
test_eq_int
():
fn
,
_
=
fncptr_from_c_script
(
"test_eq_int.c"
,
"test_fnc"
)
...
...
@@ -17,21 +18,21 @@ def test_ne_ref():
assert
fn
()
==
1
def
test_sge
():
fn
,
_
=
fncptr_from_c_script
(
"test_sge.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_sge.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint8
)
assert
fn
()
==
1
def
test_sgt
():
fn
,
_
=
fncptr_from_c_script
(
"test_sgt.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_sgt.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint8
)
assert
fn
()
==
0
def
test_sle
():
fn
,
_
=
fncptr_from_c_script
(
"test_sle.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_sle.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint8
)
assert
fn
()
==
1
def
test_slt
():
fn
,
_
=
fncptr_from_c_script
(
"test_slt.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_slt.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint8
)
assert
fn
()
==
0
def
test_ult
():
fn
,
_
=
fncptr_from_c_script
(
"test_ult.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_ult.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint8
)
assert
fn
()
==
0
tests/test_jit/test_convops.py
View file @
04711fe7
from
util
import
fncptr_from_c_script
import
ctypes
def
test_trunc
():
fn
,
_
=
fncptr_from_c_script
(
"test_trunc.c"
,
"test_fnc"
)
fn
,
_
=
fncptr_from_c_script
(
"test_trunc.c"
,
"test_fnc"
,
restype
=
ctypes
.
c_uint32
)
assert
fn
()
==
0x58324b55
...
...
Write
Preview
Markdown
is supported
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