Skip to content

Commit 42b4740

Browse files
committed
dump-c regression test of union initializers
Even in upcoming changes there must not be a situation where such initializers cannot be dumped in a compilable fashion.
1 parent 60feede commit 42b4740

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
union U {
2+
int *p;
3+
unsigned long long p_int;
4+
} u = {.p_int = 42};
5+
6+
int main()
7+
{
8+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
main.c
3+
--dump-c
4+
=(\(signed int \*\))?42
5+
^EXIT=0$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring
9+
irep
10+
--
11+
This test must pass compiling the output generated using dump-c, which implies
12+
that no irep strings can occur.

0 commit comments

Comments
 (0)