tests: remove extra_files.py (#12223)
[ghc.git] / testsuite / tests / ffi / should_run / all.T
1
2 # Args to compile_and_run are:
3 #       extra compile flags
4 #       extra run flags
5 #       expected process return value, if not zero
6
7 test('fed001', normal, compile_and_run, [''])
8
9 # Omit GHCi for these two, as they use foreign export
10 test('ffi001', omit_ways(['ghci']), compile_and_run, [''])
11 test('ffi002', [ omit_ways(['ghci']),
12                  extra_clean(['ffi002_c.o']),
13                  pre_cmd('$MAKE -s --no-print-directory ffi002_setup') ],
14                  # The ffi002_setup hack is to ensure that we generate
15                  # ffi002_stub.h before compiling ffi002_c.c, which
16                  # needs it.
17                compile_and_run, ['ffi002_c.c -no-hs-main'])
18
19 test('ffi003', normal, compile_and_run, [''])
20
21 # ffi004 calls printf, which is not supported (the FFI spec says that
22 # calling varargs functions is deprecated).  It stopped working in GHC 6.9.
23 test('ffi004', skip, compile_and_run, [''])
24
25 # omit prof ways, because this test exits before the RTS has a chance to
26 # generate profiling info.
27 #
28 # On x86, the test suffers from floating-point differences due to the
29 # use of 80-bit internal precision when using the native code generator.
30 #
31 test('ffi005', [ omit_ways(prof_ways), 
32                  when(arch('i386'), skip),
33                  when(platform('i386-apple-darwin'), expect_broken(4105)),
34                  exit_code(3) ],
35                compile_and_run, [''])
36
37 test('ffi006', normal, compile_and_run, [''])
38
39 # Skip ffi00{7,8} for GHCi.  These tests both try to exit or raise an
40 # error from a foreign export, which shuts down the runtime.  When
41 # GHCi is running, this results in GHCi's main thread also trying to
42 # shut down, and a race ensues to see who gets to call exit() first.
43 # Sometimes we end up with the wrong exit code, or get an extra
44 # 'interrupted' message from the GHCi thread shutting down.
45
46 test('ffi007', omit_ways(['ghci']), compile_and_run, [''])
47 test('ffi008', [exit_code(1), omit_ways(['ghci'])], compile_and_run, [''])
48
49 # On i386, we need -msse2 to get reliable floating point results
50 if config.platform.startswith('i386-'):
51     opts = '-msse2'
52 else:
53     opts = ''
54
55 test('ffi009', [when(fast(), skip), reqlib('random')], compile_and_run, [opts])
56
57 test('ffi010', normal, compile_and_run, [''])
58 test('ffi011', normal, compile_and_run, [''])
59
60 # The stdcall calling convention works on Windows, and sometimes on
61 # Linux, and fails everywhhere else.  For now, we test only on Windows,
62 # because it's difficult to discover whether a given Linux supports
63 # it.
64
65 if config.os == 'mingw32':
66     skip_if_not_windows = normal
67 else:
68     skip_if_not_windows = skip
69
70 test('ffi012', skip_if_not_windows, compile_and_run, [''])
71 test('ffi013', normal, compile_and_run, [''])
72
73 # threaded2 sometimes gives ffi014: Main_dDu: interrupted
74 test('ffi014', [only_ways(['threaded1', 'threaded2'])], compile_and_run,
75      ['ffi014_cbits.c'])
76
77 # GHCi can't handle the separate C file (ToDo: fix this somehow)
78 test('ffi015', [omit_ways(['ghci'])], compile_and_run, ['ffi015_cbits.c'])
79
80 # GHCi can't handle foreign import "&"
81 test('ffi016', omit_ways(['ghci']), compile_and_run, [''])
82
83 test('ffi017', normal, compile_and_run, [''])
84
85 test('ffi018', [omit_ways(['ghci'])], compile_and_run, ['ffi018_c.c'])
86
87 test('ffi018_ghci',
88      [extra_files(['ffi018.h']),
89       only_ways(['ghci']),
90       pre_cmd('$MAKE -s --no-print-directory ffi018_ghci_setup')],
91      compile_and_run, ['ffi018_ghci_c.o'])
92
93 test('ffi019', normal, compile_and_run, [''])
94
95 # This one originally failed only GHCi, but doesn't hurt to test all ways.
96 test('T1679', normal, compile_and_run, [''])
97
98 test('T1288', [omit_ways(['ghci'])], compile_and_run, ['T1288_c.c'])
99 test('T1288_ghci',
100      [only_ways(['ghci']),
101       pre_cmd('$MAKE -s --no-print-directory T1288_ghci_setup')],
102      compile_and_run, ['T1288_ghci_c.o'])
103
104 test('T2276', [omit_ways(['ghci'])], compile_and_run, ['T2276_c.c'])
105 test('T2276_ghci', [ only_ways(['ghci']),
106                      when(opsys('darwin'), skip), # stdcall not supported on OS X
107                      pre_cmd('$MAKE -s --no-print-directory T2276_ghci_setup'),
108                      extra_clean(['T2276_ghci_c.o']) ],
109                    compile_and_run, ['-fobject-code T2276_ghci_c.o'])
110
111 test('T2469', normal, compile_and_run, ['-optc-std=gnu99'])
112
113 test('T2594', [omit_ways(['ghci'])], compile_and_run, ['T2594_c.c'])
114
115 test('fptr01', [omit_ways(['ghci'])], compile_and_run, ['fptr01_c.c'])
116 test('fptr02', normal, compile_and_run, [''])
117
118 test('fptrfail01', [omit_ways(['ghci']), exit_code(1)], compile_and_run,
119      ['fptrfail01_c.c'])
120
121 test('T2917a', normal, compile_and_run, [''])
122
123 # omit prof ways, because this test causes the RTS to exit (correctly)
124 # without generating profiling information.
125 test('ffi020', [ omit_ways(prof_ways),
126                  exit_code(1) ], compile_and_run, [''])
127
128
129 test('ffi021', normal, compile_and_run, [''])
130
131 test('ffi022', normal, compile_and_run, [''])
132
133 if config.os == 'mingw32':
134     # This test needs a larger C stack than we get by default on Windows
135         flagsForT4038 = ['-optl-Wl,--stack,10485760']
136 else:
137         flagsForT4038 = ['']
138 test('T4038', normal, compile_and_run, flagsForT4038)
139
140 test('T4221', [omit_ways(['ghci'])], compile_and_run, ['T4221_c.c'])
141
142 test('T5402', [ omit_ways(['ghci']),
143                 exit_code(42),
144                 extra_clean(['T5402_main.o']),
145                   # The T5402_setup hack is to ensure that we generate
146                   # T5402_stub.h before compiling T5402_main.c, which
147                   # needs it.
148                 pre_cmd('$MAKE -s --no-print-directory T5402_setup') ],
149               compile_and_run, ["-no-hs-main T5402_main.c"])
150
151 test('T5594', [ omit_ways(['ghci']),
152                 extra_clean(['T5594_c.o']),
153                 pre_cmd('$MAKE -s --no-print-directory T5594_setup') ],
154                 # The T5594_setup hack is to ensure that we generate
155                 # T5594_stub.h before compiling T5594_c.c, which
156                 # needs it.
157                 compile_and_run, ['T5594_c.c -no-hs-main'])
158
159 test('Capi_Ctype_001', [extra_files(['Capi_Ctype_A_001.hsc', 'capi_ctype_001.h', 'capi_ctype_001_c.c'])], run_command,
160      ['$MAKE -s --no-print-directory Capi_Ctype_001'])
161
162 test('Capi_Ctype_002', [extra_files(['Capi_Ctype_A_002.hsc', 'capi_ctype_002_A.h', 'capi_ctype_002_B.h'])], run_command,
163      ['$MAKE -s --no-print-directory Capi_Ctype_002'])
164
165 test('ffi_parsing_001', [omit_ways(['ghci'])], compile_and_run,
166      ['ffi_parsing_001_c.c'])
167
168 test('capi_value', [omit_ways(['ghci'])], compile_and_run, ['capi_value_c.c'])
169
170 test('T7170', exit_code(1), compile_and_run, [''])
171
172 test('T4012', [expect_broken_for(7388, ['ghci'])], multimod_compile_and_run,
173      ['T4012', ''])
174
175 test('T8083', [omit_ways(['ghci'])], compile_and_run, ['T8083_c.c'])
176
177 test('ffi023', [ omit_ways(['ghci']),
178                 extra_clean(['ffi023_c.o']),
179                 extra_run_opts('1000 4'),
180                 pre_cmd('$MAKE -s --no-print-directory ffi023_setup') ],
181                 # The ffi023_setup hack is to ensure that we generate
182                 # ffi023_stub.h before compiling ffi023_c.c, which
183                 # needs it.
184               compile_and_run, ['ffi023_c.c'])
185
186 test('T12134', [omit_ways(['ghci'])], compile_and_run, ['T12134_c.c'])
187
188 test('T12614', [omit_ways(['ghci'])], compile_and_run, ['T12614_c.c'])