The device expression must evaluate to a non-negative integer value.
authorHarshil Jain <harshiljani2002@gmail.com>
Sun, 13 Feb 2022 11:18:59 +0000 (16:48 +0530)
committerNimish Mishra <neelam.nimish@gmail.com>
Sun, 13 Feb 2022 11:21:19 +0000 (16:51 +0530)
commitbea53eead1de84a28affc6a7cbf88f87a258fed4
tree2bcf054972dd6dd049ee83d593a233a1aa609eb3
parent446e7c64c7aa7e210dc3ce582e37d55d295e20ed
The device expression must evaluate to a non-negative integer value.

Device clause when it occurs with **target enter data** and **target exit data** must be declared with some non negative value. So some changes were made to evaluate the device clause argument to non negative value and throw the expected error when it takes negative value as argument.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D119141
flang/lib/Semantics/check-directive-structure.h
flang/lib/Semantics/check-omp-structure.cpp
flang/test/Semantics/omp-clause-validity01.f90
flang/test/Semantics/omp-device-constructs.f90