c++/coroutines: correct passing *this to promise type [PR104981]
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20030606-1.c
blobedcbc8ce965f4bb0226a800fd973ae082f490e0c
1 void abort (void);
2 void exit (int);
4 int * foo (int *x, int b)
7 *(x++) = 55;
8 if (b)
9 *(x++) = b;
11 return x;
14 int
15 main(void)
17 int a[5];
19 __builtin_memset (a, 1, sizeof (a));
21 if (foo(a, 0) - a != 1 || a[0] != 55 || a[1] != a[4])
22 abort();
24 __builtin_memset (a, 1, sizeof (a));
26 if (foo(a, 2) - a != 2 || a[0] != 55 || a[1] != 2)
27 abort();
29 exit (0);