summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr26565.c
blob: d45272df3af3d8081ab611b73e9b443e4d98e2eb (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
/* { dg-do run } */
/* m32c is already packed.  */
/* { dg-skip-if "" { "m32c-*-*" } { "*" } { "" } } */

void *memcpy(void *dest, const void *src, __SIZE_TYPE__ n);

struct timeval {
    long tv_sec;
};

struct outdata {
    long align;
    char seq;
    struct timeval tv __attribute__((packed)); /* { dg-warning "attribute ignored" "" { target default_packed } } */
};

void send_probe(struct outdata *outdata, struct timeval *tp) __attribute__((noinline));
void send_probe(struct outdata *outdata, struct timeval *tp)
{
    memcpy(&outdata->tv, tp, sizeof outdata->tv);
}

struct timeval t;
struct outdata outdata;

int main()
{
  send_probe(&outdata, &t);
  return 0;
}