summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/builtins/20010124-1.c
blob: 816287344e4dedb0660048c61a117ac78e5d1a4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Verify that structure return doesn't invoke memcpy on 
   overlapping objects.  */

extern void abort (void);

struct S {
  char stuff[1024];
};

union U {
  struct {
    int space;
    struct S s;
  } a;
  struct {
    struct S s;
    int space;
  } b;
};

struct S f(struct S *);
void g(union U *);

void main_test(void)
{
  union U u;
  u.b.s = f(&u.a.s);
  u.a.s = f(&u.b.s);
  g(&u);
}