OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
gcc/testsuite/
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
gcc.dg
/
fixuns-trunc-1.c
1
/* { dg-do run } */
2
/* { dg-options "-std=c99" } */
3
4
unsigned long foo(double d)
5
{
6
return (unsigned long) d;
7
}
8
9
extern void abort(void);
10
11
int main(void)
12
{
13
double d;
14
unsigned long l;
15
16
#ifdef __LP64__
17
d = 9223372036854775808.7;
18
l = 1LL << 63;
19
20
if (foo(d) != l)
21
abort();
22
#endif
23
24
d = 122485.2;
25
l = 122485;
26
27
if (foo(d) != l)
28
abort();
29
30
return 0;
31
}