xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.fortran/complex.f90 (revision 6881a4007f077b54e5f51159c52b9b25f57deb0d)
1*6881a400Schristos! Copyright 2007-2023 Free Software Foundation, Inc.
27d62b00eSchristos!
37d62b00eSchristos! This program is free software; you can redistribute it and/or modify
47d62b00eSchristos! it under the terms of the GNU General Public License as published by
57d62b00eSchristos! the Free Software Foundation; either version 3 of the License, or
67d62b00eSchristos! (at your option) any later version.
77d62b00eSchristos!
87d62b00eSchristos! This program is distributed in the hope that it will be useful,
97d62b00eSchristos! but WITHOUT ANY WARRANTY; without even the implied warranty of
107d62b00eSchristos! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
117d62b00eSchristos! GNU General Public License for more details.
127d62b00eSchristos!
137d62b00eSchristos! You should have received a copy of the GNU General Public License
147d62b00eSchristos! along with this program.  If not, see <http://www.gnu.org/licenses/>.
157d62b00eSchristos
167d62b00eSchristosprogram test_complex
177d62b00eSchristos  real*4 r4a, r4b
187d62b00eSchristos  real*8 r8a, r8b
197d62b00eSchristos  real*16 r16a, r16b
20*6881a400Schristos  integer ia, ib
217d62b00eSchristos
22*6881a400Schristos  complex c, ci
237d62b00eSchristos  complex(kind=4) c4
247d62b00eSchristos  complex(kind=8) c8
257d62b00eSchristos  double complex dc
267d62b00eSchristos  complex(kind=16) c16
277d62b00eSchristos
287d62b00eSchristos  r4a = 1000
297d62b00eSchristos  r4b = -50
307d62b00eSchristos  r8a = 321
317d62b00eSchristos  r8b = -22
327d62b00eSchristos  r16a = -874
337d62b00eSchristos  r16b = 19
34*6881a400Schristos  ia = -4
35*6881a400Schristos  ib = 12
367d62b00eSchristos
377d62b00eSchristos  c = cmplx(r4a,r4b)
387d62b00eSchristos  c4 = cmplx(r4a,r4b)
397d62b00eSchristos  c8 = cmplx(r8a, r8b)
407d62b00eSchristos  dc = cmplx(r8a, r8b)
417d62b00eSchristos  c16 = cmplx(r16a, r16b)
42*6881a400Schristos  ci = cmplx(ia, ib)
437d62b00eSchristos
447d62b00eSchristos  print *, c, c4, c8, dc, c16	! stop
457d62b00eSchristos  print *, r4a, r4b
467d62b00eSchristos  print *, r8a, r8b
477d62b00eSchristos  print *, r16a, r16b
48*6881a400Schristos  print *, ia, ib
497d62b00eSchristosend program test_complex
50