Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/20030606-1.c

raw
1 void abort (void);
2 void exit (int);
3
4 int * foo (int *x, int b)
5 {
6
7 *(x++) = 55;
8 if (b)
9 *(x++) = b;
10
11 return x;
12 }
13
14 int
15 main(void)
16 {
17 int a[5];
18
19 __builtin_memset (a, 1, sizeof (a));
20
21 if (foo(a, 0) - a != 1 || a[0] != 55 || a[1] != a[4])
22 abort();
23
24 __builtin_memset (a, 1, sizeof (a));
25
26 if (foo(a, 2) - a != 2 || a[0] != 55 || a[1] != 2)
27 abort();
28
29 exit (0);
30 }