Skip to content

Commit 240ae60

Browse files
author
Daniel Kroening
committed
tests from Dan
1 parent e0a6bbd commit 240ae60

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

regression/ansi-c/sizeof4/main.c

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
#define STATIC_ASSERT(condition) \
3+
int some_array##__LINE__[(condition) ? 1 : -1];
4+
5+
// The result of boolean operators is always an int
6+
STATIC_ASSERT(sizeof(1.0 && 1.0)==sizeof(int));
7+
STATIC_ASSERT(sizeof(1.0 || 1.0)==sizeof(int));
8+
STATIC_ASSERT(sizeof(!1.0)==sizeof(int));
9+
10+
int main()
11+
{
12+
}

regression/ansi-c/sizeof4/test.desc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$

regression/cbmc/enum6/main.c

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <assert.h>
2+
3+
int main(void)
4+
{
5+
enum A { zero, one, two, three } a = two, b = one, c = three;
6+
7+
a <<= b;
8+
assert(a==4);
9+
10+
c += b;
11+
assert(c==4);
12+
13+
enum E { fortytwo=42 } e = fortytwo;
14+
double res;
15+
res = -42.0 + (double) e;
16+
assert ((res >= -0.000005) && (res <= 0.000005));
17+
18+
return 0;
19+
}

regression/cbmc/enum6/test.desc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
main.c
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring

0 commit comments

Comments
 (0)