Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Kaznacheev
GHC
Commits
0bdf1b7a
Commit
0bdf1b7a
authored
7 years ago
by
Ben Gamari
Browse files
Options
Downloads
Patches
Plain Diff
testsuite: Add test for #14768
(cherry picked from commit
da468130
)
parent
583e392a
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
testsuite/tests/simplCore/should_run/T14768.hs
+59
-0
59 additions, 0 deletions
testsuite/tests/simplCore/should_run/T14768.hs
testsuite/tests/simplCore/should_run/all.T
+1
-0
1 addition, 0 deletions
testsuite/tests/simplCore/should_run/all.T
with
60 additions
and
0 deletions
testsuite/tests/simplCore/should_run/T14768.hs
0 → 100644
+
59
−
0
View file @
0bdf1b7a
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
module
Main
where
import
Control.Monad
(
forM_
,
liftM
)
import
qualified
Data.Vector.Generic
as
G
import
qualified
Data.Vector.Generic.Mutable
as
M
import
qualified
Data.Vector.Primitive
as
P
import
qualified
Data.Vector.Unboxed
as
U
import
qualified
Data.Vector.Unboxed.Mutable
as
MU
import
GHC.Exts
vec
::
U
.
Vector
Moebius
vec
=
U
.
singleton
Moebius0
main
::
IO
()
main
=
print
$
U
.
head
vec
==
U
.
head
vec
data
Moebius
=
Moebius0
|
Moebius1
|
Moebius2
deriving
(
Eq
)
fromMoebius
::
Moebius
->
Int
fromMoebius
Moebius0
=
0
fromMoebius
Moebius1
=
1
fromMoebius
Moebius2
=
2
toMoebius
::
Int
->
Moebius
toMoebius
(
I
#
i
#
)
=
tagToEnum
#
i
#
newtype
instance
U
.
MVector
s
Moebius
=
MV_Moebius
(
P
.
MVector
s
Int
)
newtype
instance
U
.
Vector
Moebius
=
V_Moebius
(
P
.
Vector
Int
)
instance
U
.
Unbox
Moebius
instance
M
.
MVector
U
.
MVector
Moebius
where
basicLength
(
MV_Moebius
v
)
=
M
.
basicLength
v
basicUnsafeSlice
i
n
(
MV_Moebius
v
)
=
MV_Moebius
$
M
.
basicUnsafeSlice
i
n
v
basicOverlaps
(
MV_Moebius
v1
)
(
MV_Moebius
v2
)
=
M
.
basicOverlaps
v1
v2
basicUnsafeNew
n
=
MV_Moebius
`
liftM
`
M
.
basicUnsafeNew
n
basicInitialize
(
MV_Moebius
v
)
=
M
.
basicInitialize
v
basicUnsafeReplicate
n
x
=
MV_Moebius
`
liftM
`
M
.
basicUnsafeReplicate
n
(
fromMoebius
x
)
basicUnsafeRead
(
MV_Moebius
v
)
i
=
toMoebius
`
liftM
`
M
.
basicUnsafeRead
v
i
basicUnsafeWrite
(
MV_Moebius
v
)
i
x
=
M
.
basicUnsafeWrite
v
i
(
fromMoebius
x
)
basicClear
(
MV_Moebius
v
)
=
M
.
basicClear
v
basicSet
(
MV_Moebius
v
)
x
=
M
.
basicSet
v
(
fromMoebius
x
)
basicUnsafeCopy
(
MV_Moebius
v1
)
(
MV_Moebius
v2
)
=
M
.
basicUnsafeCopy
v1
v2
basicUnsafeMove
(
MV_Moebius
v1
)
(
MV_Moebius
v2
)
=
M
.
basicUnsafeMove
v1
v2
basicUnsafeGrow
(
MV_Moebius
v
)
n
=
MV_Moebius
`
liftM
`
M
.
basicUnsafeGrow
v
n
instance
G
.
Vector
U
.
Vector
Moebius
where
basicUnsafeFreeze
(
MV_Moebius
v
)
=
V_Moebius
`
liftM
`
G
.
basicUnsafeFreeze
v
basicUnsafeThaw
(
V_Moebius
v
)
=
MV_Moebius
`
liftM
`
G
.
basicUnsafeThaw
v
basicLength
(
V_Moebius
v
)
=
G
.
basicLength
v
basicUnsafeSlice
i
n
(
V_Moebius
v
)
=
V_Moebius
$
G
.
basicUnsafeSlice
i
n
v
basicUnsafeIndexM
(
V_Moebius
v
)
i
=
toMoebius
`
liftM
`
G
.
basicUnsafeIndexM
v
i
basicUnsafeCopy
(
MV_Moebius
mv
)
(
V_Moebius
v
)
=
G
.
basicUnsafeCopy
mv
v
elemseq
_
=
seq
This diff is collapsed.
Click to expand it.
testsuite/tests/simplCore/should_run/all.T
+
1
−
0
View file @
0bdf1b7a
...
@@ -78,3 +78,4 @@ test('T13429', normal, compile_and_run, [''])
...
@@ -78,3 +78,4 @@ test('T13429', normal, compile_and_run, [''])
test
('
T13429_2
',
normal
,
compile_and_run
,
[''])
test
('
T13429_2
',
normal
,
compile_and_run
,
[''])
test
('
T13750
',
normal
,
compile_and_run
,
[''])
test
('
T13750
',
normal
,
compile_and_run
,
[''])
test
('
T14178
',
normal
,
compile_and_run
,
[''])
test
('
T14178
',
normal
,
compile_and_run
,
[''])
test
('
T14768
',
reqlib
('
vector
'),
compile_and_run
,
[''])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment