annotate gcc/testsuite/g++.old-deja/g++.law/enum9.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 // GROUPS passed enums
kono
parents:
diff changeset
14 extern "C" int printf (const char *, ...);
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 enum E { A = 0x80000000, B = 0 };
kono
parents:
diff changeset
17
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
18 int
111
kono
parents:
diff changeset
19 main()
kono
parents:
diff changeset
20 {
kono
parents:
diff changeset
21 if (sizeof (E) != 4)
kono
parents:
diff changeset
22 { printf ("FAIL\n"); return 1; }
kono
parents:
diff changeset
23 else
kono
parents:
diff changeset
24 printf ("PASS\n");
kono
parents:
diff changeset
25 return 0;
kono
parents:
diff changeset
26 }