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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr16790-1.c] - Blame information for rev 298

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

Line No. Rev Author Line
1 297 jeremybenn
/* PR middle-end/16790.  */
2
 
3
extern void abort ();
4
 
5
static void test1(unsigned int u1)
6
{
7
  unsigned int y_final_1;
8
  signed short y_middle;
9
  unsigned int y_final_2;
10
 
11
  y_final_1 = (unsigned int)( (signed short)(u1 * 2) * 3 );
12
  y_middle  =                 (signed short)(u1 * 2);
13
  y_final_2 = (unsigned int)( y_middle * 3 );
14
 
15
  if (y_final_1 != y_final_2)
16
    abort ();
17
}
18
 
19
 
20
static void test2(unsigned int u1)
21
{
22
  unsigned int y_final_1;
23
  signed short y_middle;
24
  unsigned int y_final_2;
25
 
26
  y_final_1 = (unsigned int)( (signed short)(u1 << 1) * 3 );
27
  y_middle  =                 (signed short)(u1 << 1);
28
  y_final_2 = (unsigned int)( y_middle * 3 );
29
 
30
  if (y_final_1 != y_final_2)
31
    abort ();
32
}
33
 
34
 
35
int main()
36
{
37
  test1(0x4000U);
38
  test2(0x4000U);
39
  return 0;
40
}
41
 

powered by: WebSVN 2.1.0

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