aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr78033.f90
blob: 959352166a3eaee78380bb4a6f843e2a96bf70e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do compile }
subroutine f(n, x, y)

   implicit none

   integer, parameter :: knd = kind(1.e0)

   integer, intent(in) :: n
   complex(knd), intent(in) :: x(1:n)

   integer i
   real(knd) y(2*n)
   
   y = [real(x), aimag(x)]
   y = [real(x(1:n)), aimag(x(1:n))]
   y = [real(knd) :: 1] 
   y = [real(kind=42) :: 1] ! { dg-error "Invalid type-spec" }
   y = [real(kind=knd) :: 1]
   y = [real(kind=knd, a=1.)]
   y = [real(a=1.)]
   y = [real(a=1, kind=knd)]

end subroutine f