forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompound_block_locations.h
47 lines (38 loc) · 1.23 KB
/
compound_block_locations.h
1
2
3
4
5
6
7
8
9
10
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
39
40
41
42
43
44
45
46
47
/// \file Test that goto_program2code adds locations to compound blocks
///
/// \author Kareem Khazem <[email protected]>
#ifndef CPROVER_COMPOUND_BLOCK_LOCATIONS_H
#define CPROVER_COMPOUND_BLOCK_LOCATIONS_H
#include <util/irep.h>
#include <util/std_expr.h>
#include <string>
class compound_block_locationst
{
public:
compound_block_locationst()
: types({
{ID_dowhile, "dowhile"},
{ID_for, "for"},
{ID_ifthenelse, "ifthenelse"},
{ID_switch, "switch"},
{ID_while, "while"},
})
{
}
/// For each pair of \ref codet type and line number in expected, check that
/// there's a goto-instruction of that type with that line number in prog
/// after running goto_program2code on it.
void check(
const std::string &prog,
const std::list<std::pair<const irep_idt, const unsigned>> &expected);
protected:
void check_compound_block_locations(
const std::string &prog,
const std::list<std::pair<const irep_idt, const unsigned>> &expected);
void recurse_on_block(
const exprt &,
std::list<std::pair<const irep_idt, const unsigned>> &);
const std::unordered_map<const irep_idt, const std::string, irep_id_hash>
types;
};
#endif // CPROVER_COMPOUND_BLOCK_LOCATIONS_H