Skip to content

Commit 8d86e44

Browse files
andreast271tautschnig
authored andcommitted
Prevent regression failures of cpp tests on windows
1 parent 9adf5f1 commit 8d86e44

File tree

8 files changed

+30
-36
lines changed

8 files changed

+30
-36
lines changed

regression/cpp/Constant2/main.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
#include <cassert>
2-
31
int const C=10;
42

53
int main()
64
{
7-
assert(C==10);
5+
__CPROVER_assert(C == 10, "");
86

97
// this is *not* allowed
108
((int &)C)=20;

regression/cpp/Function_Overloading1/main.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1+
#ifdef __GNUC__
2+
#define NOTHROW __attribute__((nothrow))
3+
#else
4+
#define NOTHROW
5+
#endif
6+
17
namespace std {
28
// cmath
3-
__inline float abs(float x) __attribute__((nothrow));
4-
__inline double abs(double x) __attribute__((nothrow));
5-
__inline long double abs(long double x) __attribute__((nothrow));
9+
__inline float abs(float x) NOTHROW;
10+
__inline double abs(double x) NOTHROW;
11+
__inline long double abs(long double x) NOTHROW;
612
}
713

814
namespace std {
915
extern "C" {
10-
int abs(int) __attribute__((nothrow)) ;
16+
int abs(int) NOTHROW ;
1117
}
1218
extern "C++" {
13-
inline long abs(long n) __attribute__((nothrow));
14-
inline long long abs(long long n) __attribute__((nothrow));
19+
inline long abs(long n) NOTHROW;
20+
inline long long abs(long long n) NOTHROW;
1521
}
1622
}
1723

regression/cpp/Resolver10/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <cassert>
2-
31
struct A
42
{
53
int i;

regression/cpp/Resolver11/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <cassert>
2-
31
struct A
42
{
53
bool func() { return false; }

regression/cpp/Template_Parameters1/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <cassert>
2-
31
// V depends on Ty
42
template<typename Ty, Ty V>
53
class T

regression/cpp/enum7/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.cpp
33

44
^EXIT=0$

regression/cpp/enum8/main.cpp

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <cassert>
2-
31
enum E1 { e1 } e1_var;
42
enum E2 { e2 } e2_var;
53

@@ -23,19 +21,19 @@ struct some_struct
2321

2422
int main()
2523
{
26-
assert(f(0)==0);
27-
assert(f(e1)==1);
28-
assert(f(e2)==2);
29-
assert(f(e1_var)==1);
30-
assert(f(e2_var)==2);
31-
32-
assert(g(0)==0);
33-
assert(g(e1)==1);
34-
assert(g(e2)==0);
35-
assert(g(e1_var)==1);
36-
assert(g(e2_var)==0);
37-
38-
assert(f(some_struct_var.i)==0);
39-
assert(f(some_struct_var.e1)==1);
40-
assert(f(some_struct_var.e2)==2);
24+
__CPROVER_assert(f(0) == 0, "");
25+
__CPROVER_assert(f(e1) == 1, "");
26+
__CPROVER_assert(f(e2) == 2, "");
27+
__CPROVER_assert(f(e1_var) == 1, "");
28+
__CPROVER_assert(f(e2_var) == 2, "");
29+
30+
__CPROVER_assert(g(0) == 0, "");
31+
__CPROVER_assert(g(e1) == 1, "");
32+
__CPROVER_assert(g(e2) == 0, "");
33+
__CPROVER_assert(g(e1_var) == 1, "");
34+
__CPROVER_assert(g(e2_var) == 0, "");
35+
36+
__CPROVER_assert(f(some_struct_var.i) == 0, "");
37+
__CPROVER_assert(f(some_struct_var.e1) == 1, "");
38+
__CPROVER_assert(f(some_struct_var.e2) == 2, "");
4139
}

regression/cpp/nullptr1/main.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <cassert>
2-
31
typedef decltype(nullptr) nullptr_t;
42

53
static_assert(nullptr==0, "nullptr==0");
@@ -20,7 +18,7 @@ int main()
2018

2119
char buffer[10];
2220
void *p=my_null, *q=buffer;
23-
assert(q!=nullptr);
21+
__CPROVER_assert(q != nullptr, "");
2422

2523
something(nullptr);
2624
}

0 commit comments

Comments
 (0)