Ticket #1364: fix1364-testsuite.patch

File fix1364-testsuite.patch, 8.8 KB (added by Svarog, 5 years ago)
Line 
1Tue Oct 21 19:17:43 EST 2008  Ivan Tomac <tomac@pacific.net.au>
2  * FIX #1364: added tests for C finalizers.
3
4New patches:
5
6[FIX #1364: added tests for C finalizers.
7Ivan Tomac <tomac@pacific.net.au>**20081021081743] {
8hunk ./tests/ghc-regress/ffi/should_run/all.T 131
9+test('fptr01', [ omit_ways(['ghci']), extra_clean(['fptr01_c.o']) ],
10+               compile_and_run, ['fptr01_c.c'])
11+
12+test('fptrfail01', [ compose(omit_ways(['ghci']), exit_code(1)),
13+                     extra_clean(['fptrfail01_c.o']) ],
14+                   compile_and_run, ['fptrfail01_c.c'])
15+
16addfile ./tests/ghc-regress/ffi/should_run/fptr01.h
17hunk ./tests/ghc-regress/ffi/should_run/fptr01.h 1
18+#ifndef FPTR01_H_INCLUDED
19+#define FPTR01_H_INCLUDED
20+
21+void f( HsInt * );
22+void g( HsInt * );
23+void h( HsInt * );
24+
25+#endif  // FPTR01_H_INCLUDED
26addfile ./tests/ghc-regress/ffi/should_run/fptr01.hs
27hunk ./tests/ghc-regress/ffi/should_run/fptr01.hs 1
28+{-# LANGUAGE ForeignFunctionInterface #-}
29+
30+module Main where
31+
32+import Foreign
33+
34+{-# INCLUDE "fptr01.h" #-}
35+
36+foreign import ccall "&f" fptr :: FunPtr (Ptr Int -> IO ())
37+foreign import ccall "&g" gptr :: FunPtr (Ptr Int -> IO ())
38+foreign import ccall "&h" hptr :: FunPtr (Ptr Int -> IO ())
39+
40+main :: IO ()
41+main = do
42+    with (33 :: Int) ((>>= finalizeForeignPtr) . test)
43+    with (34 :: Int) ((>>  return ())          . test)
44+    where
45+        test p = do
46+            f <- newForeignPtr_ p
47+            addForeignPtrFinalizer fptr f
48+            addForeignPtrFinalizer gptr f
49+            addForeignPtrFinalizer hptr f
50+            return f
51addfile ./tests/ghc-regress/ffi/should_run/fptr01.stdout
52hunk ./tests/ghc-regress/ffi/should_run/fptr01.stdout 1
53+h33
54+g33
55+f33
56+h34
57+g34
58+f34
59addfile ./tests/ghc-regress/ffi/should_run/fptr01_c.c
60hunk ./tests/ghc-regress/ffi/should_run/fptr01_c.c 1
61+#include <stdio.h>
62+
63+#include "HsFFI.h"
64+
65+#include "fptr01.h"
66+
67+void f( HsInt *i )
68+{
69+    printf( "f%d\n", (int)*i );
70+    fflush( stdout );
71+}
72+
73+void g( HsInt *i )
74+{
75+    printf( "g%d\n", (int)*i );
76+    fflush( stdout );
77+}
78+
79+void h( HsInt *i )
80+{
81+    printf( "h%d\n", (int)*i );
82+    fflush( stdout );
83+}
84addfile ./tests/ghc-regress/ffi/should_run/fptrfail01.h
85hunk ./tests/ghc-regress/ffi/should_run/fptrfail01.h 1
86+#ifndef FPTRFAIL01_H_INCLUDED
87+#define FPTRFAIL01_H_INCLUDED
88+
89+void f( HsInt * );
90+
91+#endif  // FPTRFAIL01_H_INCLUDED
92addfile ./tests/ghc-regress/ffi/should_run/fptrfail01.hs
93hunk ./tests/ghc-regress/ffi/should_run/fptrfail01.hs 1
94+{-# LANGUAGE ForeignFunctionInterface #-}
95+
96+module Main where
97+
98+import Foreign
99+import GHC.ForeignPtr
100+
101+{-# INCLUDE "fptrfail01.h" #-}
102+
103+foreign import ccall "&f" fptr :: FunPtr (Ptr Int -> IO ())
104+
105+main :: IO ()
106+main = do
107+    with (33 :: Int) test
108+    where
109+        test p = do
110+            f <- newForeignPtr_ p
111+            addForeignPtrFinalizer fptr f
112+            addForeignPtrConcFinalizer f (putStrLn "Haskell finalizer")
113addfile ./tests/ghc-regress/ffi/should_run/fptrfail01.stderr
114hunk ./tests/ghc-regress/ffi/should_run/fptrfail01.stderr 1
115+fptrfail01: GHC.ForeignPtr: attempt to mix Haskell and C finalizers in the same ForeignPtr
116addfile ./tests/ghc-regress/ffi/should_run/fptrfail01.stdout
117hunk ./tests/ghc-regress/ffi/should_run/fptrfail01.stdout 1
118+f33
119addfile ./tests/ghc-regress/ffi/should_run/fptrfail01_c.c
120hunk ./tests/ghc-regress/ffi/should_run/fptrfail01_c.c 1
121+#include <stdio.h>
122+
123+#include "HsFFI.h"
124+
125+#include "fptrfail01.h"
126+
127+void f( HsInt *i )
128+{
129+    printf( "f%d\n", (int)*i );
130+    fflush( stdout );
131+}
132}
133
134Context:
135
136[Wibble to output
137simonpj@microsof.com**20081015102844]
138[Update test output
139simonpj@microsof.com**20081015084111]
140[add test for #2685
141Simon Marlow <marlowsd@gmail.com>**20081013122050]
142[add test for #2636
143Simon Marlow <marlowsd@gmail.com>**20081010131452]
144[add test for #2589
145Simon Marlow <marlowsd@gmail.com>**20081009094639]
146[make this test more reliable, and enable threaded2
147Simon Marlow <marlowsd@gmail.com>**20081009094254]
148[update output (Show Ratio changes)
149Simon Marlow <marlowsd@gmail.com>**20081009085358]
150[TFs: T2639
151Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081009132645]
152[TFs: Examples for Relaxed Conditions
153Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081004114546]
154[Comments only
155simonpj@microsof.com**20081003141316]
156[Add test for Trac #2632
157simonpj@microsof.com**20081003141244]
158[Tweak break017
159Ian Lynagh <igloo@earth.li>**20081002213202]
160[TFs: Test for repeated tvs in left-hand sides of instances
161Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081002142712]
162[TFs: T2291
163Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081002055002]
164[omit ways that run out of time
165Simon Marlow <marlowsd@gmail.com>**20081002101157]
166[accept output, and enable cg026 in validate
167Simon Marlow <marlowsd@gmail.com>**20081002100444]
168[add IOList optimisation example
169Simon Marlow <marlowsd@gmail.com>**20081002093717]
170[accept output (Show Ratio changes)
171Simon Marlow <marlowsd@gmail.com>**20081002083641]
172[add an extra delay to make this test a bit more robust
173Simon Marlow <marlowsd@gmail.com>**20081002083623]
174[accept break017 output (seems to be correct), and enable it in validate
175Simon Marlow <marlowsd@gmail.com>**20081002083135]
176[tcfail145 error message improved, too
177Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081002052448]
178[TFs: T2448
179Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081002045510]
180[TFs: Proper error message for GADT12
181Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081001144244]
182[Print out exceptions when cleaning tests
183Ian Lynagh <igloo@earth.li>**20081001194813]
184[add test for #2410
185Simon Marlow <marlowsd@gmail.com>**20080930150803]
186[TFs: Fixed InstContextNorm
187Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081001130446]
188[GADTs/TFs: Added T2151 & TF's Simple14 passes
189Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20081001053109]
190[add test for #2594
191Simon Marlow <marlowsd@gmail.com>**20080930115425]
192[Type families: T2627b
193Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080930054017]
194[Type families: Tricky GADT/RankN/TF example
195Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080930033644]
196[Type families: T2627
197Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080930020317]
198[Type families: fixed GivenCheckDecomp
199Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080929140957]
200[Type families: T2219
201Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080929074819]
202[GADTs: T2040
203Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080929073535]
204[we can observe the exception again in break011
205pepe iborra <mnislaih@gmail.com>**20080926212515]
206[Fix the mode001 test on OS X
207Ian Lynagh <igloo@earth.li>**20080927161551]
208[add test for #2295 (-outputdir)
209Simon Marlow <simonmarhaskell@gmail.com>**20080923145850]
210[oops, we haven't been running tests from packages for goodness knows how long
211Simon Marlow <simonmarhaskell@gmail.com>**20080926233700]
212[Improve the mode001 test
213Ian Lynagh <igloo@earth.li>**20080926142730]
214[Type families: another small tricky example of SPJ
215Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080925230155]
216[Test Trac #303
217simonpj@microsoft.com**20080925230530]
218[Fix conflicting_flags output
219Ian Lynagh <igloo@earth.li>**20080925184801]
220[Add a test that the --help and --version flags behave properly
221Ian Lynagh <igloo@earth.li>**20080925165553]
222[Update ghci025 output
223Ian Lynagh <igloo@earth.li>**20080925153956]
224[Type families: test for decomposition problem
225Manuel M T Chakravarty <chak@cse.unsw.edu.au>**20080925084015]
226[Add a test for ":i thisIsNotDefined"
227Ian Lynagh <igloo@earth.li>**20080924235240
228 It used to make ghci exit
229]
230[Skip the new qualified operator syntax tests in 6.10
231Ian Lynagh <igloo@earth.li>**20080924160332]
232[Fix the driver100 test
233Ian Lynagh <igloo@earth.li>**20080924152649]
234[Update the ws-64 output for the arith011 test
235Ian Lynagh <igloo@earth.li>**20080924151947]
236[add test for #2499 (package flags in OPTIONS pragmas)
237Simon Marlow <simonmarhaskell@gmail.com>**20080923175620]
238[accept output (Show Ratio changes, #1920)
239Simon Marlow <simonmarhaskell@gmail.com>**20080923144155]
240[add test for #2566, also enable driver100 which wasn't being run
241Simon Marlow <simonmarhaskell@gmail.com>**20080923140120]
242[add tests for -XNewQualifiedOperators
243Simon Marlow <simonmarhaskell@gmail.com>**20080922213748]
244[make this test THREADS friendly
245Simon Marlow <simonmarhaskell@gmail.com>**20080922213649]
246[add test for #2228
247Simon Marlow <simonmarhaskell@gmail.com>**20080430204612]
248[Minor change in error message
249simonpj@microsoft.com**20080920210508]
250[Add tests for Trac #2597
251simonpj@microsoft.com**20080920210420]
252[Test Trac #2587
253simonpj@microsoft.com**20080915150402]
254[TAG 2008-09-20
255Ian Lynagh <igloo@earth.li>**20080920162649]
256[Fix test regex001
257Ian Lynagh <igloo@earth.li>**20080919145940
258 Needed to restrict the type of 'try' now that we have extensible exceptions
259]
260[TAG 6.10 branch has been forked
261Ian Lynagh <igloo@earth.li>**20080919123439]
262Patch bundle hash:
2632cf845402dbf72e3bced353a29fda867e6f9a858