Commit 32c0aba1 authored by thomie's avatar thomie

Testsuite: delete -fesc tests

The -fesc flag does not exist, and has never existed.

Also delete now unused config.compiler_tags, and 'Project version' never
contains a '-'.

Reviewed by: bgamari

Differential Revision: https://phabricator.haskell.org/D2138
parent 73129231
......@@ -172,10 +172,9 @@ def get_compiler_info():
config.libdir = compilerInfoDict['LibDir']
v = compilerInfoDict["Project version"].split('-')
config.compiler_version = v[0]
config.compiler_maj_version = re.sub('^([0-9]+\.[0-9]+).*',r'\1', v[0])
config.compiler_tags = v[1:]
v = compilerInfoDict["Project version"]
config.compiler_version = v
config.compiler_maj_version = re.sub('^([0-9]+\.[0-9]+).*',r'\1', v)
# -fno-ghci-history was added in 7.3
if version_ge(config.compiler_version, '7.3'):
......
......@@ -68,7 +68,6 @@ class TestConfig:
# Compiler version info
self.compiler_version = ''
self.compiler_maj_version = ''
self.compiler_tags = []
# Flags we always give to this compiler
self.compiler_always_flags = []
......
......@@ -375,9 +375,6 @@ def compiler_profiled( ):
def compiler_debugged( ):
return config.compiler_debugged
def tag( t ):
return t in config.compiler_tags
# ---
def high_memory_usage(name, opts):
......
module F123 where
data A = A1 | A2
data B = B1 | B2
{-# CONTRACT h1 :: {x | noA2 x} -> {r | yesA2 r} #-}
h1 :: A -> A
h1 A1 = A2
noA2 A1 = True
noA2 A2 = False
yesA2 A1 = False
yesA2 A2 = True
f3 x y = case y of
B1 -> f2 x y
f2 x y = case y of
B1 -> f1 x
f1 x = h1 A2
TOP=../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
module Sum where
{-- {-# SPECIALISE f :: Int -> Int #-}
-- {-# CONTRACT f :: x:{y | y > 0} -> {r | r == x + 1} #-}
-- {-# CONTRACT f :: x:{y | y > 0} -> {y | y > 0} -> {r | r == x + 1} #-}
-- {-# CONTRACT f :: any -> {y | y > 0} #-}
-- {-# CONTRACT f :: {y | y > 0} -> _ #-}
{-# CONTRACT inc :: {y | y > 0} -> {r | r > 1} #-}
inc :: Int -> Int
inc x = x + 1
-}
-- {-# CONTRACT sum2 :: x:{y | y > 0} -> {y | y > x} -> {r | r > 0} #-}
-- {-# CONTRACT sum2 :: x:{y | y > 0} -> {y | y > x} -> _ #-}
sum2 :: Int -> Int -> Int
sum2 x y = x + y
{-
t1 = inc 5
t2a = sum2 (inc 5) 2
t2b = sum2 (inc 5) 6
-}
module TestData where
data A = A1 | A2
-- If we put noA2 and yesA2 here, they are out of scope
-- in ESC's eyes. i.e. they are not in EscEnv.vals
{-
noA2 A1 = True
noA2 A2 = False
yesA2 A1 = False
yesA2 A2 = True
-}
{-# CONTRACT h1 :: {x | noA2 x} -> {r | yesA2 r} #-}
h1 :: A -> A
h1 A1 = A2
g1 :: A -> A
g1 A1 = A1
g1 A2 = A1
{-# CONTRACT h2 :: {x | not1 (noA2 x)} -> {r | not1 (yesA2 r)} #-}
h2 :: A -> A
h2 A2 = A1
noA2 A1 = True
noA2 A2 = False
yesA2 A1 = False
yesA2 A2 = True
not1 True = False
not1 False = True
test = h1 (g1 A2)
module TestDataCon where
{-# CONTRACT g1 :: ({x | x>0}, any) -> {r | r>0} #-}
g1 :: (Int, Int) -> Int
g1 (x,y) = x
{-# CONTRACT g2 :: (any, {y | y>0}) -> {r | r>0} #-}
g2 :: (Int, Int) -> Int
g2 (x,y) = y
bad = error "bad!"
t1 = g1 (5, bad)
t2 = g2 (bad, 6)
t3 = g1 (bad, 7)
t4 = g1 (-1, 6) -- seems inlining is done.
{-
data A a = B a | C a Int
{-# CONTRACT g :: B {x | x>0} -> any #-}
g :: B Int -> Int
g (B x) = x
-}
module TestImport where
import TestList
{-# CONTRACT t2 :: _ #-}
t2 = head1 [True] -- same as TestList res2
{-# CONTRACT t3 :: {x | True} #-}
t3 = head1 [True] -- same as TestList.res3
t4 = head1 [] -- same as TestList.res4
t5 = head1 [True] -- same as TestList.res5
t2a = res2
t3a = res3
t4a = res4
t5a = res5
{-# CONTRACT tail1 :: {xs | not1 (null1 xs)} -> {r | True} #-}
tail1 :: [Int] -> [Int]
tail1 (x:xs) = xs
{-# CONTRACT tail2 :: {xs | not (null xs)} -> {r | True} #-}
tail2 :: [Int] -> [Int]
tail2 (x:xs) = xs
module TestList where
{-# CONTRACT head1 :: {ys | not1 (null1 ys)} -> {r | True} #-}
-- {-# CONTRACT head1 :: {xs | not (null xs)} -> {r | True} #-}
head1 :: [Bool] -> Bool
head1 (x:xs) = x
not1 True = False
not1 False = True
null1 [] = True
null1 xs = False
{-# CONTRACT res2 :: _ #-}
res2 = head1 [True]
{-# CONTRACT res3 :: {x | True} #-}
res3 = head1 [True]
res4 = head1 []
res5 = head1 [True]
esc = unless(tag('esc'), skip)
test('TestList', esc, compile, ['-fesc'])
test('TestImport', esc, compile, ['-fesc'])
test('TestData', esc, compile, ['-fesc'])
{-# TYPE nat = {x | x > 0} #-}
{-# TYPE notNull = {xs | not (null xs)} #-}
{-# CONTRACT f :: nat -> nat #-}
f :: Int -> Int
f x = x
{-# CONTRACT g :: notNull -> any #-}
g :: [Int] -> Int
g (x:xs) = x
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment