mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-11-15 07:06:05 +00:00
1 line
561 B
C++
Executable File
1 line
561 B
C++
Executable File
/* Conformance Test 5.6.0.1: Make sure structs can be forward */
|
|
/* declared. */
|
|
|
|
#include <stdio.h>
|
|
|
|
int fail = 0;
|
|
|
|
struct foo bar;
|
|
struct foo {int i,j;};
|
|
|
|
void f(void)
|
|
|
|
{
|
|
struct foo {char j,k;} bar;
|
|
|
|
bar.j = 'a';
|
|
bar.k = 'b';
|
|
if ((bar.j != 'a') || (bar.k != 'b'))
|
|
fail = 1;
|
|
}
|
|
|
|
int main(void)
|
|
|
|
{
|
|
bar.i = -1;
|
|
bar.j = 3;
|
|
if ((bar.i != -1) || (bar.j != 3))
|
|
fail = 1;
|
|
f();
|
|
|
|
if (fail)
|
|
printf ("Failed Conformance Test 5.6.0.1\n");
|
|
else
|
|
printf ("Passed Conformance Test 5.6.0.1\n");
|
|
}
|