[flang-commits] [PATCH] D157521: [flang] Add two new semantics tests for `critical-construct`
Elliot Whitney via Phabricator via flang-commits
flang-commits at lists.llvm.org
Wed Aug 9 10:06:11 PDT 2023
ElliotWhitney created this revision.
ElliotWhitney added reviewers: ktras, rouson.
ElliotWhitney added projects: LLVM, Flang.
Herald added a subscriber: jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a project: All.
ElliotWhitney requested review of this revision.
Add two new semantics tests for `critical-construct` that test
addition standard conforming and non stardard conforming statements
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D157521
Files:
flang/test/Semantics/critical05.f90
flang/test/Semantics/critical06.f90
Index: flang/test/Semantics/critical06.f90
===================================================================
--- /dev/null
+++ flang/test/Semantics/critical06.f90
@@ -0,0 +1,12 @@
+! RUN: %python %S/test_errors.py %s %flang_fc1
+program testcriticalconstruct
+
+ Start_name_only: Critical
+ !ERROR: CRITICAL construct name required but missing
+ End critical !C1117 in the Fortran 2018 standard
+
+ critical
+ !ERROR: CRITICAL construct name unexpected
+ end critical end_name_only !C1117 in Fortran 2018 standard
+
+end program
Index: flang/test/Semantics/critical05.f90
===================================================================
--- /dev/null
+++ flang/test/Semantics/critical05.f90
@@ -0,0 +1,38 @@
+! RUN: %python %S/test_errors.py %s %flang_fc1
+program testcriticalconstruct
+ integer :: status
+ character(len=128) :: errormessage
+ integer :: total = 0
+ integer :: i
+
+ CRITICAL
+ END CRITICAL
+
+ Testname: Critical
+ End critical Testname
+
+ stat_variable: critical (STAT=status)
+ End critical stat_variable
+
+ errmsg_variable: critical (ERRMSG=errormessage)
+ End critical errmsg_variable
+
+ critical (ERRMSG=errormessage, STAT=status)
+ End critical
+
+ critical ()
+ end critical
+
+ critical (STAT=status)
+ do i = 1, this_image()
+ total = total + 1
+ end do
+ print *, "Total is: ", total
+ End critical
+
+ critical
+ 10 continue
+ GO TO 10
+ End critical
+
+end program testcriticalconstruct
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157521.548660.patch
Type: text/x-patch
Size: 1475 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230809/d16c2f7e/attachment-0001.bin>
More information about the flang-commits
mailing list