Skip to content

Commit c348dd6

Browse files
committed
Add cram tests for remaining solvers
1 parent 1eb63b9 commit c348dd6

File tree

2 files changed

+298
-1
lines changed

2 files changed

+298
-1
lines changed

src/solver/sLR.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ let _ =
527527
Selector.add_solver ("widen2", (module PostSolver.EqIncrSolverFromEqSolver (W2)));
528528
Selector.add_solver ("widen3", (module PostSolver.EqIncrSolverFromEqSolver (W3)));
529529
let module S2 = TwoPhased (struct let ver = 1 end) in
530-
Selector.add_solver ("two", (module PostSolver.EqIncrSolverFromEqSolver (S2)));
530+
Selector.add_solver ("two", (module PostSolver.EqIncrSolverFromEqSolver (S2))); (* TODO: broken even on 00-sanity/01-assert *)
531531
let module S1 = Make (struct let ver = 1 end) in
532532
Selector.add_solver ("new", (module PostSolver.EqIncrSolverFromEqSolver (S1)));
533533
Selector.add_solver ("slr+", (module PostSolver.EqIncrSolverFromEqSolver (S1)))

tests/regression/00-sanity/01-assert.t

Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,300 @@ Test topdown solvers:
9999
live: 7
100100
dead: 2
101101
total lines: 9
102+
103+
104+
Test SLR solvers:
105+
106+
$ goblint --enable warn.deterministic --set solver widen1 01-assert.c
107+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
108+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
109+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
110+
[Warning][Deadcode] Function 'main' does not return
111+
[Warning][Deadcode] Function 'main' has dead code:
112+
on lines 13..14 (01-assert.c:13-14)
113+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
114+
live: 7
115+
dead: 2
116+
total lines: 9
117+
118+
$ goblint --enable warn.deterministic --set solver widen2 01-assert.c
119+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
120+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
121+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
122+
[Warning][Deadcode] Function 'main' does not return
123+
[Warning][Deadcode] Function 'main' has dead code:
124+
on lines 13..14 (01-assert.c:13-14)
125+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
126+
live: 7
127+
dead: 2
128+
total lines: 9
129+
130+
$ goblint --enable warn.deterministic --set solver widen3 01-assert.c
131+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
132+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
133+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
134+
[Warning][Deadcode] Function 'main' does not return
135+
[Warning][Deadcode] Function 'main' has dead code:
136+
on lines 13..14 (01-assert.c:13-14)
137+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
138+
live: 7
139+
dead: 2
140+
total lines: 9
141+
142+
$ goblint --enable warn.deterministic --set solver two 01-assert.c
143+
[Error] Fixpoint not reached at L:entry state of main (299) on 01-assert.c:4:1-15:1
144+
Solver computed:
145+
bot
146+
Right-Hand-Side:
147+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):PathSensitive (ProjectiveSet (MCP.D * map)):{(MCP.D:[expRelation:(),
148+
mallocWrapper:(wrapper call:Unknown node, unique calls:{}),
149+
base:({
150+
}, {}, {}, {}),
151+
threadid:(wrapper call:unknown node, Thread:[main], created:(current function:bot, callees:bot)),
152+
threadflag:Singlethreaded,
153+
threadreturn:true,
154+
escape:{},
155+
mutexEvents:(),
156+
access:(),
157+
mutex:(lockset:{}, multiplicity:{}),
158+
race:(),
159+
mhp:(),
160+
assert:(),
161+
pthreadMutexType:()], map:{})}
162+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):PathSensitive (ProjectiveSet (MCP.D * map)):{(MCP.D:[expRelation:(),
163+
mallocWrapper:(wrapper call:Unknown node, unique calls:{}),
164+
base:({
165+
}, {}, {}, {}),
166+
threadid:(wrapper call:unknown node, Thread:[main], created:(current function:bot, callees:bot)),
167+
threadflag:Singlethreaded,
168+
threadreturn:true,
169+
escape:{},
170+
mutexEvents:(),
171+
access:(),
172+
mutex:(lockset:{}, multiplicity:{}),
173+
race:(),
174+
mhp:(),
175+
assert:(),
176+
pthreadMutexType:()], map:{})} instead of bot
177+
178+
[Error] Fixpoint not reached at L:node 1 "success = 1;" on 01-assert.c:5:7-5:18
179+
Solver computed:
180+
bot
181+
Right-Hand-Side:
182+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code
183+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code instead of bot
184+
185+
[Error] Fixpoint not reached at L:node 2 "silence = 1;" on 01-assert.c:6:7-6:18
186+
Solver computed:
187+
bot
188+
Right-Hand-Side:
189+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code
190+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code instead of bot
191+
192+
[Error] Fixpoint not reached at L:node 3 "fail = 0;" on 01-assert.c:7:7-7:15
193+
Solver computed:
194+
bot
195+
Right-Hand-Side:
196+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code
197+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code instead of bot
198+
199+
[Error] Fixpoint not reached at L:node 4 "__goblint_assert(success);" on 01-assert.c:10:3-10:28
200+
Solver computed:
201+
bot
202+
Right-Hand-Side:
203+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code
204+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code instead of bot
205+
206+
[Error] Fixpoint not reached at L:node 5 "__goblint_assert(unknown == 4);" on 01-assert.c:11:3-11:33
207+
Solver computed:
208+
bot
209+
Right-Hand-Side:
210+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code
211+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code instead of bot
212+
213+
[Error] Fixpoint not reached at L:node 6 "__goblint_assert(fail);" on 01-assert.c:12:3-12:25
214+
Solver computed:
215+
bot
216+
Right-Hand-Side:
217+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code
218+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code instead of bot
219+
220+
[Error] Fixpoint not reached at L:node 7 "return (0);" on 01-assert.c:13:10-13:11
221+
Solver computed:
222+
bot
223+
Right-Hand-Side:
224+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code
225+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code instead of bot
226+
227+
[Error] Fixpoint not reached at L:node 9 "__goblint_assert(silence);" on 01-assert.c:14:3-14:28
228+
Solver computed:
229+
bot
230+
Right-Hand-Side:
231+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code
232+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code instead of bot
233+
234+
[Error] Fixpoint not reached at L:node -299 "return;" on 01-assert.c:15:1-15:1
235+
Solver computed:
236+
bot
237+
Right-Hand-Side:
238+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code
239+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code instead of bot
240+
241+
[Error] Fixpoint not reached at L:call of main (299) on 01-assert.c:4:1-15:1
242+
Solver computed:
243+
bot
244+
Right-Hand-Side:
245+
HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code
246+
Difference: HConsed lifted PathSensitive (ProjectiveSet (MCP.D * map)):Dead code instead of bot
247+
248+
[Warning][Deadcode] Function 'main' does not return
249+
[Warning][Deadcode] Function 'main' is uncalled: 8 LLoC (01-assert.c:4:1-15:1)
250+
[Info][Deadcode] Logical lines of code (LLoC) summary:
251+
live: 0
252+
dead: 8 (8 in uncalled functions)
253+
total lines: 8
254+
[Error][Unsound] Fixpoint not reached
255+
[3]
256+
257+
$ goblint --enable warn.deterministic --set solver new 01-assert.c
258+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
259+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
260+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
261+
[Warning][Deadcode] Function 'main' does not return
262+
[Warning][Deadcode] Function 'main' has dead code:
263+
on lines 13..14 (01-assert.c:13-14)
264+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
265+
live: 7
266+
dead: 2
267+
total lines: 9
268+
269+
$ goblint --enable warn.deterministic --set solver slr+ 01-assert.c
270+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
271+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
272+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
273+
[Warning][Deadcode] Function 'main' does not return
274+
[Warning][Deadcode] Function 'main' has dead code:
275+
on lines 13..14 (01-assert.c:13-14)
276+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
277+
live: 7
278+
dead: 2
279+
total lines: 9
280+
281+
$ goblint --enable warn.deterministic --set solver slr1 01-assert.c
282+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
283+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
284+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
285+
[Warning][Deadcode] Function 'main' does not return
286+
[Warning][Deadcode] Function 'main' has dead code:
287+
on lines 13..14 (01-assert.c:13-14)
288+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
289+
live: 7
290+
dead: 2
291+
total lines: 9
292+
293+
$ goblint --enable warn.deterministic --set solver slr2 01-assert.c
294+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
295+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
296+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
297+
[Warning][Deadcode] Function 'main' does not return
298+
[Warning][Deadcode] Function 'main' has dead code:
299+
on lines 13..14 (01-assert.c:13-14)
300+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
301+
live: 7
302+
dead: 2
303+
total lines: 9
304+
305+
$ goblint --enable warn.deterministic --set solver slr3 01-assert.c
306+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
307+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
308+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
309+
[Warning][Deadcode] Function 'main' does not return
310+
[Warning][Deadcode] Function 'main' has dead code:
311+
on lines 13..14 (01-assert.c:13-14)
312+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
313+
live: 7
314+
dead: 2
315+
total lines: 9
316+
317+
$ goblint --enable warn.deterministic --set solver slr4 01-assert.c
318+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
319+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
320+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
321+
[Warning][Deadcode] Function 'main' does not return
322+
[Warning][Deadcode] Function 'main' has dead code:
323+
on lines 13..14 (01-assert.c:13-14)
324+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
325+
live: 7
326+
dead: 2
327+
total lines: 9
328+
329+
$ goblint --enable warn.deterministic --set solver slr1p 01-assert.c
330+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
331+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
332+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
333+
[Warning][Deadcode] Function 'main' does not return
334+
[Warning][Deadcode] Function 'main' has dead code:
335+
on lines 13..14 (01-assert.c:13-14)
336+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
337+
live: 7
338+
dead: 2
339+
total lines: 9
340+
$ goblint --enable warn.deterministic --set solver slr2p 01-assert.c
341+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
342+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
343+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
344+
[Warning][Deadcode] Function 'main' does not return
345+
[Warning][Deadcode] Function 'main' has dead code:
346+
on lines 13..14 (01-assert.c:13-14)
347+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
348+
live: 7
349+
dead: 2
350+
total lines: 9
351+
352+
$ goblint --enable warn.deterministic --set solver slr3p 01-assert.c
353+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
354+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
355+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
356+
[Warning][Deadcode] Function 'main' does not return
357+
[Warning][Deadcode] Function 'main' has dead code:
358+
on lines 13..14 (01-assert.c:13-14)
359+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
360+
live: 7
361+
dead: 2
362+
total lines: 9
363+
364+
$ goblint --enable warn.deterministic --set solver slr4p 01-assert.c
365+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
366+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
367+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
368+
[Warning][Deadcode] Function 'main' does not return
369+
[Warning][Deadcode] Function 'main' has dead code:
370+
on lines 13..14 (01-assert.c:13-14)
371+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
372+
live: 7
373+
dead: 2
374+
total lines: 9
375+
376+
$ goblint --enable warn.deterministic --set solver slr3t 01-assert.c
377+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
378+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
379+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
380+
[Warning][Deadcode] Function 'main' does not return
381+
[Warning][Deadcode] Function 'main' has dead code:
382+
on lines 13..14 (01-assert.c:13-14)
383+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
384+
live: 7
385+
dead: 2
386+
total lines: 9
387+
388+
$ goblint --enable warn.deterministic --set solver slr3tp 01-assert.c
389+
[Error][Assert] Assertion "fail" will fail. (01-assert.c:12:3-12:25)
390+
[Warning][Assert] Assertion "unknown == 4" is unknown. (01-assert.c:11:3-11:33)
391+
[Success][Assert] Assertion "success" will succeed (01-assert.c:10:3-10:28)
392+
[Warning][Deadcode] Function 'main' does not return
393+
[Warning][Deadcode] Function 'main' has dead code:
394+
on lines 13..14 (01-assert.c:13-14)
395+
[Warning][Deadcode] Logical lines of code (LLoC) summary:
396+
live: 7
397+
dead: 2
398+
total lines: 9

0 commit comments

Comments
 (0)