Files
clang-p2996/flang/test/Lower/Intrinsics/command_argument_count.f90
Valentin Clement 2b55850df8 [flang] Lower command and environment intrinsics
This patch adds lowering for command and environment
related intrinsics:
- `get_command_argument`
- `get_environment_variable`
- `command_argument_count`

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D121909

Co-authored-by: Josh Mottley <Josh.Mottley@arm.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
2022-03-17 14:36:51 +01:00

12 lines
553 B
Fortran

! RUN: bbc -emit-fir %s -o - | FileCheck %s
! bbc doesn't have a way to set the default kinds so we use flang-new driver
! RUN: flang-new -fc1 -fdefault-integer-8 -emit-fir %s -o - | FileCheck --check-prefixes=CHECK,CHECK-64 %s
! CHECK-LABEL: argument_count_test
subroutine argument_count_test()
integer :: arg_count_test
arg_count_test = command_argument_count()
! CHECK: %[[argumentCount:.*]] = fir.call @_FortranAArgumentCount() : () -> i32
! CHECK-64: %{{[0-9]+}} = fir.convert %[[argumentCount]] : (i32) -> i64
end subroutine argument_count_test