From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/gcc.dg/pr35701.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr35701.c (limited to 'gcc/testsuite/gcc.dg/pr35701.c') diff --git a/gcc/testsuite/gcc.dg/pr35701.c b/gcc/testsuite/gcc.dg/pr35701.c new file mode 100644 index 000000000..414443097 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr35701.c @@ -0,0 +1,31 @@ +/* PR 35701 */ +/* { dg-do compile } */ +/* { dg-options "-Wconversion -Wsign-conversion" } */ +/* { dg-require-effective-target int32plus } */ + +typedef struct _my_struct_t { + unsigned int small:1; + unsigned int big:31; +} my_struct_t, *my_struct_p_t; + +void +my_func1(unsigned int sm, unsigned int bi, my_struct_p_t msp) +{ + msp->small = sm; /* { dg-warning "conversion" } */ + msp->big = bi; /* { dg-warning "conversion" } */ +} + +void +my_func2(unsigned int sm, unsigned int bi, my_struct_p_t msp) +{ + msp->small = sm & 1U; + msp->big = bi & 0x7fffffffU; +} + +unsigned short +my_func3(unsigned int sm) +{ + unsigned short res; + res = sm & 0xff20U; + return res; +} -- cgit v1.2.3