llvm-project/flang/test/Lower/target_use.f90
Slava Zakharin ac76fa480f [flang] Represent TARGET for globals with 'target' attribute.
TARGET dummy arguments have fir.target attribute attached to them,
but globals do not have any sign of TARGET. This patch adds
target attribute for globals, which can be queried via
::fir::GlobalOp::getTarget().

Differential Revision: https://reviews.llvm.org/D135313
2022-10-06 19:14:28 -07:00

10 lines
270 B
Fortran

! RUN: bbc -emit-fir %S/target_definition.f90
! RUN: bbc -emit-fir %s -o - | FileCheck %s
! Test TARGET attributes on a declaration of a global symbol.
! CHECK: fir.global @_QMtarget_modEx target : f32
real function test()
use target_mod
test = x
end function test