mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-23 14:30:12 +00:00
9558a88571
This is not permitted under standard C, and the previous commit caused this non-standard construct to stop working.
29 lines
466 B
C++
29 lines
466 B
C++
/* Conformance Test 4.6.7.1: Verification of union initialization */
|
|
|
|
union U1 { int i;
|
|
long L;
|
|
float f; };
|
|
|
|
union U1 u1 = { 3 };
|
|
static union U1 u2 = { 5 };
|
|
|
|
main ()
|
|
{
|
|
auto union U1 u3 = { 32767 };
|
|
|
|
if (u1.i != 3)
|
|
goto Fail;
|
|
|
|
if (u2.i != 5)
|
|
goto Fail;
|
|
|
|
if (u3.i != 32767)
|
|
goto Fail;
|
|
|
|
printf ("Passed Conformance Test 4.6.7.1\n");
|
|
return;
|
|
|
|
Fail:
|
|
printf ("Failed Conformance Test 4.6.7.1\n");
|
|
}
|