1// { dg-do assemble { target sparc-*-* } }
2// { dg-options "-ansi -pedantic-errors -Wcast-align" }
3
4
5// Copyright (C) 1999 Free Software Foundation, Inc.
6// Contributed by Nathan Sidwell 7 Dec 1999 <nathan@acm.org>
7
8// converting a T * to void * does not need a complete T, and doesn't
9// increase alignment requirements.
10
11struct X;
12struct Y;
13struct Z {double m;};
14
15void f3 (X *xp, Z *zp)
16{
17  (void *)xp;
18  (void *)zp;
19  (Y *)xp;
20  (Y *)zp;
21  (Z *)xp;
22}
23
24void f4 (char *ptr)
25{
26  (Z *)ptr;           // { dg-warning "" } alignment
27}
28