Patchwork [testsuite] Fix g++.dg/debug/ra1.C

login
register
mail settings
Submitter Yufeng Zhang
Date Jan. 16, 2014, 6:44 p.m.
Message ID <52D82874.8090507@arm.com>
Download mbox | patch
Permalink /patch/311821/
State New
Headers show

Comments

Yufeng Zhang - Jan. 16, 2014, 6:44 p.m.
Hi,

g++.dg/debug/ra1.C fails on arm-none-eabi with the following message 
because enum types in arm eabi are represented by the smallest integral 
type:

warning: width of 'tree_base::code' exceeds its type [enabled by default]

This patch updates the test by changing the width of the 'code' bitfield 
from 16 to 8.

The patch passes make check-g++ RUNTESTFLAGS="debug.exp=ra1.C" on 
arm-none-eabi and x86_64.

OK for the mainline?

Thanks,
Yufeng


gcc/testsuite

	* g++.dg/debug/ra1.C (struct tree_base): Change the width of
	the 'code' bitfield from 16 to 8.
Richard Earnshaw - Jan. 20, 2014, 10:48 a.m.
On 16/01/14 18:44, Yufeng Zhang wrote:
> Hi,
> 
> g++.dg/debug/ra1.C fails on arm-none-eabi with the following message 
> because enum types in arm eabi are represented by the smallest integral 
> type:
> 
> warning: width of 'tree_base::code' exceeds its type [enabled by default]
> 
> This patch updates the test by changing the width of the 'code' bitfield 
> from 16 to 8.
> 
> The patch passes make check-g++ RUNTESTFLAGS="debug.exp=ra1.C" on 
> arm-none-eabi and x86_64.
> 
> OK for the mainline?
> 
> Thanks,
> Yufeng
> 
> 
> gcc/testsuite
> 
> 	* g++.dg/debug/ra1.C (struct tree_base): Change the width of
> 	the 'code' bitfield from 16 to 8.
> 

OK.

R.

Patch

diff --git a/gcc/testsuite/g++.dg/debug/ra1.C 
b/gcc/testsuite/g++.dg/debug/ra1.C
index b6f7bfc..5a68113 100644
--- a/gcc/testsuite/g++.dg/debug/ra1.C
+++ b/gcc/testsuite/g++.dg/debug/ra1.C
@@ -6,7 +6,7 @@  enum tree_code_class { tcc_type, tcc_other };
  extern enum tree_code_class tree_code_type[];

  struct tree_base {
-  enum tree_code code : 16;
+  enum tree_code code : 8;
    unsigned unsigned_flag : 1;
  };