Skip to content

Commit 75f9c49

Browse files
committed
Add regression test for parsing of enums with underlying type specification
1 parent 7d6b1b4 commit 75f9c49

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

regression/ansi-c/enum9/main.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
typedef enum : unsigned
2+
{
3+
X
4+
} my_enum1;
5+
6+
enum my_enum2 : unsigned
7+
{
8+
Y
9+
};
10+
11+
struct S
12+
{
13+
enum my_enum2 : unsigned a;
14+
enum my_enum2 : unsigned b : 2;
15+
};
16+
17+
int main()
18+
{
19+
enum my_enum2 : unsigned enum_var1;
20+
}

regression/ansi-c/enum9/test.desc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CORE
2+
main.c
3+
--verbosity 2
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
(main.c:1:\d+)|(main.c\(1\)): warning: ignoring specification of underlying type for enum
7+
(main.c:6:\d+)|(main.c\(6\)): warning: ignoring specification of underlying type for enum
8+
(main.c:13:\d+)|(main.c\(13\)): warning: ignoring specification of underlying type for enum
9+
(main.c:14:\d+)|(main.c\(14\)): warning: ignoring specification of underlying type for enum
10+
(main.c:19:\d+)|(main.c\(19\)): warning: ignoring specification of underlying type for enum
11+
--
12+
--
13+
Checks that files containing enums with an underlying type specification can be
14+
parsed, and that a warning is output saying that the specification is ignored

0 commit comments

Comments
 (0)