1 // { dg-do run { target { ! default_packed } } }
4 // Copyright (C) 2003 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 15 Jul 2003 <nathan@codesourcery.com>
7 // Packed fields are unsuitable for direct reference binding.
9 struct Unpacked { int i; };
11 int ConstRef (int const &p, int const *ptr, int v)
20 int ConstRef (Unpacked const &p, Unpacked const *ptr, int v)
29 int Val (int p, int v)
35 int Val (Unpacked p, int v)
42 struct __attribute__ ((packed)) Packed
50 int Foo (Packed &p, int i, int ui)
54 if ((r = Val (p.i, i)))
56 if ((r = Val (p.u.i, ui)))
58 if ((r = Val (p.u, ui)))
61 if ((r = ConstRef (p.i, &p.i, i)))
76 return Foo (p, 0x3456789a, 0xbcdef00f);