OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr35701.c] - Blame information for rev 753

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* PR 35701 */
2
/* { dg-do compile } */
3
/* { dg-options "-Wconversion -Wsign-conversion" } */
4
/* { dg-require-effective-target int32plus } */
5
 
6
typedef struct _my_struct_t {
7
  unsigned int small:1;
8
  unsigned int big:31;
9
} my_struct_t, *my_struct_p_t;
10
 
11
void
12
my_func1(unsigned int sm, unsigned int bi, my_struct_p_t msp)
13
{
14
  msp->small = sm; /* { dg-warning "conversion" } */
15
  msp->big = bi; /* { dg-warning "conversion" } */
16
}
17
 
18
void
19
my_func2(unsigned int sm, unsigned int bi, my_struct_p_t msp)
20
{
21
  msp->small = sm & 1U;
22
  msp->big = bi & 0x7fffffffU;
23
}
24
 
25
unsigned short
26
my_func3(unsigned int sm)
27
{
28
  unsigned short res;
29
  res = sm & 0xff20U;
30
  return res;
31
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.