mirror of
https://github.com/nArnoSNES/tcc-65816.git
synced 2024-06-11 22:29:28 +00:00
31 lines
374 B
C
31 lines
374 B
C
struct foo { int i; int j; };
|
|
|
|
int bar (struct foo *k, int k2, int f, int f2)
|
|
{
|
|
int *p, *q;
|
|
int res;
|
|
if (f)
|
|
p = &k->i;
|
|
else
|
|
p = &k->j;
|
|
res = *p;
|
|
k->i = 1;
|
|
if (f2)
|
|
q = p;
|
|
else
|
|
q = &k2;
|
|
return res + *q;
|
|
}
|
|
|
|
extern void abort (void);
|
|
|
|
int main()
|
|
{
|
|
struct foo k;
|
|
k.i = 0;
|
|
k.j = 1;
|
|
if (bar (&k, 1, 1, 1) != 1)
|
|
abort ();
|
|
return 0;
|
|
}
|