mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-24 20:44:09 +00:00
[Flang][OpenMP] Use the ultimate symbol in a call to the IsPointer function
The IsPointer check currently fails for host-associated symbols in OpenMP regions. This causes some failures in semantic checks for pointer association in an OpenMP region. Fix is to use the ultimate symbol in the call to the IsPointer function in CheckPointerAssignment function in lib/Semantics/pointer-assignment.cpp. Reviewed By: klausler, peixin Differential Revision: https://reviews.llvm.org/D112876
This commit is contained in:
parent
fe75d0c39c
commit
48dc5c8e73
@ -383,7 +383,7 @@ bool CheckPointerAssignment(evaluate::FoldingContext &context,
|
||||
if (!pointer) {
|
||||
return false; // error was reported
|
||||
}
|
||||
if (!IsPointer(*pointer)) {
|
||||
if (!IsPointer(pointer->GetUltimate())) {
|
||||
evaluate::SayWithDeclaration(context.messages(), *pointer,
|
||||
"'%s' is not a pointer"_err_en_US, pointer->name());
|
||||
return false;
|
||||
|
10
flang/test/Semantics/omp-private-is-pointer-check.f90
Normal file
10
flang/test/Semantics/omp-private-is-pointer-check.f90
Normal file
@ -0,0 +1,10 @@
|
||||
! RUN: %flang_fc1 -fopenmp -fsyntax-only %s
|
||||
|
||||
subroutine s
|
||||
integer, pointer :: p
|
||||
integer, target :: t
|
||||
|
||||
!$omp parallel private(p)
|
||||
p=>t
|
||||
!$omp end parallel
|
||||
end subroutine
|
Loading…
x
Reference in New Issue
Block a user