Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gfortran.dg/repeat_1.f90 @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 84e7813d76e9 |
children |
rev | line source |
---|---|
111 | 1 ! { dg-do run } |
2 ! { dg-shouldfail "negative NCOPIES argument to REPEAT intrinsic" } | |
3 character(len=80) :: str | |
4 integer :: i | |
5 i = -1 | |
6 write(str,"(a)") repeat ("a", f()) | |
131 | 7 if (trim(str) /= "aaaa") STOP 1 |
111 | 8 write(str,"(a)") repeat ("a", i) |
9 | |
10 contains | |
11 | |
12 integer function f() | |
13 integer :: x = 5 | |
14 save x | |
15 | |
16 x = x - 1 | |
17 f = x | |
18 end function f | |
19 end | |
20 ! { dg-output "Fortran runtime error: Argument NCOPIES of REPEAT intrinsic is negative \\(its value is -1\\)" } |