Skip to content

Commit f4832d5

Browse files
author
thk123
committed
Adding tests for union typedefs
1 parent e333eb9 commit f4832d5

File tree

6 files changed

+75
-0
lines changed

6 files changed

+75
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
typedef union tag_union_name
3+
{
4+
int x;
5+
float y;
6+
} MYUNION;
7+
8+
void fun(union tag_union_name tag_union_param, MYUNION myunion_param)
9+
{
10+
}
Lines changed: 11 additions & 0 deletions
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\.+: tag_union_param.Mode\.+: C.Type\.+: union tag_union_name
9+
(?s)Base name\.+: myunion_param.Mode\.+: C.Type\.+: MYUNION
10+
--
11+
warning: ignoring
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
typedef union tag_union_name
3+
{
4+
int x;
5+
float y;
6+
} MYUNION;
7+
8+
union tag_union_name fun()
9+
{
10+
union tag_union_name return_variable = {1};
11+
return return_variable;
12+
}
13+
14+
MYUNION fun2()
15+
{
16+
MYUNION return_variable = {1};
17+
return return_variable;
18+
}
19+
20+
Lines changed: 11 additions & 0 deletions
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\.+: fun.Mode\.+: C.Type\.+: union tag_union_name \(\)
9+
(?s)Base name\.+: fun2.Mode\.+: C.Type\.+: MYUNION \(\)
10+
--
11+
warning: ignoring
Lines changed: 12 additions & 0 deletions
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+
union tag_union_name tag_union_var = {1};
11+
MYUNION myunion_var = {.y = 2.1f};
12+
}
Lines changed: 11 additions & 0 deletions
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\.+: tag_union_var.Mode\.+: C.Type\.+: union tag_union_name
9+
(?s)Base name\.+: myunion_var.Mode\.+: C.Type\.+: MYUNION
10+
--
11+
warning: ignoring

0 commit comments

Comments
 (0)