Files
clang-p2996/flang/test/Driver/unparse-with-modules.f90
Peter Klausler e00a3ccf43 [flang] New -fdebug-unparse-with-modules option (#91660)
This option is a compilation action that parses a source file and
performs semantic analysis on it, like the existing -fdebug-unparse
option does. Its output, however, is preceded by the effective contents
of all of the non-intrinsic modules on which it depends but does not
define, transitively preceded by the closure of all of those modules'
dependencies.

The output from this option is therefore the analyzed parse tree for a
source file encapsulated with all of its non-intrinsic module
dependencies. This output may be useful for extracting code from large
applications for use as an attachment to a bug report, or as input to a
test case reduction tool for problem isolation.
2024-05-15 15:44:37 -07:00

35 lines
677 B
Fortran

! RUN: %flang_fc1 -I %S/Inputs/module-dir -fdebug-unparse-with-modules %s | FileCheck %s
module m1
use iso_fortran_env
use BasicTestModuleTwo
implicit none
type(t2) y
real(real32) x
end
program test
use m1
use BasicTestModuleTwo
implicit none
x = 123.
y = t2()
end
!CHECK-NOT: module iso_fortran_env
!CHECK: module basictestmoduletwo
!CHECK: type::t2
!CHECK: end type
!CHECK: end
!CHECK: module m1
!CHECK: use :: iso_fortran_env
!CHECK: implicit none
!CHECK: real(kind=real32) x
!CHECK: end module
!CHECK: program test
!CHECK: use :: m1
!CHECK: use :: basictestmoduletwo
!CHECK: implicit none
!CHECK: x = 123.
!CHECK: y = t2()
!CHECK: end program