aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorCabrera, Anthony <cabreraam@ornl.gov>2022-12-13 14:48:25 -0500
committercabreraam <cabreraam33@gmail.com>2022-12-13 15:28:15 -0500
commit9c87746de7cdbb2b60a3fc274831aee43ddd9b7c (patch)
tree1d88cf09c3ad9ec3924765e6e82a66d62740b1cc /llvm/lib/Object/MachOObjectFile.cpp
parent9144ee6edf41acdfdf5912b26ad66c4953276528 (diff)
downloadllvm-9c87746de7cdbb2b60a3fc274831aee43ddd9b7c.zip
llvm-9c87746de7cdbb2b60a3fc274831aee43ddd9b7c.tar.gz
llvm-9c87746de7cdbb2b60a3fc274831aee43ddd9b7c.tar.bz2
[flang] emit warning when encountering a non-variable actual argument when its corresponding dummy argument expects a VOLATILE variable
This patch implements @klausler's suggestion in `llvm-project` [issue #58973](https://github.com/llvm/llvm-project/issues/58973); encountering the `VOLATILE` attribute should produce a __warning__, not a __fatal error__. When tested on the following Fortran program `snem0601_012_.f90`: ```fortran module mod contains subroutine sub(m6,error) integer,intent(inout) :: error integer,volatile :: m6 if (any ((/m6/).ne.(/6/))) & & then error = 1 end if end subroutine end module program fe1nvol12 use mod integer :: error = 0 call sub(6,error) if (error .ne. 0) then print *,'NG: snem0601_012' end if print *,'pass: snem0601_012' end program fe1nvol12 ``` the following output is produced: ```bash $ flang-new -fc1 snem0601_012_.f90 /noback/93u/Sandbox/issue_58973_volatile_dummy_arg/snem0601_012_.f90:21:12: warning: actual argument associated with VOLATILE dummy argument 'm6=' is not a variable call sub(6,error) ^ ``` Reviewed By: clementval, klausler Differential Revision: https://reviews.llvm.org/D139134
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions