URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 816 |
Rev 826 |
/* PR 35701 */
|
/* PR 35701 */
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-Wconversion -Wsign-conversion" } */
|
/* { dg-options "-Wconversion -Wsign-conversion" } */
|
/* { dg-require-effective-target int32plus } */
|
/* { dg-require-effective-target int32plus } */
|
|
|
typedef struct _my_struct_t {
|
typedef struct _my_struct_t {
|
unsigned int small:1;
|
unsigned int small:1;
|
unsigned int big:31;
|
unsigned int big:31;
|
} my_struct_t, *my_struct_p_t;
|
} my_struct_t, *my_struct_p_t;
|
|
|
void
|
void
|
my_func1(unsigned int sm, unsigned int bi, my_struct_p_t msp)
|
my_func1(unsigned int sm, unsigned int bi, my_struct_p_t msp)
|
{
|
{
|
msp->small = sm; /* { dg-warning "conversion" } */
|
msp->small = sm; /* { dg-warning "conversion" } */
|
msp->big = bi; /* { dg-warning "conversion" } */
|
msp->big = bi; /* { dg-warning "conversion" } */
|
}
|
}
|
|
|
void
|
void
|
my_func2(unsigned int sm, unsigned int bi, my_struct_p_t msp)
|
my_func2(unsigned int sm, unsigned int bi, my_struct_p_t msp)
|
{
|
{
|
msp->small = sm & 1U;
|
msp->small = sm & 1U;
|
msp->big = bi & 0x7fffffffU;
|
msp->big = bi & 0x7fffffffU;
|
}
|
}
|
|
|
unsigned short
|
unsigned short
|
my_func3(unsigned int sm)
|
my_func3(unsigned int sm)
|
{
|
{
|
unsigned short res;
|
unsigned short res;
|
res = sm & 0xff20U;
|
res = sm & 0xff20U;
|
return res;
|
return res;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.