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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 273 jeremybenn
// { dg-do run }
2
// { dg-require-effective-target tls_runtime }
3
 
4
#include 
5
 
6
extern "C" void abort (void);
7
 
8
struct S { int t; char buf[64]; } thr = { 32, "" };
9
#pragma omp threadprivate (thr)
10
 
11
int
12
main (void)
13
{
14
  int l = 0;
15
 
16
  omp_set_dynamic (0);
17
  omp_set_num_threads (6);
18
 
19
#pragma omp parallel copyin (thr) reduction (||:l)
20
  {
21
    l = thr.t != 32;
22
    thr.t = omp_get_thread_num () + 11;
23
  }
24
 
25
  if (l || thr.t != 11)
26
    abort ();
27
 
28
#pragma omp parallel reduction (||:l)
29
  l = thr.t != omp_get_thread_num () + 11;
30
 
31
  if (l)
32
    abort ();
33
  return 0;
34
}

powered by: WebSVN 2.1.0

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