annotate gcc/testsuite/g++.old-deja/g++.jason/enum6.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do run }
kono
parents:
diff changeset
2 // { dg-options "-fshort-enums" }
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 // On ARM EABI targets this testcase will cause a warning to be emitted
kono
parents:
diff changeset
5 // whilst EABI attributes are being merged at link time unless
kono
parents:
diff changeset
6 // the --no-enum-size-warning option is passed to the linker. Whilst the
kono
parents:
diff changeset
7 // enum-size attributes should only be emitted if there are values of
kono
parents:
diff changeset
8 // enum type that can escape the compilation unit, gcc cannot currently
kono
parents:
diff changeset
9 // detect this; if this facility is added then this linker option should
kono
parents:
diff changeset
10 // not be needed.
kono
parents:
diff changeset
11 // { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm_eabi } }
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 #include <limits.h>
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 enum A { a1 = 0x7fffffff };
kono
parents:
diff changeset
16 enum B { b1 = 0x80000000 };
kono
parents:
diff changeset
17 enum C { c1 = -1, c2 = 0x80000000 };
kono
parents:
diff changeset
18 enum D { d1 = CHAR_MIN, d2 = CHAR_MAX };
kono
parents:
diff changeset
19 enum E { e1 = CHAR_MIN, e2 = CHAR_MIN };
kono
parents:
diff changeset
20
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21 int
111
kono
parents:
diff changeset
22 main()
kono
parents:
diff changeset
23 {
kono
parents:
diff changeset
24 return (sizeof (A) != 4 || sizeof (B) != 4 || sizeof (C) != 8
kono
parents:
diff changeset
25 || sizeof (D) != 1 || sizeof (E) != 1);
kono
parents:
diff changeset
26 }