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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.fortran/] [appendix-a/] [a.2.1.f90] - Blame information for rev 407

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

Line No. Rev Author Line
1 273 jeremybenn
! { dg-do run }
2
PROGRAM A2
3
  INCLUDE "omp_lib.h"      ! or USE OMP_LIB
4
  INTEGER X
5
  X=2
6
!$OMP PARALLEL NUM_THREADS(2) SHARED(X)
7
    IF (OMP_GET_THREAD_NUM() .EQ. 0) THEN
8
       X=5
9
    ELSE
10
    ! PRINT 1: The following read of x has a race
11
      PRINT *,"1: THREAD# ", OMP_GET_THREAD_NUM(), "X = ", X
12
    ENDIF
13
!$OMP BARRIER
14
    IF (OMP_GET_THREAD_NUM() .EQ. 0) THEN
15
    ! PRINT 2
16
      PRINT *,"2: THREAD# ", OMP_GET_THREAD_NUM(), "X = ", X
17
    ELSE
18
    ! PRINT 3
19
      PRINT *,"3: THREAD# ", OMP_GET_THREAD_NUM(), "X = ", X
20
    ENDIF
21
!$OMP END PARALLEL
22
END PROGRAM A2

powered by: WebSVN 2.1.0

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