OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.jason/] [enum6.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// { dg-options "-fshort-enums" }
3
 
4
// On ARM EABI targets this testcase will cause a warning to be emitted
5
// whilst EABI attributes are being merged at link time unless
6
// the --no-enum-size-warning option is passed to the linker.  Whilst the
7
// enum-size attributes should only be emitted if there are values of
8
// enum type that can escape the compilation unit, gcc cannot currently
9
// detect this; if this facility is added then this linker option should
10
// not be needed.  arm-*-linux*eabi should be a good approximation to
11
// those platforms where the EABI supplement defines enum values to be
12
// 32 bits wide.
13
// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
14
 
15
#include 
16
 
17
enum A { a1 = 0x7fffffff };
18
enum B { b1 = 0x80000000 };
19
enum C { c1 = -1, c2 = 0x80000000 };
20
enum D { d1 = CHAR_MIN, d2 = CHAR_MAX };
21
enum E { e1 = CHAR_MIN, e2 = CHAR_MIN };
22
 
23
main()
24
{
25
  return (sizeof (A) != 4 || sizeof (B) != 4 || sizeof (C) != 8
26
          || sizeof (D) != 1 || sizeof (E) != 1);
27
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.