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.
13 // { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm_eabi } }
14
15 enum E {
16 a = -312
17 };
18
19 E e = a;
20
main()21 int main () {
22 if ((int) e != -312)
23 return 1;
24 }
25