repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR rtl-optimization/77919
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.c
/
pr64868.c
blob
f93caf2091c1714ae55574726ef87cd9c745f011
1
/* PR c/64868 */
2
/* { dg-do run } */
3
4
float
f
=
2.0
f
;
5
double
d
=
4.0
;
6
long double
ld
=
8.0L
;
7
8
void
9
foo
()
10
{
11
#pragma omp atomic
12
f
=
1.0
f
/
f
;
13
#pragma omp atomic
14
f
=
1
/
f
;
15
#pragma omp atomic
16
f
=
f
/
2.0
f
;
17
#pragma omp atomic
18
f
=
f
/
2
;
19
#pragma omp atomic
20
f
/=
2.0
f
;
21
#pragma omp atomic
22
f
/=
2
;
23
#pragma omp atomic
24
d
=
1.0
/
d
;
25
#pragma omp atomic
26
d
=
1
/
d
;
27
#pragma omp atomic
28
d
=
d
/
2.0
;
29
#pragma omp atomic
30
d
=
d
/
2
;
31
#pragma omp atomic
32
d
/=
2.0
;
33
#pragma omp atomic
34
d
/=
2
;
35
#pragma omp atomic
36
ld
=
1.0L
/
ld
;
37
#pragma omp atomic
38
ld
=
1
/
ld
;
39
#pragma omp atomic
40
ld
=
ld
/
2.0L
;
41
#pragma omp atomic
42
ld
=
ld
/
2
;
43
#pragma omp atomic
44
ld
/=
2.0L
;
45
#pragma omp atomic
46
ld
/=
2
;
47
if
(
f
!=
0.125
f
||
d
!=
0.25
||
ld
!=
0.5L
)
48
__builtin_abort
();
49
}
50
51
#ifdef __cplusplus
52
template
<
typename T
,
int
N1
,
int
N2
>
53
void
54
bar
()
55
{
56
T v
= ::
d
;
57
#pragma omp atomic
58
v
*=
16
;
59
#pragma omp atomic
60
v
=
1.0
/
v
;
61
#pragma omp atomic
62
v
=
N1
/
v
;
63
#pragma omp atomic
64
v
=
v
/
2.0
;
65
#pragma omp atomic
66
v
=
v
/
N2
;
67
#pragma omp atomic
68
v
/=
2.0
;
69
#pragma omp atomic
70
v
/=
N2
;
71
if
(
v
!=
0.25
)
72
__builtin_abort
();
73
}
74
#endif
75
76
int
77
main
()
78
{
79
foo
();
80
#ifdef __cplusplus
81
bar
<
float
,
1
,
2
> ();
82
bar
<
double
,
1
,
2
> ();
83
bar
<
long double
,
1
,
2
> ();
84
#endif
85
return
0
;
86
}