Skip to content

Commit 4a5f6dd

Browse files
author
thk123
committed
Adding const variables tests
The tests relating to structs and unions are marked as known bugs as they are related to diffblue#355
1 parent f4832d5 commit 4a5f6dd

File tree

6 files changed

+65
-0
lines changed

6 files changed

+65
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
typedef struct tag_struct_name
3+
{
4+
int x;
5+
float y;
6+
} MYSTRUCT;
7+
8+
void fun()
9+
{
10+
const struct tag_struct_name tag_struct_var = {.x = 1, .y = 3.14f};
11+
const MYSTRUCT mystruct_var = {.x = 3, .y = 2.1f};
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG
2+
main.c
3+
"--show-symbol-table"
4+
// Enable multi-line checking
5+
-Pzo
6+
EXIT=0
7+
SIGNAL=0
8+
(?s)Base name\.+: tag_struct_var.Mode\.+: C.Type\.+: const struct tag_struct_name
9+
(?s)Base name\.+: mystruct_var.Mode\.+: C.Type\.+: const MYSTRUCT
10+
--
11+
warning: ignoring
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
typedef int MYINT;
3+
4+
void fun()
5+
{
6+
const int int_var = 3;
7+
const MYINT myint_var = 5;
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CORE
2+
main.c
3+
"--show-symbol-table"
4+
// Enable multi-line checking
5+
-Pzo
6+
EXIT=0
7+
SIGNAL=0
8+
(?s)Base name\.+: int_var.Mode\.+: C.Type\.+: const signed int
9+
(?s)Base name\.+: myint_var.Mode\.+: C.Type\.+: const MYINT
10+
--
11+
warning: ignoring
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
typedef union tag_union_name
3+
{
4+
int x;
5+
float y;
6+
} MYUNION;
7+
8+
void fun()
9+
{
10+
const union tag_union_name tag_union_var = {1};
11+
const MYUNION myunion_var = {.y = 2.1f};
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG
2+
main.c
3+
"--show-symbol-table"
4+
// Enable multi-line checking
5+
-Pzo
6+
EXIT=0
7+
SIGNAL=0
8+
(?s)Base name\.+: tag_union_var.Mode\.+: C.Type\.+: const union tag_union_name
9+
(?s)Base name\.+: myunion_var.Mode\.+: C.Type\.+: const MYUNION
10+
--
11+
warning: ignoring

0 commit comments

Comments
 (0)