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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [nested-calls-1.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* PR middle-end/24003 */
2
/* Contributed by Eric Botcazou <ebotcazou@adacore.com> */
3
 
4
/* { dg-do run } */
5
/* { dg-options "-std=c99 -O -fno-inline" } */
6
/* { dg-options "-std=c99 -O -fno-inline -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
7
 
8
#include <limits.h>
9
 
10
typedef unsigned long uns32_t;
11
typedef unsigned long long uns64_t;
12
 
13
extern void abort(void);
14
 
15
uns32_t lo (uns64_t p)
16
{
17
  return (uns32_t)p;
18
}
19
 
20
uns64_t concat (uns32_t p1, uns32_t p2)
21
{
22
#if LLONG_MAX > 2147483647L
23
  return ((uns64_t)p1 << 32) | p2;
24
#else
25
  return 0;
26
#endif
27
}
28
 
29
uns64_t lshift32 (uns64_t p1, uns32_t p2)
30
{
31
  return concat (lo (p1), p2);
32
}
33
 
34
int main(void)
35
{
36
#if LLONG_MAX > 2147483647L
37
  if (lshift32 (0xFFFFFFFF12345678ULL, 0x90ABCDEFUL) != 0x1234567890ABCDEFULL)
38
    abort ();
39
#endif
40
 
41
  return 0;
42
}

powered by: WebSVN 2.1.0

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