Skip to content

Commit 0befb9d

Browse files
author
thk123
committed
Added tests for different cases
Added cases for union types, for anonymous structs and for volatile variables (as opposed to const variables). Also added test for verifying the dump C output
1 parent 286a19d commit 0befb9d

File tree

8 files changed

+85
-0
lines changed

8 files changed

+85
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
int main()
3+
{
4+
const struct struct_tag_name {
5+
int x;
6+
float y;
7+
} my_struct_var = {.x = 1, .y = 3.15};
8+
const double z = 4;
9+
return 0;
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--show-symbol-table
4+
^Type\.*: const struct struct_tag_name$
5+
^Type\.*: const double$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
struct struct_tag_name
3+
{
4+
int x;
5+
float y;
6+
};
7+
8+
int main()
9+
{
10+
const struct struct_tag_name my_struct_var = {.x = 1, .y = 3.15};
11+
const double z = 4;
12+
return 0;
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--dump-c
4+
^\s*const struct struct_tag_name my_struct_var
5+
^\s*const double z
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
union union_tag_name
3+
{
4+
int x;
5+
float y;
6+
};
7+
8+
int main()
9+
{
10+
const union union_tag_name my_union_var = {.y = 3.15};
11+
const double z = 4;
12+
return 0;
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--show-symbol-table
4+
^Type\.*: const union union_tag_name$
5+
^Type\.*: const double$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
struct struct_tag_name
3+
{
4+
int x;
5+
float y;
6+
};
7+
8+
int main()
9+
{
10+
volatile struct struct_tag_name my_struct_var = {.x = 1, .y = 3.15};
11+
const double z = 4;
12+
return 0;
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.c
3+
--show-symbol-table
4+
^Type\.*: volatile struct struct_tag_name$
5+
^Type\.*: const double$
6+
^EXIT=0$
7+
^SIGNAL=0$
8+
--
9+
^warning: ignoring

0 commit comments

Comments
 (0)