1 // { dg-do run  }
2 // { dg-options "-fshort-enums" }
3 
4 // Origin: Mark Mitchell <mark@codesourcery.com>
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* 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* } }
16 
17 enum E {
18   a = -312
19 };
20 
21 E e = a;
22 
main()23 int main () {
24   if ((int) e != -312)
25     return 1;
26 }
27