aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/libgomp/testsuite/libgomp.c/appendix-a/a.33.3.c
blob: 0b7f0197ce9a6710425d40e9f091dfa37c09a122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */

#include <stdio.h>
#include <stdlib.h>
#include <omp.h>
omp_lock_t *
new_lock ()
{
  omp_lock_t *lock_ptr;
#pragma omp single copyprivate(lock_ptr)
  {
    lock_ptr = (omp_lock_t *) malloc (sizeof (omp_lock_t));
    omp_init_lock (lock_ptr);
  }
  return lock_ptr;
}