llvm-project/flang/test/Lower/target_definition.f90
Mats Petersson 43cf32a1c0 [flang]Zero Initialize simple types
Instead of filling uninitialized global variables with "undef",
initialize them with 0. Only for Integer, Float or Logical type
variables. Complex, user defined data structures, arrays, etc
are not supported at this point.

This patch fixes the main problem of
https://github.com/llvm/llvm-project/issues/62432

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D149877
2023-05-05 17:37:41 +01:00

12 lines
315 B
Fortran

! RUN: bbc -emit-fir %s -o - | FileCheck %s
! Test TARGET attributes on a definition of a global symbol.
! CHECK: fir.global @_QMtarget_modEx target : f32 {
! CHECK: %[[init:.*]] = fir.zero_bits f32
! CHECK: fir.has_value %[[init]] : f32
! CHECK: }
module target_mod
real, target :: x
end module target_mod