Mark Mitchell - PATCH: Tweak compliation of g++.dg/opt/switch4.C (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
- From: Mark Mitchell
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 Feb 2007 11:38:40 -0800
- Subject: PATCH: Tweak compliation of g++.dg/opt/switch4.C
- Reply-to: mark at codesourcery dot com
This test intentionally uses a case label that is out-of-range for the switch expression, which is an enumeration type. The problem that lead to the test case was an ICE.
When short enums are on (as they are by default on arm-none-eabi), this test case causes a warning and a spurious failure. Testing with -fshort-enums actually makes the most sense for this test case, as it makes certain that the case value to be out-of-range. So, I've committed this patch, to enable -fshort-enums, but also add -w, so that what we're really testing is that the compiler doesn't crash.
Applied to mainline.
-- Mark Mitchell CodeSourcery mark@codesourcery.com (650) 331-3385 x713
2007-02-22 Mark Mitchell mark@codesourcery.com
* g++.dg/opt/switch4.C: Pass -fshort-enums -w.
Index: gcc/testsuite/g++.dg/opt/switch4.C
--- gcc/testsuite/g++.dg/opt/switch4.C (revision 163611) +++ gcc/testsuite/g++.dg/opt/switch4.C (working copy) @@ -1,4 +1,5 @@ // { dg-do compile } +// { dg-options "-fshort-enums -w" }
// PR c++/20008
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |