>> > Please sort the letters (LC_ALL=C sort) and where consecutive, use ranges. >> > Thus \[0-9A-Zhjqvx-z\]*
OK, works fine with the attached patch, and looks cleaner in Make-lang.in. Now, with the proper email address for gcc-patches... I wonder how many time I'll be punished for typos. unmodified CL. Joost
Index: contrib/generate_tcl_patterns.sh =================================================================== --- contrib/generate_tcl_patterns.sh (revision 0) +++ contrib/generate_tcl_patterns.sh (revision 0) @@ -0,0 +1,108 @@ +#! /bin/sh + +# +# based on a list of filenames as input, +# generate regexps that match subsets trying to not exceed a +# 'maxcount' parameter. Most useful to generate the +# check_LANG_parallelize assignments needed to split +# testsuite directories, defining prefix appropriately. +# +# Example usage: +# cd gcc/gcc/testsuite/gfortran.dg +# ls -1 | ../../../contrib/generate_tcl_patterns.sh 300 "dg.exp=gfortran.dg/" +# +# the first parameter is the maximum number of files. +# the second parameter the prefix used for printing. +# + +# Copyright (C) 2014 Free Software Foundation +# Contributed by Joost VandeVondele <joost.vandevond...@mat.ethz.ch> +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GCC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. + +gawk -v maxcount=$1 -v prefix=$2 ' +BEGIN{ + # list of allowed starting chars for a file name in a dir to split + achars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + ranget="11111111112222222222222222222222222233333333333333333333333333" +} +{ + nfiles++ ; files[nfiles]=$1 +} +END{ + for(i=1; i<=length(achars); i++) count[substr(achars,i,1)]=0 + for(i=1; i<=nfiles; i++) { + if (length(files[i]>0)) { count[substr(files[i],1,1)]++ } + }; + asort(count,ordered) + countsingle=0 + groups=0 + label="" + for(i=length(achars);i>=1;i--) { + countsingle=countsingle+ordered[i] + for(j=1;j<=length(achars);j++) { + if(count[substr(achars,j,1)]==ordered[i]) found=substr(achars,j,1) + } + count[found]=-1 + label=label found + if(i==1) { val=maxcount+1 } else { val=ordered[i-1] } + if(countsingle+val>maxcount) { + subset[label]=countsingle + print "Adding label: ", label, "matching files:" countsingle + groups++ + countsingle=0 + label="" + } + } + print "patterns:" + asort(subset,ordered) + for(i=groups;i>=1;i--) { + for(j in subset){ + if(subset[j]==ordered[i]) found=j + } + subset[found]=-1 + if (length(found)==1) { + printf("%s%s* \\\n",prefix,found) + } else { + sortandcompress() + printf("%s\\[%s\\]* \\\n",prefix,found) + } + } +} +function sortandcompress(i,n,tmp,bestj) +{ + n=length(found) + for(i=1; i<=n; i++) tmp[i]=substr(found,i,1) + asort(tmp) + for(i=1;i<=n;i++){ + ipos=index(achars,tmp[i]) + for(j=i;j<=n;j++){ + jpos=index(achars,tmp[j]) + if (jpos-ipos==j-i && substr(ranget,ipos,1)==substr(ranget,jpos,1)) bestj=j + } + if (bestj-i>3) { + tmp[i+1]="-" + for(j=i+2;j<bestj;j++) tmp[j]=" " + } + i=bestj + } + found="" + for(i=1; i<=n; i++) found=found tmp[i] + gsub(/ /,"",found) +} +' Index: gcc/fortran/Make-lang.in =================================================================== --- gcc/fortran/Make-lang.in (revision 214949) +++ gcc/fortran/Make-lang.in (working copy) @@ -168,12 +168,22 @@ check-fortran-subtargets : check-gfortra lang_checks += check-gfortran lang_checks_parallelized += check-gfortran # For description see comment above check_gcc_parallelize in gcc/Makefile.in. -check_gfortran_parallelize = dg.exp=gfortran.dg/\[adAD\]* \ - dg.exp=gfortran.dg/\[bcBC\]* \ - dg.exp=gfortran.dg/\[nopNOP\]* \ - dg.exp=gfortran.dg/\[isuvISUV\]* \ - dg.exp=gfortran.dg/\[efhkqrxzEFHKQRXZ\]* \ - dg.exp=gfortran.dg/\[0-9gjlmtwyGJLMTWY\]* +check_gfortran_parallelize = execute.exp \ + dg.exp=gfortran.dg/p* \ + dg.exp=gfortran.dg/c* \ + dg.exp=gfortran.dg/a* \ + dg.exp=gfortran.dg/i* \ + dg.exp=gfortran.dg/\[glow\]* \ + dg.exp=gfortran.dg/\[mu\]* \ + dg.exp=gfortran.dg/d* \ + dg.exp=gfortran.dg/s* \ + dg.exp=gfortran.dg/b* \ + dg.exp=gfortran.dg/t* \ + dg.exp=gfortran.dg/f* \ + dg.exp=gfortran.dg/e* \ + dg.exp=gfortran.dg/r* \ + dg.exp=gfortran.dg/n* \ + dg.exp=gfortran.dg/\[0-9A-Zhjkqvxyz\]* # GFORTRAN documentation. GFORTRAN_TEXI = \