Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,270
Issues
4,270
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
413
Merge Requests
413
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
33a75d9f
Commit
33a75d9f
authored
Aug 15, 2012
by
Simon Peyton Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test Trac
#7064
parent
12512e12
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
0 deletions
+68
-0
testsuite/tests/th/T7064.hs
testsuite/tests/th/T7064.hs
+9
-0
testsuite/tests/th/T7064.stdout
testsuite/tests/th/T7064.stdout
+26
-0
testsuite/tests/th/T7064a.hs
testsuite/tests/th/T7064a.hs
+29
-0
testsuite/tests/th/all.T
testsuite/tests/th/all.T
+4
-0
No files found.
testsuite/tests/th/T7064.hs
0 → 100644
View file @
33a75d9f
{-# LANGUAGE TemplateHaskell #-}
module
Main
where
import
T7064a
$
(
decls
)
main
=
hsToTh
testsuite/tests/th/T7064.stdout
0 → 100644
View file @
33a75d9f
f1_0 x_1 = 1
f2_0 x_1 = 2
f3_0 x_1 = 3
{-# INLINE f1_0 #-}
{-# INLINE [2] f2_0 #-}
{-# INLINE CONLIKE [~2] f3_0 #-}
g1_0 x_1 = 1
g2_0 x_1 = 2
g3_0 x_1 = 3
{-# SPECIALISE g1_0 :: GHC.Types.Int -> GHC.Types.Int #-}
{-# SPECIALISE [2] g2_0 :: GHC.Types.Int -> GHC.Types.Int #-}
{-# SPECIALISE INLINE [~2] g3_0 ::
GHC.Types.Int -> GHC.Types.Int #-}
data T_0 a_1 = T_2 a_1
instance GHC.Classes.Eq a_0 => GHC.Classes.Eq (T_1 a_0)
where GHC.Classes.== (T_2 x_3) (T_2 y_4) = x_3 GHC.Classes.== y_4
{-# SPECIALISE instance GHC.Classes.Eq (T_1 GHC.Types.Int) #-}
{-# RULES "rule1"
GHC.Real.fromIntegral
= GHC.Base.id :: forall a_0 . a_0 -> a_0 #-}
{-# RULES "rule2" [1]
forall (x_1627391611 :: a_1627391612) . GHC.Real.fromIntegral x_1627391611
= x_1627391611 #-}
{-# RULES "rule3" [~1]
forall (x_1627391609 :: a_1627391610) . GHC.Real.fromIntegral x_1627391609
= x_1627391609 #-}
testsuite/tests/th/T7064a.hs
0 → 100644
View file @
33a75d9f
{-# LANGUAGE TemplateHaskell #-}
module
T7064a
(
decls
,
hsToTh
)
where
import
Language.Haskell.TH
decls
=
[
d
|
f1 x = 1; f2 x = 2; f3 x = 3
{-# INLINE f1 #-}
{-# INLINE [2] f2 #-}
{-# INLINE CONLIKE [~2] f3 #-}
g1 x = 1; g2 x = 2; g3 x = 3
{-# SPECIALISE g1 :: Int -> Int #-}
{-# SPECIALISE [2] g2 :: Int -> Int #-}
{-# SPECIALISE INLINE [~2] g3 :: Int -> Int #-}
data T a = T a
instance Eq a => Eq (T a) where
{-# SPECIALISE instance Eq (T Int) #-}
(T x) == (T y) = x == y
{-# RULES
"rule1" fromIntegral = id :: a -> a ;
"rule2" [1] forall (x :: a) . fromIntegral x = x ;
"rule3" [~1] forall (x :: a) . fromIntegral x = x
#-}
|]
hsToTh
=
do
decls'
<-
runQ
decls
mapM
(
print
.
ppr
)
decls'
testsuite/tests/th/all.T
View file @
33a75d9f
...
...
@@ -246,3 +246,7 @@ test('T6005a', normal, compile, ['-v0'])
test
('
T5737
',
normal
,
compile
,
['
-v0
'])
test
('
T6114
',
normal
,
compile_fail
,
['
-v0 -dsuppress-uniques
'])
test
('
TH_StringPrimL
',
normal
,
compile_and_run
,
[''])
test
('
T7064
',
extra_clean
(['
T7064a.hi
',
'
T7064a.o
']),
multimod_compile_and_run
,
['
T7064.hs
',
'
-v0
'])
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