mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 04:06:46 +00:00

The previous code made the assumption that the defining operation is a fir::ConvertOp without checking. This results in segmentation fault in code like the added test. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D129077
12 lines
364 B
Fortran
12 lines
364 B
Fortran
! RUN: bbc -emit-fir %s -o - | FileCheck %s
|
|
|
|
program test_extent_from_triplet
|
|
implicit none
|
|
integer, parameter:: n = 3
|
|
INTEGER a(n), b(n), i
|
|
a = (/ 1, 2, 3 /)
|
|
b = (/ (sum(a(1:i)), i=1, n) /)
|
|
end program
|
|
|
|
! CHECK: %{{.*}} = fir.embox %{{.*}}(%{{.*}}) [%{{.*}}] : (!fir.ref<!fir.array<3xi32>>, !fir.shape<1>, !fir.slice<1>) -> !fir.box<!fir.array<?xi32>>
|