OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [enum4.C] - Blame information for rev 384

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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