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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c++/] [pr43893.C] - Blame information for rev 859

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

Line No. Rev Author Line
1 273 jeremybenn
// PR c/43893
2
// { dg-do run }
3
 
4
extern "C" void abort ();
5
 
6
template 
7
void
8
f1 ()
9
{
10
  int c;
11
  T i;
12
  c = 0;
13
#pragma omp parallel for reduction(+:c)
14
  for (i = M; i < N; i++)
15
    c++;
16
  if (c != 1)
17
    abort ();
18
}
19
 
20
template 
21
void
22
f2 ()
23
{
24
  int c;
25
  T i;
26
  c = 0;
27
#pragma omp parallel for reduction(+:c)
28
  for (i = M; i <= N; i++)
29
    c++;
30
  if (c != 1)
31
    abort ();
32
}
33
 
34
template 
35
void
36
f3 ()
37
{
38
  int c;
39
  T i;
40
  c = 0;
41
#pragma omp parallel for reduction(+:c)
42
  for (i = M; i > N; i--)
43
    c++;
44
  if (c != 1)
45
    abort ();
46
}
47
 
48
template 
49
void
50
f4 ()
51
{
52
  int c;
53
  T i;
54
  c = 0;
55
#pragma omp parallel for reduction(+:c)
56
  for (i = M; i >= N; i--)
57
    c++;
58
  if (c != 1)
59
    abort ();
60
}
61
 
62
int
63
main ()
64
{
65
  int c;
66
  unsigned int i;
67
  int j;
68
  c = 0;
69
#pragma omp parallel for reduction(+:c)
70
  for (i = 0; i < 1; i++)
71
    c++;
72
  if (c != 1)
73
    abort ();
74
  f1  ();
75
  c = 0;
76
#pragma omp parallel for reduction(+:c)
77
  for (i = 0; i <= 0; i++)
78
    c++;
79
  if (c != 1)
80
    abort ();
81
  f2  ();
82
  c = 0;
83
#pragma omp parallel for reduction(+:c)
84
  for (j = - __INT_MAX__ - 1; j < - __INT_MAX__; j++)
85
    c++;
86
  if (c != 1)
87
    abort ();
88
  f1  ();
89
  c = 0;
90
#pragma omp parallel for reduction(+:c)
91
  for (j = - __INT_MAX__ - 1; j <= - __INT_MAX__ - 1; j++)
92
    c++;
93
  if (c != 1)
94
    abort ();
95
  f2  ();
96
  c = 0;
97
#pragma omp parallel for reduction(+:c)
98
  for (i = 2U * __INT_MAX__ + 1; i > 2U * __INT_MAX__; i--)
99
    c++;
100
  if (c != 1)
101
    abort ();
102
  f3  ();
103
  c = 0;
104
#pragma omp parallel for reduction(+:c)
105
  for (i = 2U * __INT_MAX__ + 1; i >= 2U * __INT_MAX__ + 1; i--)
106
    c++;
107
  if (c != 1)
108
    abort ();
109
  f4  ();
110
  c = 0;
111
#pragma omp parallel for reduction(+:c)
112
  for (j = __INT_MAX__; j > __INT_MAX__ - 1; j--)
113
    c++;
114
  if (c != 1)
115
    abort ();
116
  f3  ();
117
  c = 0;
118
#pragma omp parallel for reduction(+:c)
119
  for (j = __INT_MAX__; j >= __INT_MAX__; j--)
120
    c++;
121
  if (c != 1)
122
    abort ();
123
  f4  ();
124
  return 0;
125
}

powered by: WebSVN 2.1.0

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