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
Terraform modules
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
Gesh
GHC
Commits
0865df19
Commit
0865df19
authored
25 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-04-06 09:52:03 by simonm]
-funbox-strict-fields test.
parent
f3ecd3c3
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ghc/tests/deSugar/should_compile/Makefile
+1
-0
1 addition, 0 deletions
ghc/tests/deSugar/should_compile/Makefile
ghc/tests/deSugar/should_compile/ds044.hs
+30
-0
30 additions, 0 deletions
ghc/tests/deSugar/should_compile/ds044.hs
with
31 additions
and
0 deletions
ghc/tests/deSugar/should_compile/Makefile
+
1
−
0
View file @
0865df19
...
...
@@ -5,6 +5,7 @@ include $(TOP)/mk/should_compile.mk
SRC_HC_OPTS
+=
-noC
-dcore-lint
ds035_HC_OPTS
=
-fglasgow-exts
ds044_HC_OPTS
=
-O
-funbox-strict-fields
# mkdependHS doesn't understand OPTIONS pragmas...
SRC_MKDEPENDHS_OPTS
+=
-fglasgow-exts
...
...
This diff is collapsed.
Click to expand it.
ghc/tests/deSugar/should_compile/ds044.hs
0 → 100644
+
30
−
0
View file @
0865df19
module
Test
where
-- Strict field unpacking tests: compile with -O -funbox-strict-fields.
-- test 1: simple unboxed int field
data
T
=
T
!
Int
t
(
T
i
)
=
i
+
1
-- test 2: mutual recursion (should back off from unboxing either field)
data
R
=
R
!
R
data
S
=
S
!
S
r
(
R
s
)
=
s
-- test 3: multi-level unboxing
data
A
=
A
Int
!
B
Int
data
B
=
B
!
Int
f
=
A
1
(
B
2
)
1
g
(
A
x
(
B
y
)
z
)
=
A
x
(
B
(
y
+
2
))
z
h
(
A
x
(
B
y
)
z
)
=
y
+
2
-- test 4: flattening nested tuples
data
C
=
C
!
(
Int
,
Int
)
j
(
C
(
a
,
b
))
=
a
+
b
-- test 5: polymorphism, multiple strict fields
data
D
a
b
=
D
Int
!
(
a
,
b
)
!
(
E
Int
)
data
E
a
=
E
a
k
(
D
a
(
b
,
c
)
(
E
d
))
=
a
+
b
+
c
+
d
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