Our current implementation for extracting information about common block required traversal of FIR which was not ideal but previously there was no other way to obtain that information. The `[hl]fir.declare` was extended in commit https://github.com/llvm/llvm-project/pull/155325 to include storage and storage_offset. This commit adds these operands in `fircg.ext_declare` and then use them in `AddDebugInfoPass` to create debug data for common blocks.
21 lines
406 B
Fortran
21 lines
406 B
Fortran
! RUN: %flang_fc1 -emit-llvm -debug-info-kind=standalone %s -o - | FileCheck %s
|
|
|
|
! Test that module EQUIVALENCE does not generate DICommonBlock.
|
|
|
|
module data_module
|
|
real :: var1, var2
|
|
equivalence (var1, var2)
|
|
end module data_module
|
|
|
|
subroutine test_module_equiv
|
|
use data_module
|
|
var1 = 1.5
|
|
var2 = 2.5
|
|
end subroutine
|
|
|
|
program main
|
|
call test_module_equiv()
|
|
end program
|
|
|
|
! CHECK-NOT: DICommonBlock
|