Skip to content

Commit 3175b5c

Browse files
authored
Merge pull request #5935 from tautschnig/cpp-regression-test
Enable cpp-from-CVS regression tests
2 parents 5d83cc4 + c1d5a1c commit 3175b5c

File tree

710 files changed

+4118
-3392
lines changed

Some content is hidden

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

710 files changed

+4118
-3392
lines changed

regression/cpp-from-CVS/Address_of_Method1/main.cpp renamed to regression/cbmc-cpp/Address_of_Method1/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <cassert>
12
struct x
23
{
34
void f();
@@ -11,7 +12,7 @@ void x::f()
1112

1213
int main()
1314
{
14-
assert(&x::f!=0);
15+
assert(&x::f != 0);
1516

16-
assert(&x::i!=0);
17+
assert(&x::i != 0);
1718
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG winbug macos-assert-broken
2+
main.cpp
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include <cassert>
2+
typedef unsigned DWORD;
3+
typedef signed LONG;
4+
typedef long long LONGLONG;
5+
6+
typedef union _LARGE_INTEGER {
7+
struct
8+
{
9+
DWORD LowPart;
10+
LONG HighPart;
11+
};
12+
struct
13+
{
14+
DWORD LowPart;
15+
LONG HighPart;
16+
} u;
17+
18+
LONGLONG QuadPart;
19+
} LARGE_INTEGER;
20+
21+
int main()
22+
{
23+
LARGE_INTEGER l;
24+
25+
l.QuadPart = 1;
26+
l.LowPart = 2;
27+
l.u.LowPart = 3;
28+
assert(l.LowPart == 3);
29+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE winbug macos-assert-broken
2+
main.cpp
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring

regression/cbmc-cpp/Array1/main.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
int y[5][4][3][2];
2+
3+
int main()
4+
{
5+
for(int i = 0; i < 5; i++)
6+
for(int j = 0; j < 4; j++)
7+
for(int k = 0; k < 3; k++)
8+
for(int l = 0; l < 2; l++)
9+
y[i][j][k][l] = 2;
10+
}

regression/cbmc-cpp/Array2/main.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
int y[2][3][4][5];
2+
3+
int main()
4+
{
5+
for(int i = 0; i < 5; i++)
6+
for(int j = 0; j < 4; j++)
7+
for(int k = 0; k < 3; k++)
8+
for(int l = 0; l < 2; l++)
9+
y[i][j][k][l] = 2; // out-of-bounds
10+
}

regression/cbmc-cpp/Array3/main.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
struct C
2+
{
3+
static const char *array[1];
4+
};
5+
6+
const char *C::array[1] = {"HELLO"};
7+
8+
int main(int argc, const char *argv[])
9+
{
10+
assert(*C::array[0] == 'H');
11+
}

0 commit comments

Comments
 (0)