Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dylan Yudaken
GHC
Commits
3e9cc507
Commit
3e9cc507
authored
Jul 07, 2011
by
dterei
Browse files
Fix some issues with safe haskell tests
parent
895dc2fb
Changes
18
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/safeHaskell/check/Check01.hs
View file @
3e9cc507
{-# LANGUAGE SafeImports #-}
module
Check01
(
main'
)
where
import
safe
CheckB
import
safe
Check
01_
B
main'
=
do
let
n
=
mainM
1
...
...
testsuite/tests/ghc-regress/safeHaskell/check/Check01
_fail
.stderr
→
testsuite/tests/ghc-regress/safeHaskell/check/Check01.stderr
View file @
3e9cc507
File moved
testsuite/tests/ghc-regress/safeHaskell/check/Check01_A.hs
0 → 100644
View file @
3e9cc507
{-# LANGUAGE Trustworthy #-}
module
Check01_A
(
trace
)
where
import
qualified
Debug.Trace
as
D
import
qualified
Data.ByteString.Lazy.Char8
as
BS
-- | Allowed declasification
trace
::
String
->
a
->
a
trace
s
=
D
.
trace
$
s
++
show
a3
a3
::
BS
.
ByteString
a3
=
BS
.
take
3
$
BS
.
repeat
'a'
testsuite/tests/ghc-regress/safeHaskell/check/Check01_B.hs
0 → 100644
View file @
3e9cc507
{-# LANGUAGE Safe #-}
-- Since Safe we require base package be trusted to compile
module
Check01_B
where
import
Check01_A
mainM
::
Int
->
Int
mainM
n
=
trace
"Allowed Leak"
$
n
*
2
testsuite/tests/ghc-regress/safeHaskell/check/Check01_succeed.stderr
deleted
100644 → 0
View file @
895dc2fb
[3 of 3] Compiling Check01 ( Check01.hs, Check01.o )
testsuite/tests/ghc-regress/safeHaskell/check/Check02.hs
View file @
3e9cc507
module
Check02
where
{-# LANGUAGE SafeImports #-}
module
Check02
(
main'
)
where
import
CheckB
import
safe
Check
02_
B
main
N
=
do
main
'
=
do
let
n
=
mainM
1
print
$
n
testsuite/tests/ghc-regress/safeHaskell/check/Check02_A.hs
0 → 100644
View file @
3e9cc507
{-# LANGUAGE Trustworthy #-}
module
Check02_A
(
trace
)
where
import
qualified
Debug.Trace
as
D
import
qualified
Data.ByteString.Lazy.Char8
as
BS
-- | Allowed declasification
trace
::
String
->
a
->
a
trace
s
=
D
.
trace
$
s
++
show
a3
a3
::
BS
.
ByteString
a3
=
BS
.
take
3
$
BS
.
repeat
'a'
testsuite/tests/ghc-regress/safeHaskell/check/Check02_B.hs
0 → 100644
View file @
3e9cc507
{-# LANGUAGE Safe #-}
-- Since Safe we require base package be trusted to compile
module
Check02_B
where
import
Check02_A
mainM
::
Int
->
Int
mainM
n
=
trace
"Allowed Leak"
$
n
*
2
testsuite/tests/ghc-regress/safeHaskell/check/Check03.hs
View file @
3e9cc507
{-# LANGUAGE SafeImports #-}
module
Main
(
main
)
where
module
Check03
where
import
Check0
1
import
Check0
3_B
main
=
main'
mainN
=
do
let
n
=
mainM
1
print
$
n
testsuite/tests/ghc-regress/safeHaskell/check/Check03.stderr
View file @
3e9cc507
[4 of 4] Compiling Main ( Check03.hs, Check03.o )
Linking Check03 ...
[3 of 3] Compiling Check03 ( Check03.hs, Check03.o )
testsuite/tests/ghc-regress/safeHaskell/check/Check03_A.hs
0 → 100644
View file @
3e9cc507
{-# LANGUAGE Trustworthy #-}
module
Check03_A
(
trace
)
where
import
qualified
Debug.Trace
as
D
import
qualified
Data.ByteString.Lazy.Char8
as
BS
-- | Allowed declasification
trace
::
String
->
a
->
a
trace
s
=
D
.
trace
$
s
++
show
a3
a3
::
BS
.
ByteString
a3
=
BS
.
take
3
$
BS
.
repeat
'a'
testsuite/tests/ghc-regress/safeHaskell/check/Check03_B.hs
0 → 100644
View file @
3e9cc507
{-# LANGUAGE Safe #-}
-- Since Safe we require base package be trusted to compile
module
Check03_B
where
import
Check03_A
mainM
::
Int
->
Int
mainM
n
=
trace
"Allowed Leak"
$
n
*
2
testsuite/tests/ghc-regress/safeHaskell/check/Check04.hs
0 → 100644
View file @
3e9cc507
{-# LANGUAGE SafeImports #-}
module
Main
(
main
)
where
import
Check04_1
main
=
main'
testsuite/tests/ghc-regress/safeHaskell/check/Check04.stderr
0 → 100644
View file @
3e9cc507
[4 of 4] Compiling Main ( Check04.hs, Check04.o )
Linking Check04 ...
testsuite/tests/ghc-regress/safeHaskell/check/Check04_1.hs
0 → 100644
View file @
3e9cc507
{-# LANGUAGE SafeImports #-}
module
Check04_1
(
main'
)
where
import
safe
Check04_B
main'
=
do
let
n
=
mainM
1
print
$
n
testsuite/tests/ghc-regress/safeHaskell/check/Check04_A.hs
0 → 100644
View file @
3e9cc507
{-# LANGUAGE Trustworthy #-}
module
Check04_A
(
trace
)
where
import
qualified
Debug.Trace
as
D
import
qualified
Data.ByteString.Lazy.Char8
as
BS
-- | Allowed declasification
trace
::
String
->
a
->
a
trace
s
=
D
.
trace
$
s
++
show
a3
a3
::
BS
.
ByteString
a3
=
BS
.
take
3
$
BS
.
repeat
'a'
testsuite/tests/ghc-regress/safeHaskell/check/Check04_B.hs
0 → 100644
View file @
3e9cc507
{-# LANGUAGE Safe #-}
-- Since Safe we require base package be trusted to compile
module
Check04_B
where
import
Check04_A
mainM
::
Int
->
Int
mainM
n
=
trace
"Allowed Leak"
$
n
*
2
testsuite/tests/ghc-regress/safeHaskell/check/all.T
View file @
3e9cc507
...
...
@@ -8,29 +8,29 @@ test('CheckA', normal, compile, [''])
test
('
CheckB
',
normal
,
multimod_compile
,
['
CheckB
',
'
-trust base
'])
# fail as we don't trust base when compiling Check01
test
('
Check01
_fail
',
normal
,
multi_compile_fail
,
['
Check01
',
[
('
CheckA.hs
',
''),
('
CheckB.hs
',
'
-trust base
')
],
''])
test
('
Check01
',
normal
,
multi_compile_fail
,
['
Check01
',
[
('
Check
01_
A.hs
',
''),
('
Check
01_
B.hs
',
'
-trust base
')
],
''])
# suceed this time since we trust base when we compile AND use CheckB
test
('
Check0
1_succeed
',
normal
,
multi_compile
,
['
Check0
1
',
[
('
CheckA.hs
',
''),
('
CheckB.hs
',
'')
],
'
-trust base
'])
test
('
Check0
2
',
normal
,
multi_compile
,
['
Check0
2
',
[
('
Check
02_
A.hs
',
''),
('
Check
02_
B.hs
',
'')
],
'
-trust base
'])
# suceed as while like Check01_fail we don't import CheckB as a safe
# import this time, so don't require base trusted when used.
test
('
Check0
2
',
normal
,
multi_compile
,
['
Check0
2
',
[
('
CheckA.hs
',
''),
('
CheckB.hs
',
'
-trust base
')
test
('
Check0
3
',
normal
,
multi_compile
,
['
Check0
3
',
[
('
Check
03_
A.hs
',
''),
('
Check
03_
B.hs
',
'
-trust base
')
],
''])
# Check a slightly larger transitive program. Check01 isn't imported
# safely by Check03 so we don't require base trused at end.
test
('
Check0
3
',
normal
,
multi_compile
,
['
Check0
3
',
[
('
CheckA.hs
',
''),
('
CheckB.hs
',
'
-trust base
'),
('
Check01.hs
',
'
-trust base
')
test
('
Check0
4
',
normal
,
multi_compile
,
['
Check0
4
',
[
('
Check
04_
A.hs
',
''),
('
Check
04_
B.hs
',
'
-trust base
'),
('
Check0
4_
1.hs
',
'
-trust base
')
],
''])
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment