Skip several analyzer socket tests on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / c-c++-common / pr51628-28.c
blob80d0c605670a9420f8c4f3521bebbf5a385597ea
1 /* PR c/51628. */
2 /* { dg-do compile } */
3 /* { dg-options "-O" } */
5 struct A {
6 int i;
7 } __attribute__ ((packed));
9 int *
10 foo3 (struct A *p1, int *q1, int *q2, struct A *p2)
12 return (q1
13 ? &p1->i
14 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
15 : (q2 ? &p2->i : q2));
16 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
19 int*
20 foo4 (struct A *p1, int **q1, int *q2, int *q3, struct A *p2)
22 return (q1
23 ? (*q1 = q2, &p1->i)
24 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
25 : (q2
26 ? (*q1 = &p1->i,
27 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
28 *q2 = 2, &p2->i)
29 /* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
30 : q2));