| 1 |
! Test that dead code elimination after lowering does not merge |
| 2 |
! blocks. This test was added because block merging on the |
| 3 |
! code below created a block with a fir.shape<> block argument |
| 4 |
! which FIR codegen is not intended to support. |
| 5 |
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s |
| 6 |
|
| 7 |
subroutine test(res, selector, x1, x2, x3, x4, x5, x6, x7, x8) |
| 8 |
integer :: res |
| 9 |
character(*) :: selector |
| 10 |
real(8), dimension(7) :: x1, x2, x3, x4, x5, x6, x7, x8 |
| 11 |
interface |
| 12 |
integer function foo(x) |
| 13 |
real(8) :: x(:) |
| 14 |
end function |
| 15 |
end interface |
| 16 |
select case (selector) |
| 17 |
case ("01") |
| 18 |
res = foo(x1) |
| 19 |
res = foo(x1) |
| 20 |
case ("02") |
| 21 |
res = foo(x2) |
| 22 |
res = foo(x2) |
| 23 |
case ("03") |
| 24 |
res = foo(x3) |
| 25 |
res = foo(x3) |
| 26 |
case ("04") |
| 27 |
res = foo(x4) |
| 28 |
res = foo(x4) |
| 29 |
case ("05") |
| 30 |
res = foo(x5) |
| 31 |
res = foo(x5) |
| 32 |
case ("06") |
| 33 |
res = foo(x6) |
| 34 |
res = foo(x6) |
| 35 |
case ("07") |
| 36 |
res = foo(x7) |
| 37 |
res = foo(x7) |
| 38 |
case ("08") |
| 39 |
res = foo(x8) |
| 40 |
res = foo(x8) |
| 41 |
case default |
| 42 |
end select |
| 43 |
end subroutine |
| 44 |
! CHECK: fir.call @_QPfoo |
| 45 |
! CHECK: fir.call @_QPfoo |
| 46 |
! CHECK: fir.call @_QPfoo |
| 47 |
! CHECK: fir.call @_QPfoo |
| 48 |
! CHECK: fir.call @_QPfoo |
| 49 |
! CHECK: fir.call @_QPfoo |
| 50 |
! CHECK: fir.call @_QPfoo |
| 51 |
! CHECK: fir.call @_QPfoo |
| 52 |
! CHECK: fir.call @_QPfoo |
| 53 |
! CHECK: fir.call @_QPfoo |
| 54 |
! CHECK: fir.call @_QPfoo |
| 55 |
! CHECK: fir.call @_QPfoo |
| 56 |
! CHECK: fir.call @_QPfoo |
| 57 |
! CHECK: fir.call @_QPfoo |
| 58 |
! CHECK: fir.call @_QPfoo |
| 59 |
! CHECK: fir.call @_QPfoo |