Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.old-deja/g++.law/enum9.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 // { dg-do run } | |
2 // { dg-options "-fshort-enums" } | |
3 | |
4 // On ARM EABI targets this testcase will cause a warning to be emitted | |
5 // whilst EABI attributes are being merged at link time unless | |
6 // the --no-enum-size-warning option is passed to the linker. Whilst the | |
7 // enum-size attributes should only be emitted if there are values of | |
8 // enum type that can escape the compilation unit, gcc cannot currently | |
9 // detect this; if this facility is added then this linker option should | |
10 // not be needed. | |
11 // { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm_eabi } } | |
12 | |
13 // GROUPS passed enums | |
14 extern "C" int printf (const char *, ...); | |
15 | |
16 enum E { A = 0x80000000, B = 0 }; | |
17 | |
18 main() | |
19 { | |
20 if (sizeof (E) != 4) | |
21 { printf ("FAIL\n"); return 1; } | |
22 else | |
23 printf ("PASS\n"); | |
24 return 0; | |
25 } |