diff mbox

[TESTSUITE] Add -fno-short-enums to pr51712

Message ID 000001cd901b$7b9d5e40$72d81ac0$@tkachov@arm.com
State New
Headers show

Commit Message

Kyrylo Tkachov Sept. 11, 2012, 12:46 p.m. UTC
Add -fno-short-enums flag to test c-c++-common/pr51712.c as discussed in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51712.
This removes the excess warning that caused the test to fail.
Tested in arm-none-eabi configuration. The test now passes.
Comment? Ok for trunk?

Thanks,
Kyrill

gcc/testsuite

2012-09-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	* c-c++-common/pr51712.c: Add -fno-short-enums flag to test.

Comments

Jakub Jelinek Sept. 11, 2012, 12:50 p.m. UTC | #1
On Tue, Sep 11, 2012 at 01:46:37PM +0100, Kyrylo Tkachov wrote:
> Add -fno-short-enums flag to test c-c++-common/pr51712.c as discussed in
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51712.
> This removes the excess warning that caused the test to fail.
> Tested in arm-none-eabi configuration. The test now passes.
> Comment? Ok for trunk?
> 
> Thanks,
> Kyrill
> 
> gcc/testsuite
> 
> 2012-09-11  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
> 
> 	* c-c++-common/pr51712.c: Add -fno-short-enums flag to test.

> --- a/gcc/testsuite/c-c++-common/pr51712.c
> +++ b/gcc/testsuite/c-c++-common/pr51712.c
> @@ -1,6 +1,6 @@
>  /* PR c/51712 */
>  /* { dg-do compile } */
> -/* { dg-options "-Wtype-limits" } */
> +/* { dg-options "-Wtype-limits -fno-short-enums" {target short_enums} } */

That is wrong, it means that on non-short_enums targets suddenly no
dg-options would be passed.
Instead you should keep the dg-options line as is and add
/* { dg-additional-options "-fno-short-enums" { target short_enums } } */
or just add the new dg-options line but keep the old one as well (though,
dg-additional-options is the new preferred way).

	Jakub
diff mbox

Patch

--- a/gcc/testsuite/c-c++-common/pr51712.c
+++ b/gcc/testsuite/c-c++-common/pr51712.c
@@ -1,6 +1,6 @@ 
 /* PR c/51712 */
 /* { dg-do compile } */
-/* { dg-options "-Wtype-limits" } */
+/* { dg-options "-Wtype-limits -fno-short-enums" {target short_enums} } */
 
 enum test_enum {
   FOO,