| 1 | !!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
|
|---|
| 2 | !!! Copyright (c) 2017-20, Lawrence Livermore National Security, LLC
|
|---|
| 3 | !!! and DataRaceBench project contributors. See the DataRaceBench/COPYRIGHT file for details.
|
|---|
| 4 | !!!
|
|---|
| 5 | !!! SPDX-License-Identifier: (BSD-3-Clause)
|
|---|
| 6 | !!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
|
|---|
| 7 |
|
|---|
| 8 | !Loop carried true dep between tmp =.. and ..= tmp.
|
|---|
| 9 | !Data race pair: tmp@48:16 vs. tmp@49:9
|
|---|
| 10 |
|
|---|
| 11 | program DRB036_truedepscalar_var_yes
|
|---|
| 12 | use omp_lib
|
|---|
| 13 | implicit none
|
|---|
| 14 |
|
|---|
| 15 | integer i, tmp, len, argCount, allocStatus, rdErr, ix
|
|---|
| 16 | character(len=80), dimension(:), allocatable :: args
|
|---|
| 17 | integer, dimension(:), allocatable :: a
|
|---|
| 18 |
|
|---|
| 19 | len = 100
|
|---|
| 20 | tmp = 10
|
|---|
| 21 |
|
|---|
| 22 | argCount = command_argument_count()
|
|---|
| 23 | if (argCount == 0) then
|
|---|
| 24 | write (*,'(a)') "No command line arguments provided."
|
|---|
| 25 | end if
|
|---|
| 26 |
|
|---|
| 27 | allocate(args(argCount), stat=allocStatus)
|
|---|
| 28 | if (allocStatus > 0) then
|
|---|
| 29 | write (*,'(a)') "Allocation error, program terminated."
|
|---|
| 30 | stop
|
|---|
| 31 | end if
|
|---|
| 32 |
|
|---|
| 33 | do ix = 1, argCount
|
|---|
| 34 | call get_command_argument(ix,args(ix))
|
|---|
| 35 | end do
|
|---|
| 36 |
|
|---|
| 37 | if (argCount >= 1) then
|
|---|
| 38 | read (args(1), '(i10)', iostat=rdErr) len
|
|---|
| 39 | if (rdErr /= 0 ) then
|
|---|
| 40 | write (*,'(a)') "Error, invalid integer value."
|
|---|
| 41 | end if
|
|---|
| 42 | end if
|
|---|
| 43 |
|
|---|
| 44 | allocate (a(len))
|
|---|
| 45 |
|
|---|
| 46 | !$omp parallel do
|
|---|
| 47 | do i = 1, len
|
|---|
| 48 | a(i) = tmp
|
|---|
| 49 | tmp = a(i) + i
|
|---|
| 50 | end do
|
|---|
| 51 | !$omp end parallel do
|
|---|
| 52 |
|
|---|
| 53 | deallocate(args,a)
|
|---|
| 54 | end program
|
|---|