URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [enum5.C] - Rev 749
Go to most recent revision | Compare with Previous | Blame | View Log
// { dg-do run }
// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
// Contributed by Ben Elliston <bje@redhat.com>
// PR 80: Packed enums use minimum required storage.
extern "C" void abort();
enum numbers { one, two, three } __attribute__ ((packed)) nums;
enum colours { red = 1000, green, blue } __attribute__ ((packed)) cols;
enum conditions { fine, rain, cloudy } __attribute__ ((packed)) forecast;
int
main()
{
if (sizeof (nums) != 1)
abort ();
if (sizeof (cols) != 2)
abort ();
if (sizeof (forecast) != 1)
abort ();
return 0;
}
Go to most recent revision | Compare with Previous | Blame | View Log