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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [gomp/] [appendix-a/] [a.33.2.c] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
 
3
#include <stdio.h>
4
#include <stdlib.h>
5
float
6
read_next ()
7
{
8
  float *tmp;
9
  float return_val;
10
#pragma omp single copyprivate(tmp)
11
  {
12
    tmp = (float *) malloc (sizeof (float));
13
  }                             /* copies the pointer only */
14
#pragma omp master
15
  {
16
    scanf ("%f", tmp);
17
  }
18
#pragma omp barrier
19
  return_val = *tmp;
20
#pragma omp barrier
21
#pragma omp single nowait
22
  {
23
    free (tmp);
24
  }
25
  return return_val;
26
}

powered by: WebSVN 2.1.0

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