OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [multiword-1.c] - Blame information for rev 404

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

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O3" } */
3
/* { dg-require-effective-target ilp32 } */
4
 
5
typedef unsigned int u32;
6
typedef unsigned long long u64;
7
 
8
u64 __attribute__((noinline))
9
foo (u32 high, u32 low)
10
{
11
  return ((u64)high << 32) | low;
12
}
13
 
14
u32 __attribute__((noinline))
15
right (u64 t)
16
{
17
  return (u32)(t >> 32);
18
}
19
 
20
u64 __attribute__((noinline))
21
left (u32 t)
22
{
23
  return (u64)t << 32;
24
}
25
 
26
u32 __attribute__((noinline))
27
right2 (u64 t)
28
{
29
  return (u32)(t >> 40);
30
}
31
 
32
u64 __attribute__((noinline))
33
left2 (u32 t)
34
{
35
  return (u64)t << 40;
36
}
37
 
38
u64 __attribute__((noinline))
39
zeroextend (u32 t)
40
{
41
  return (u64)t;
42
}
43
 
44
extern void abort ();
45
 
46
int
47
main ()
48
{
49
  if (foo (13000, 12000) != 55834574860000ULL)
50
    abort ();
51
 
52
  if (right (55834574860000ULL) != 13000)
53
    abort ();
54
 
55
  if (left (13000) != 55834574848000ULL)
56
    abort ();
57
 
58
  if (right2 (55834574860000ULL) != 50)
59
    abort ();
60
 
61
  if (left2 (13000) != 14293651161088000ULL)
62
    abort ();
63
 
64
  if (zeroextend (13000) != 13000ULL)
65
    abort ();
66
 
67
  return 0;
68
}

powered by: WebSVN 2.1.0

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