[flang] Add test for quiet with local variable in STOP stmt

Depends on D118978.

Differential Revision: https://reviews.llvm.org/D118982
This commit is contained in:
Valentin Clement 2022-02-04 11:58:06 +01:00
parent 2c2e5a5d0f
commit 6518c40931
No known key found for this signature in database
GPG Key ID: 086D54783C928776
1 changed files with 13 additions and 0 deletions

View File

@ -38,3 +38,16 @@ subroutine stop_quiet_constant()
! CHECK: fir.call @_Fortran{{.*}}StopStatement(%[[c0]], %[[false]], %[[true]])
! CHECK-NEXT: fir.unreachable
end subroutine
! CHECK-LABEL stop_quiet
subroutine stop_quiet()
logical :: b
stop, quiet = b
! CHECK-DAG: %[[c0:.*]] = arith.constant 0 : i32
! CHECK-DAG: %[[false:.*]] = arith.constant false
! CHECK: %[[ALLOCA:.*]] = fir.alloca !fir.logical<4> {bindc_name = "b", uniq_name = "_QFstop_quietEb"}
! CHECK: %[[b:.*]] = fir.load %[[ALLOCA]]
! CHECK: %[[bi1:.*]] = fir.convert %[[b]] : (!fir.logical<4>) -> i1
! CHECK: fir.call @_Fortran{{.*}}StopStatement(%[[c0]], %[[false]], %[[bi1]])
! CHECK-NEXT: fir.unreachable
end subroutine