2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / repeat_1.f90
blob1ac105c2e3cd6cfecbdc3ec0ae07339c5e436df9
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())
7 if (trim(str) /= "aaaa") call abort
8 write(str,"(a)") repeat ("a", i)
10 contains
12 integer function f()
13 integer :: x = 5
14 save x
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\\)" }