At some point, 'call abort()' was changed to 'stop'; this works fine as long as exit status is != 0. At least on my Linux system, this works until 255. (Which matches POSIX, which requires 8 bits.) For "stop 256", I get an exit status == 0.

I am not sure whether other systems break earlier, but I assume most support 0 to 255. Currently, gcc/testsuite/*fortran* has those maximal 'stop' counts:

127
127
144
174
192
240
1516 ! <-- this was patched.

In libgomp, the current record are 222 and 242. Hence, when adding extensive test cases, one needs to watch out!

Cheers,

Tobias

Index: gcc/testsuite/gfortran.dg/achar_2.f90
===================================================================
--- gcc/testsuite/gfortran.dg/achar_2.f90	(revision 277672)
+++ gcc/testsuite/gfortran.dg/achar_2.f90	(revision 277678)
@@ -2023,4 +2023,9 @@
   c = "ÿ"
   if (achar(i) /= "ÿ") STOP 1514
   if (iachar(c) /= iachar("ÿ")) STOP 1515
+  print *, 'DONE'
 end program main
+
+! DejaGNU only checks the exit code but 'STOP 256' has exit code 0. Hence,
+! check output for:
+! { dg-output "DONE" }

Reply via email to