This patch adds support for the `-emit-llvm` option in the frontend driver (i.e. `flang-new -fc1`). Similarly to Clang, `flang-new -fc1 -emit-llvm file.f` will generate a textual LLVM IR file. Depends on D118985 Differential Revision: https://reviews.llvm.org/D119012
23 lines
434 B
Fortran
23 lines
434 B
Fortran
! Test the `-emit-llvm` option
|
|
|
|
! UNSUPPORTED: system-windows
|
|
! Windows is currently not supported in flang/lib/Optimizer/CodeGen/Target.cpp
|
|
|
|
!------------
|
|
! RUN COMMAND
|
|
!------------
|
|
! RUN: %flang_fc1 -emit-llvm %s -o - | FileCheck %s
|
|
|
|
!----------------
|
|
! EXPECTED OUTPUT
|
|
!----------------
|
|
! CHECK: ; ModuleID = 'FIRModule'
|
|
! CHECK: define void @_QQmain()
|
|
! CHECK-NEXT: ret void
|
|
! CHECK-NEXT: }
|
|
|
|
!------
|
|
! INPUT
|
|
!------
|
|
end program
|