all.T 11.2 KB
Newer Older
1
2
3
4
5
6
7
8
9
10

# Tests for pattern match checker (coverage and exhaustiveness)

# Just do the normal way...
def f( name, opts ):
  opts.only_ways = ['normal']

setTestOpts(f)

# Bug reports / feature requests
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
test('T2006', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T2204', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T3078', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T322', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T366', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T3927a', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T3927b', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T3927', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T4139', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T6124', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T7669a', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T8970', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T9951b', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T9951', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
39
40
test('T10183', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
41
42
43
44
45
46
47
48
test('T11303', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS'])
test('T11276', collect_compiler_stats('bytes allocated',10), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS'])
test('T11303b', collect_compiler_stats('bytes allocated',10), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS'])
test('T11374', collect_compiler_stats('bytes allocated',10), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS'])
49
50
test('T11822', collect_compiler_stats('bytes allocated',10), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
51
52
test('T11195', collect_compiler_stats('bytes allocated',10), compile,
     ['-package ghc -fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M2G -RTS'])
53
54
test('T11984', normal, compile,
    ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
55
56
test('T14086', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
57
58
test('T14098', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
59
60
test('T14813', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
61
62
test('T14899', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
63
64
test('T15305', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
65
66
test('T15385', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
67
68
test('T15450', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
69
70
test('T15584', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
71
72
test('T15713', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
73
test('T15753a', normal, compile,
74
75
76
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T15753b', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
77
78
79
80
test('T15753c', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T15753d', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
81
test('T15884', normal, compile,
82
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
83
84
test('T16289', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
85
86
test('T17096', collect_compiler_stats('bytes allocated',10), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M2G -RTS'])
Sebastian Graf's avatar
Sebastian Graf committed
87
88
test('T17112', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
89
90
test('T17207', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
91
test('T17207b', normal, compile,
92
93
94
95
96
97
98
99
100
101
102
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T17208', expect_broken(17208), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T17215', expect_broken(17215), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T17216', expect_broken(17216), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T17218', expect_broken(17218), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T17219', expect_broken(17219), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
103
104
test('T17234', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
105
106
test('T17248', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
107
108
test('T17340', normal, compile,
     ['-Wredundant-bang-patterns'])
109
110
111
test('T17357', expect_broken(17357), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T17376', normal, compile,
112
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
113
114
test('T17378', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
115
116
117
118
test('T17465', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T17646', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
119
120
test('T17703', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
121
122
123
124
test('T17725', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T17729', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
125
126
test('T17783', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
127
128
129
130
test('T17836', collect_compiler_stats('bytes allocated',10), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T17836b', collect_compiler_stats('bytes allocated',10), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
131
132
133
134
test('T17977', collect_compiler_stats('bytes allocated',10), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T17977b', collect_compiler_stats('bytes allocated',10), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
135
136
test('T18049', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
137
138
test('T18249', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns -Wredundant-bang-patterns'])
139
140
141
142
test('T18273', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T18341', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
143
144
145
146
test('T18371', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('T18371b', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
147
148
test('T18478', collect_compiler_stats('bytes allocated',10), compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
149
150
test('T18533', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
151
152
test('T18572', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-incomplete-uni-patterns -fwarn-overlapping-patterns'])
153
154
test('T18670', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
155
156
test('T18708', normal, compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
157
158

# Other tests
159
160
161
162
163
164
165
166
167
168
169
170
171
172
test('pmc001', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('pmc002', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('pmc003', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('pmc004', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('pmc005', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('pmc006', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('pmc007', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
173
174
175
176
test('pmc008', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('pmc009', [], compile,
     ['-package ghc -fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
177
test('T11245', [], compile,
178
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
179
180
test('T11336b', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
181
test('T12949', [],  compile, ['-fwarn-overlapping-patterns'])
182
test('T12957', [], compile, ['-fwarn-overlapping-patterns'])
183
test('T12957a', [], compile, ['-fwarn-overlapping-patterns'])
184
185
186
187
test('PmExprVars', [],  compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('CyclicSubst', [],  compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
188
189
test('CaseOfKnownCon', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
190
191
test('TooManyDeltas', [], compile,
     ['-fmax-pmcheck-models=0 -fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
192
193
test('LongDistanceInfo', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
194

195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# Series (inspired) by Luke Maranget

test('PmSeriesS',
     [ collect_compiler_stats('bytes allocated',10),
       pre_cmd('$PYTHON ./genS.py 10'),
       extra_files(['genS.py']),
     ],
     multimod_compile,
     ['S', '-v0'])
test('PmSeriesT',
     [ collect_compiler_stats('bytes allocated',10),
       pre_cmd('$PYTHON ./genT.py 10'),
       extra_files(['genT.py']),
     ],
     multimod_compile,
     ['T', '-v0'])
test('PmSeriesV',
     [ collect_compiler_stats('bytes allocated',10),
       pre_cmd('$PYTHON ./genV.py 6'),
       extra_files(['genV.py']),
     ],
     multimod_compile,
     ['V', '-v0'])
test('PmSeriesG',
     [ collect_compiler_stats('bytes allocated',10),
       pre_cmd('./genG 20'),
       extra_files(['genG']),
     ],
     multimod_compile,
     ['G', '-v0'])

226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# EmptyCase
test('T10746', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('EmptyCase001', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('EmptyCase002', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('EmptyCase003', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('EmptyCase004', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('EmptyCase005', [], compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('EmptyCase006', [],  compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('EmptyCase007', [],  compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('EmptyCase008', [],  compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('EmptyCase009', [],  compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])
test('EmptyCase010', [],  compile,
     ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns'])