diff options
author | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
---|---|---|
committer | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
commit | 84c2ad99582391005b5e873198b15e9e9eb4f78d (patch) | |
tree | caa8c2f2ec7e97fbb4977263c6817c9af5025cf4 /testsuite/tests/ghci.debugger/scripts | |
parent | 8ddb47cfcf5776e9a3c55fd37947c8a95e00fa12 (diff) | |
parent | e68b439fe5de61b9a2ca51af472185c62ccb8b46 (diff) | |
download | haskell-wip/T13904.tar.gz |
update to current master againwip/T13904
Diffstat (limited to 'testsuite/tests/ghci.debugger/scripts')
22 files changed, 172 insertions, 48 deletions
diff --git a/testsuite/tests/ghci.debugger/scripts/T13825-debugger.hs b/testsuite/tests/ghci.debugger/scripts/T13825-debugger.hs new file mode 100644 index 0000000000..0c3a1de219 --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/T13825-debugger.hs @@ -0,0 +1,33 @@ +{-# LANGUAGE MagicHash #-} +module T13825 where + +import GHC.Exts +import Data.Word +import Data.Int + +data Packed1 = Packed1 Float# Float# Int# Float# + deriving Show + +data Packed2 = + Packed2 + {-# UNPACK #-} !Float + {-# UNPACK #-} !Float + {-# UNPACK #-} !Int + {-# UNPACK #-} !Float + deriving Show + +data Packed3 = + Packed3 + {-# UNPACK #-} !Word8 + {-# UNPACK #-} !Int8 + {-# UNPACK #-} !Int64 + {-# UNPACK #-} !Word16 + {-# UNPACK #-} !Word64 + {-# UNPACK #-} !Word32 + {-# UNPACK #-} !Float + {-# UNPACK #-} !Double + deriving Show + +packed1 = Packed1 12.34# 56.78# 42# 99.99# +packed2 = Packed2 12.34 56.78 42 99.99 +packed3 = Packed3 1 2 3 4 5 6 7.8 9.0 diff --git a/testsuite/tests/ghci.debugger/scripts/T13825-debugger.script b/testsuite/tests/ghci.debugger/scripts/T13825-debugger.script new file mode 100644 index 0000000000..fc55ffc5dd --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/T13825-debugger.script @@ -0,0 +1,7 @@ +:l T13825-debugger.hs +packed1 +:print packed1 +packed2 +:print packed2 +packed3 +:print packed3 diff --git a/testsuite/tests/ghci.debugger/scripts/T13825-debugger.stdout b/testsuite/tests/ghci.debugger/scripts/T13825-debugger.stdout new file mode 100644 index 0000000000..6d3dc2f560 --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/T13825-debugger.stdout @@ -0,0 +1,8 @@ +Packed1 12.34# 56.78# 42# 99.99# +packed1 = Packed1 12.34 56.78 42 99.99 +Packed2 12.34 56.78 42 99.99 +packed2 = Packed2 12.34 56.78 42 99.99 +Packed3 1 2 3 4 5 6 7.8 9.0 +packed3 = Packed3 + (GHC.Word.W8# 1) (GHC.Int.I8# 2) (GHC.Int.I64# 3) (GHC.Word.W16# 4) + (GHC.Word.W64# 5) (GHC.Word.W32# 6) 7.8 9.0 diff --git a/testsuite/tests/ghci.debugger/scripts/all.T b/testsuite/tests/ghci.debugger/scripts/all.T index 96de3a334b..733631180d 100644 --- a/testsuite/tests/ghci.debugger/scripts/all.T +++ b/testsuite/tests/ghci.debugger/scripts/all.T @@ -1,4 +1,5 @@ setTestOpts([extra_run_opts('-ignore-dot-ghci'), + extra_ways(['ghci-ext']), # test with -fexternal-interpreter normalise_slashes]) test('print001', normal, ghci_script, ['print001.script']) @@ -19,10 +20,16 @@ test('print016', extra_files(['../Test.hs']), ghci_script, ['print016.script']) test('print017', extra_files(['../Test.hs']), ghci_script, ['print017.script']) test('print018', extra_files(['../Test.hs']), ghci_script, ['print018.script']) test('print019', extra_files(['../Test.hs']), ghci_script, ['print019.script']) -test('print020', extra_files(['../HappyTest.hs']), ghci_script, ['print020.script']) + +# The ghci-ext way emits messages in a slightly different order due to +# printing from two processes, so let's just skip it. +test('print020', [extra_files(['../HappyTest.hs']), + omit_ways(['ghci-ext'])], ghci_script, ['print020.script']) + test('print021', normal, ghci_script, ['print021.script']) -test('print022', when(arch('powerpc64'), expect_broken(11262)), - ghci_script, ['print022.script']) +test('print022', + [when(arch('powerpc64'), expect_broken(14455))], + ghci_script, ['print022.script']) test('print023', extra_files(['../Test.hs']), ghci_script, ['print023.script']) test('print024', extra_files(['../Test.hs']), ghci_script, ['print024.script']) test('print025', normal, ghci_script, ['print025.script']) @@ -50,8 +57,7 @@ test('break009', [extra_files(['../Test6.hs']), test('break010', extra_files(['../Test6.hs']), ghci_script, ['break010.script']) test('break011', [extra_files(['../Test7.hs']), - combined_output, - when(msys(), expect_broken(12712))], + combined_output], ghci_script, ['break011.script']) test('break012', normal, ghci_script, ['break012.script']) test('break013', normal, ghci_script, ['break013.script']) @@ -86,7 +92,10 @@ test('listCommand001', [extra_files(['../Test3.hs']), combined_output], ghci_script, ['listCommand001.script']) test('listCommand002', normal, ghci_script, ['listCommand002.script']) -test('hist001', extra_files(['../Test3.hs']), ghci_script, ['hist001.script']) +test('hist001', [extra_files(['../Test3.hs']), extra_run_opts('+RTS -I0')], + ghci_script, ['hist001.script']) +test('hist002', [extra_files(['../Test3.hs']), extra_run_opts('+RTS -I0')], + ghci_script, ['hist002.script']) test('T2740', normal, ghci_script, ['T2740.script']) @@ -94,3 +103,7 @@ test('getargs', extra_files(['../getargs.hs']), ghci_script, ['getargs.script']) test('T7386', normal, ghci_script, ['T7386.script']) test('T8557', normal, ghci_script, ['T8557.script']) test('T12458', normal, ghci_script, ['T12458.script']) +test('T13825-debugger', when(arch('powerpc64'), expect_broken(14455)), + ghci_script, ['T13825-debugger.script']) + +test('break029', extra_files(['break029.hs']), ghci_script, ['break029.script']) diff --git a/testsuite/tests/ghci.debugger/scripts/break006.stderr b/testsuite/tests/ghci.debugger/scripts/break006.stderr index f19a5b3896..4622cb53e9 100644 --- a/testsuite/tests/ghci.debugger/scripts/break006.stderr +++ b/testsuite/tests/ghci.debugger/scripts/break006.stderr @@ -9,7 +9,7 @@ instance Show Integer -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ ...plus 22 others - ...plus 11 instances involving out-of-scope types + ...plus 18 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of an interactive GHCi command: print it @@ -23,6 +23,6 @@ instance Show Integer -- Defined in ‘GHC.Show’ instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’ ...plus 22 others - ...plus 11 instances involving out-of-scope types + ...plus 18 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of an interactive GHCi command: print it diff --git a/testsuite/tests/ghci.debugger/scripts/break006.stdout b/testsuite/tests/ghci.debugger/scripts/break006.stdout index 8a2463fa4e..cd9f6ea1fe 100644 --- a/testsuite/tests/ghci.debugger/scripts/break006.stdout +++ b/testsuite/tests/ghci.debugger/scripts/break006.stdout @@ -4,14 +4,14 @@ f :: Integer -> a = _ x :: Integer = 1 xs :: [Integer] = [2,3] xs :: [Integer] = [2,3] -x :: Integer = 1 f :: Integer -> a = _ +x :: Integer = 1 _result :: [a] = _ y = (_t1::a) y = 2 xs :: [Integer] = [2,3] -x :: Integer = 1 f :: Integer -> Integer = _ +x :: Integer = 1 _result :: [Integer] = _ y :: Integer = 2 _t1 :: Integer = 2 diff --git a/testsuite/tests/ghci.debugger/scripts/break011.stdout b/testsuite/tests/ghci.debugger/scripts/break011.stdout index ac5b7e3a24..47fb7b135d 100644 --- a/testsuite/tests/ghci.debugger/scripts/break011.stdout +++ b/testsuite/tests/ghci.debugger/scripts/break011.stdout @@ -23,13 +23,6 @@ _exception = SomeException "foo" "CallStack (from HasCallStack): error, called at Test7.hs:2:18 in main:Main") -Ghci1._exception :: SomeException = SomeException - (ErrorCallWithLocation - "foo" - "CallStack (from HasCallStack): - error, called at Test7.hs:<line>:<column> in <package-id>:Main") -Ghci2._result :: a = _ -Ghci3._result :: IO a = _ _result :: a = _ _exception :: SomeException = SomeException (ErrorCallWithLocation diff --git a/testsuite/tests/ghci.debugger/scripts/break012.stdout b/testsuite/tests/ghci.debugger/scripts/break012.stdout index 2e86b42713..5d478ae04e 100644 --- a/testsuite/tests/ghci.debugger/scripts/break012.stdout +++ b/testsuite/tests/ghci.debugger/scripts/break012.stdout @@ -1,14 +1,14 @@ Stopped in Main.g, break012.hs:5:10-18 -_result :: (p, a1 -> a1, (), a -> a -> a) = _ -a :: p = _ -b :: a2 -> a2 = _ +_result :: (a1, a2 -> a2, (), a -> a -> a) = _ +a :: a1 = _ +b :: a3 -> a3 = _ c :: () = _ d :: a -> a -> a = _ -a :: p -b :: a2 -> a2 +a :: a1 +b :: a3 -> a3 c :: () d :: a -> a -> a -a = (_t1::p) -b = (_t2::a2 -> a2) +a = (_t1::a1) +b = (_t2::a3 -> a3) c = (_t3::()) d = (_t4::a -> a -> a) diff --git a/testsuite/tests/ghci.debugger/scripts/break029.hs b/testsuite/tests/ghci.debugger/scripts/break029.hs new file mode 100644 index 0000000000..7598d3f4b3 --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/break029.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE ApplicativeDo #-} + +f :: Int -> IO Int +f x = do + y <- return (x + 1) + return (y * 2) diff --git a/testsuite/tests/ghci.debugger/scripts/break029.script b/testsuite/tests/ghci.debugger/scripts/break029.script new file mode 100644 index 0000000000..b2e70b1ba5 --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/break029.script @@ -0,0 +1,5 @@ +:load break029.hs +:step f 3 +:step +:step +y diff --git a/testsuite/tests/ghci.debugger/scripts/break029.stdout b/testsuite/tests/ghci.debugger/scripts/break029.stdout new file mode 100644 index 0000000000..c1d7047a8e --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/break029.stdout @@ -0,0 +1,10 @@ +Stopped in Main.f, break029.hs:(4,7)-(6,16) +_result :: IO Int = _ +x :: Int = 3 +Stopped in Main.f, break029.hs:5:8-21 +_result :: IO Int = _ +x :: Int = 3 +Stopped in Main.f, break029.hs:6:11-15 +_result :: Int = _ +y :: Int = _ +4 diff --git a/testsuite/tests/ghci.debugger/scripts/hist001.stdout b/testsuite/tests/ghci.debugger/scripts/hist001.stdout index 523605b00a..b52e8aa5fe 100644 --- a/testsuite/tests/ghci.debugger/scripts/hist001.stdout +++ b/testsuite/tests/ghci.debugger/scripts/hist001.stdout @@ -12,7 +12,6 @@ Logged breakpoint at Test3.hs:2:22-31 _result :: [a] f :: t -> a xs :: [t] -Ghci1._result :: [a] = _ xs :: [t] = [] f :: t -> a = _ _result :: [a] = _ @@ -20,12 +19,9 @@ Logged breakpoint at Test3.hs:2:18-20 _result :: a f :: Integer -> a x :: Integer -Ghci1._result :: [a] = _ xs :: [t] = [] -Ghci2.f :: t -> a = _ -Ghci2._result :: [a] = _ -x :: Integer = 2 f :: Integer -> a = _ +x :: Integer = 2 _result :: a = _ _result = 3 Logged breakpoint at Test3.hs:2:18-31 diff --git a/testsuite/tests/ghci.debugger/scripts/hist002.script b/testsuite/tests/ghci.debugger/scripts/hist002.script new file mode 100644 index 0000000000..0198207192 --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/hist002.script @@ -0,0 +1,20 @@ +:l Test3.hs +-- set a break on the [] case in map +:b 1 +-- trace an execution +:tr mymap (+1) [1,2] +:hist +:back +:show bindings +:back +:show bindings +:force _result +-- Run a GC so the BLACKHOLE indirection for _result (the AP_STACK) is removed, +-- ensuring _result now points directly to the value (in this case, the integer +-- 3). This will be tagged, so we are checking that the pointer isn't naively +-- dereferenced to generate an unaligned load. +System.Mem.performGC +:back +:forward +-- at this point, we can't retrieve the bindings because _result (the AP_STACK) +-- was evaluated previously. GHCi should not crash, preferably. diff --git a/testsuite/tests/ghci.debugger/scripts/hist002.stdout b/testsuite/tests/ghci.debugger/scripts/hist002.stdout new file mode 100644 index 0000000000..b52e8aa5fe --- /dev/null +++ b/testsuite/tests/ghci.debugger/scripts/hist002.stdout @@ -0,0 +1,33 @@ +Breakpoint 0 activated at Test3.hs:1:14-15 +[2,3Stopped in Main.mymap, Test3.hs:1:14-15 +_result :: [a] = _ +-1 : mymap (Test3.hs:2:22-31) +-2 : mymap (Test3.hs:2:18-20) +-3 : mymap (Test3.hs:2:18-31) +-4 : mymap (Test3.hs:2:22-31) +-5 : mymap (Test3.hs:2:18-20) +-6 : mymap (Test3.hs:2:18-31) +<end of history> +Logged breakpoint at Test3.hs:2:22-31 +_result :: [a] +f :: t -> a +xs :: [t] +xs :: [t] = [] +f :: t -> a = _ +_result :: [a] = _ +Logged breakpoint at Test3.hs:2:18-20 +_result :: a +f :: Integer -> a +x :: Integer +xs :: [t] = [] +f :: Integer -> a = _ +x :: Integer = 2 +_result :: a = _ +_result = 3 +Logged breakpoint at Test3.hs:2:18-31 +_result :: [a] +f :: Integer -> a +x :: Integer +xs :: [Integer] +Logged breakpoint at Test3.hs:2:18-20 +_result :: a diff --git a/testsuite/tests/ghci.debugger/scripts/print003.stdout b/testsuite/tests/ghci.debugger/scripts/print003.stdout index 74f18d264b..23b0543c1f 100644 --- a/testsuite/tests/ghci.debugger/scripts/print003.stdout +++ b/testsuite/tests/ghci.debugger/scripts/print003.stdout @@ -1,13 +1,13 @@ -t = O (_t1::a) +t = O (_t1::a0) t :: Opaque = O _ -_t1 :: a = _ +_t1 :: a0 = _ () -t = O ((_t2::a1) : (_t3::[a1])) +t = O ((_t2::a0) : (_t3::[a0])) t :: Opaque = O (_ : _) _t1 :: [a] = _ : _ it :: () = () -_t3 :: [a1] = _ -_t2 :: a1 = _ +_t3 :: [a0] = _ +_t2 :: a0 = _ () t = O (Just [1,1] : (_t4::[Maybe [Integer]])) () diff --git a/testsuite/tests/ghci.debugger/scripts/print006.stdout b/testsuite/tests/ghci.debugger/scripts/print006.stdout index 1cf7de8a8e..e508e68c34 100644 --- a/testsuite/tests/ghci.debugger/scripts/print006.stdout +++ b/testsuite/tests/ghci.debugger/scripts/print006.stdout @@ -1,8 +1,8 @@ -t = O (_t1::a) +t = O (_t1::a0) () -t = O ((_t2::a1) : (_t3::[a1])) +t = O ((_t2::a0) : (_t3::[a0])) () -t = O ((_t4::a2) : (_t5::a2) : (_t6::[a2])) +t = O ((_t4::a1) : (_t5::a1) : (_t6::[a1])) () t = O ((_t7::Maybe [Integer]) : Just [2,2] : (_t8::[Maybe [Integer]])) diff --git a/testsuite/tests/ghci.debugger/scripts/print008.stdout b/testsuite/tests/ghci.debugger/scripts/print008.stdout index 08bdbf7b1d..4cfb5ba7df 100644 --- a/testsuite/tests/ghci.debugger/scripts/print008.stdout +++ b/testsuite/tests/ghci.debugger/scripts/print008.stdout @@ -1,7 +1,7 @@ -t = O (_t1::a) -_t1 :: a +t = O (_t1::a0) +_t1 :: a0 () -t = O ((_t2::a1) : (_t3::[a1])) +t = O ((_t2::a0) : (_t3::[a0])) () t = O (Just [1,1] : (_t4::[Maybe [Integer]])) _t4 :: [Maybe [Integer]] diff --git a/testsuite/tests/ghci.debugger/scripts/print010.stdout b/testsuite/tests/ghci.debugger/scripts/print010.stdout index b390d255c8..dd75dc246c 100644 --- a/testsuite/tests/ghci.debugger/scripts/print010.stdout +++ b/testsuite/tests/ghci.debugger/scripts/print010.stdout @@ -1,6 +1,6 @@ -o = O (_t1::a) +o = O (_t1::a0) () -o = O ((_t2::a1) : (_t3::[a1])) +o = O ((_t2::a0) : (_t3::[a0])) () 3 o = O [0,(_t4::Integer),(_t5::Integer),(_t6::Integer)] diff --git a/testsuite/tests/ghci.debugger/scripts/print012.stdout b/testsuite/tests/ghci.debugger/scripts/print012.stdout index 905ac7656c..e77bb39b15 100644 --- a/testsuite/tests/ghci.debugger/scripts/print012.stdout +++ b/testsuite/tests/ghci.debugger/scripts/print012.stdout @@ -1,6 +1,6 @@ -o = O (_t1::a) +o = O (_t1::a0) () _t1 :: SafeList Integer NonEmpty -o = O (Cons 3 (_t4::SafeList Integer y)) +o = O (Cons 3 (_t4::SafeList Integer y0)) () -o = O (Cons 3 (Cons 6 (_t9::SafeList Integer y))) +o = O (Cons 3 (Cons 6 (_t9::SafeList Integer y0))) diff --git a/testsuite/tests/ghci.debugger/scripts/print019.stderr b/testsuite/tests/ghci.debugger/scripts/print019.stderr index c266bc8d1a..5815080f6a 100644 --- a/testsuite/tests/ghci.debugger/scripts/print019.stderr +++ b/testsuite/tests/ghci.debugger/scripts/print019.stderr @@ -9,6 +9,6 @@ instance Show TyCon -- Defined in ‘GHC.Show’ instance Show Integer -- Defined in ‘GHC.Show’ ...plus 29 others - ...plus 12 instances involving out-of-scope types + ...plus 19 instances involving out-of-scope types (use -fprint-potential-instances to see them all) • In a stmt of an interactive GHCi command: print it diff --git a/testsuite/tests/ghci.debugger/scripts/print019.stdout b/testsuite/tests/ghci.debugger/scripts/print019.stdout index aea474019d..932fd540c3 100644 --- a/testsuite/tests/ghci.debugger/scripts/print019.stdout +++ b/testsuite/tests/ghci.debugger/scripts/print019.stdout @@ -1,4 +1,4 @@ -a = O (_t1::a) +a = O (_t1::a0) b = O (_t2::a1) () _t1 = 'a' diff --git a/testsuite/tests/ghci.debugger/scripts/print034.stdout b/testsuite/tests/ghci.debugger/scripts/print034.stdout index 5d83c8c9b7..f497209e87 100644 --- a/testsuite/tests/ghci.debugger/scripts/print034.stdout +++ b/testsuite/tests/ghci.debugger/scripts/print034.stdout @@ -1,4 +1,4 @@ -o = O (_t1::a) +o = O (_t1::a0) () _t1 :: SafeList Bool NonEmpty o = O (One False (_t4::SafeList Bool Empty)) |