Skip to content

Commit c6cfb02

Browse files
authored
Merge pull request #2291 from tautschnig/c++-fixes-1
C++ regression test fixes and whitespace changes (subset of #1260)
2 parents 7c053bf + 80112d8 commit c6cfb02

File tree

102 files changed

+2983
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2983
-36
lines changed

appveyor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ test_script:
9090
rmdir /s /q cpp\Decltype1
9191
rmdir /s /q cpp\Decltype2
9292
rmdir /s /q cpp\Function_Overloading1
93+
rmdir /s /q cpp\Resolver10
94+
rmdir /s /q cpp\Resolver11
95+
rmdir /s /q cpp\Template_Parameters1
9396
rmdir /s /q cpp\enum2
9497
rmdir /s /q cpp\enum7
9598
rmdir /s /q cpp\enum8

regression/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ add_subdirectory(goto-instrument)
3030
add_subdirectory(cpp)
3131
add_subdirectory(cbmc-cover)
3232
add_subdirectory(goto-instrument-typedef)
33+
add_subdirectory(smt2_solver)
3334
add_subdirectory(strings)
3435
add_subdirectory(invariants)
3536
add_subdirectory(goto-diff)
@@ -41,4 +42,4 @@ endif()
4142
add_subdirectory(goto-cc-cbmc)
4243
add_subdirectory(cbmc-cpp)
4344
add_subdirectory(goto-cc-goto-analyzer)
44-
45+
add_subdirectory(systemc)

regression/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ DIRS = cbmc \
1818
goto-cc-cbmc \
1919
cbmc-cpp \
2020
goto-cc-goto-analyzer \
21+
systemc
2122
# Empty last line
2223

2324
# Tests under goto-gcc cannot be run on Windows, so appveyor.yml unlinks

regression/cbmc/cpp1/main.cpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#include <cassert>
2+
3+
template <class T>
4+
class sc_signal
5+
{
6+
public:
7+
T data;
8+
sc_signal(){}
9+
sc_signal(const char *p) {}
10+
T read() {return data;}
11+
void write(const T &d) {data = d;}
12+
};
13+
14+
15+
struct rbm
16+
{
17+
18+
sc_signal<unsigned int> data_out; //<L1>
19+
20+
sc_signal<bool> done; // <L2>
21+
22+
sc_signal<bool> conf_done;
23+
24+
void config();
25+
26+
rbm()
27+
{
28+
29+
}
30+
31+
};
32+
33+
34+
void rbm::config()
35+
{
36+
do {
37+
conf_done.write(true);
38+
assert(conf_done.data==true);
39+
} while ( !conf_done.read() );
40+
}
41+
42+
int main()
43+
{
44+
rbm IMPL;
45+
IMPL.config();
46+
47+
return 0;
48+
}

regression/cbmc/cpp1/test.desc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
KNOWNBUG
2+
main.cpp
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
9+
--
10+
This has been reported as #661.

regression/cbmc/cpp2/main.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include <cassert>
2+
#include <stdint.h>
3+
#include <stdbool.h>
4+
5+
#undef HOTFIX
6+
7+
typedef struct {
8+
uint32_t value_31_0 : 32;
9+
} signal32_t;
10+
11+
typedef struct {
12+
uint8_t value_0_0 : 1;
13+
} signal1_t;
14+
15+
static inline bool yosys_simplec_get_bit_25_of_32(const signal32_t *sig)
16+
{
17+
return (sig->value_31_0 >> 25) & 1;
18+
}
19+
20+
struct rvfi_insn_srai_state_t
21+
{
22+
signal32_t rvfi_insn;
23+
signal32_t rvfi_rs1_rdata;
24+
signal1_t _abc_1398_n364;
25+
signal1_t _abc_1398_n363;
26+
};
27+
28+
void test(rvfi_insn_srai_state_t state, bool valid)
29+
{
30+
#ifndef HOTFIX
31+
state._abc_1398_n364.value_0_0 = yosys_simplec_get_bit_25_of_32(&state.rvfi_insn) ?
32+
yosys_simplec_get_bit_25_of_32(&state.rvfi_rs1_rdata) : state._abc_1398_n363.value_0_0;
33+
#else
34+
state._abc_1398_n364.value_0_0 = yosys_simplec_get_bit_25_of_32(&state.rvfi_insn) ?
35+
yosys_simplec_get_bit_25_of_32(&state.rvfi_rs1_rdata) : (bool)state._abc_1398_n363.value_0_0;
36+
#endif
37+
38+
assert(valid);
39+
}
40+
41+
int main(int argc, char* argv[])
42+
{
43+
rvfi_insn_srai_state_t state;
44+
bool valid;
45+
test(state, valid);
46+
return 0;
47+
}

regression/cbmc/cpp2/test.desc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG
2+
main.cpp
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
9+
^equality without matching types
10+
--
11+
This has been reported as #933.

regression/cpp/Apple_extensions1/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ void * _Nonnull p2;
55
// block pointer
66
void (^p3)(void);
77
#endif
8+
9+
int main(int argc, char* argv[])
10+
{
11+
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
CORE
1+
KNOWNBUG
22
main.cpp
33

44
^EXIT=0$
55
^SIGNAL=0$
66
--
77
^warning: ignoring
88
^CONVERSION ERROR$
9+
--
10+
This is being tracked in #1647.

regression/cpp/Constant2/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <cassert>
2+
13
int const C=10;
24

35
int main()

0 commit comments

Comments
 (0)