From: Jakub Jelinek <jakub@redhat.com>
To: Chung-Lin Tang <cltang@codesourcery.com>
Cc: Tobias Burnus <tobias@codesourcery.com>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: [committed] testsuite: Fix up gfortran.dg/gomp/strictly*.f90 testcases
Date: Thu, 21 Oct 2021 11:19:46 +0200 [thread overview]
Message-ID: <20211021091946.GF304296@tucnak> (raw)
In-Reply-To: <fd79ecbe-1f05-c7d8-6708-b4b34db41408@codesourcery.com>
Hi!
I meant it in the other testcases too:
While these testcases are dg-do compile only, I think it is better not to
give users bad examples and avoid unnecessary data races in testcases (unless
it is exactly what we want to test). Perhaps one day we'll do some analysis
and warn about data races...
Tested on x86_64-linux, committed to trunk.
2021-10-21 Jakub Jelinek <jakub@redhat.com>
* gfortran.dg/gomp/strictly-structured-block-1.f90: Use call do_work
instead of x = x + 1 in places where the latter could be a data race.
* gfortran.dg/gomp/strictly-structured-block-2.f90: Likewise.
* gfortran.dg/gomp/strictly-structured-block-3.f90: Likewise.
--- gcc/testsuite/gfortran.dg/gomp/strictly-structured-block-1.f90.jj 2021-10-21 10:23:27.544833287 +0200
+++ gcc/testsuite/gfortran.dg/gomp/strictly-structured-block-1.f90 2021-10-21 11:03:41.146041455 +0200
@@ -9,23 +9,23 @@ program main
!$omp parallel
block
- x = x + 1
+ call do_work
end block
!$omp parallel
block
- x = x + 1
+ call do_work
end block
!$omp end parallel
!$omp teams
block
- x = x + 1
+ call do_work
end block
!$omp teams
block
- x = x + 1
+ call do_work
end block
!$omp end teams
@@ -42,12 +42,12 @@ program main
!$omp scope
block
- x = x + 1
+ call do_work
end block
!$omp scope
block
- x = x + 1
+ call do_work
end block
!$omp end scope
@@ -75,12 +75,12 @@ program main
!$omp task
block
- x = x + 1
+ call do_work
end block
!$omp task
block
- x = x + 1
+ call do_work
end block
!$omp end task
@@ -130,23 +130,23 @@ program main
!$omp target parallel
block
- x = x + 1
+ call do_work
end block
!$omp target parallel
block
- x = x + 1
+ call do_work
end block
!$omp end target parallel
!$omp target teams
block
- x = x + 1
+ call do_work
end block
!$omp target teams
block
- x = x + 1
+ call do_work
end block
!$omp end target teams
@@ -176,7 +176,7 @@ program main
do i = 1, n
!$omp ordered
block
- x = x + 1
+ call do_work
end block
end do
@@ -184,7 +184,7 @@ program main
do i = 1, n
!$omp ordered
block
- x = x + 1
+ call do_work
end block
!$omp end ordered
end do
--- gcc/testsuite/gfortran.dg/gomp/strictly-structured-block-2.f90.jj 2021-10-21 10:23:27.544833287 +0200
+++ gcc/testsuite/gfortran.dg/gomp/strictly-structured-block-2.f90 2021-10-21 11:05:04.326876447 +0200
@@ -9,16 +9,16 @@ program main
!$omp parallel
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end parallel ! { dg-error "Unexpected !.OMP END PARALLEL statement" }
!$omp teams
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end teams ! { dg-error "Unexpected !.OMP END TEAMS statement" }
!$omp masked
@@ -30,9 +30,9 @@ program main
!$omp scope
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end scope ! { dg-error "Unexpected !.OMP END SCOPE statement" }
!$omp single
@@ -51,9 +51,9 @@ program main
!$omp task
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end task ! { dg-error "Unexpected !.OMP END TASK statement" }
!$omp target data map(x)
@@ -86,16 +86,16 @@ program main
!$omp target parallel
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end target parallel ! { dg-error "Unexpected !.OMP END TARGET PARALLEL statement" }
!$omp target teams
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end target teams ! { dg-error "Unexpected !.OMP END TARGET TEAMS statement" }
!$omp critical
@@ -116,9 +116,9 @@ program main
do i = 1, n
!$omp ordered
block
- x = x + 1
+ call do_work
end block
- x = x + 1
+ call do_work
!$omp end ordered ! { dg-error "Unexpected !.OMP END ORDERED statement" }
end do
--- gcc/testsuite/gfortran.dg/gomp/strictly-structured-block-3.f90.jj 2021-10-21 10:23:27.544833287 +0200
+++ gcc/testsuite/gfortran.dg/gomp/strictly-structured-block-3.f90 2021-10-21 11:07:21.441956054 +0200
@@ -10,7 +10,7 @@ program main
!$omp parallel
!$omp parallel
block
- x = x + 1
+ call do_work
end block
!$omp end parallel
!$omp end parallel
@@ -32,7 +32,7 @@ program main
end block
x = x + 2
!$omp section
- x = x + 4
+ call do_work
end block
!$omp sections
Jakub
prev parent reply other threads:[~2021-10-21 9:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-07 13:59 [PATCH, OpenMP 5.1, Fortran] Strictly-structured block support for OpenMP directives Chung-Lin Tang
2021-10-07 16:33 ` Tobias Burnus
2021-10-07 17:09 ` Jakub Jelinek
2021-10-08 16:14 ` [PATCH] openmp: Add support for OpenMP 5.1 structured-block-sequences Jakub Jelinek
2021-10-14 10:20 ` [PATCH, OpenMP 5.1, Fortran] Strictly-structured block support for OpenMP directives Jakub Jelinek
2021-10-14 11:19 ` Jakub Jelinek
2021-10-15 18:44 ` Chung-Lin Tang
2021-10-15 19:02 ` Jakub Jelinek
2021-10-20 12:30 ` [PATCH, v2, OpenMP 5.2, " Chung-Lin Tang
2021-10-20 16:15 ` Jakub Jelinek
2021-10-21 7:00 ` Chung-Lin Tang
2021-10-21 9:19 ` Jakub Jelinek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211021091946.GF304296@tucnak \
--to=jakub@redhat.com \
--cc=cltang@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=tobias@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).