[test-suite] r328269 - Replace calls to 'system' with an error message and abort.
Michael Zolotukhin via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 22 16:26:32 PDT 2018
Author: mzolotukhin
Date: Thu Mar 22 16:26:32 2018
New Revision: 328269
URL: http://llvm.org/viewvc/llvm-project?rev=328269&view=rev
Log:
Replace calls to 'system' with an error message and abort.
Summary:
'system' is unavailable on iOS, which causes build failures. These
execution paths are probably never taken anyway (if we hit the abort,
then we'll need to revert this and disable it only on certain
platforms.)
Reviewers: cmatthews
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D44551
Modified:
test-suite/trunk/MultiSource/Applications/lua/loslib.c
test-suite/trunk/MultiSource/Applications/siod/slibu.c
test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt
test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt
test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/z03.c
test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/z40.c
test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/finalout.c
test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/assembler/assem.c
test-suite/trunk/MultiSource/Benchmarks/mafft/pairlocalalign.c
test-suite/trunk/MultiSource/Benchmarks/mafft/rna.c
Modified: test-suite/trunk/MultiSource/Applications/lua/loslib.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/lua/loslib.c?rev=328269&r1=328268&r2=328269&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Applications/lua/loslib.c (original)
+++ test-suite/trunk/MultiSource/Applications/lua/loslib.c Thu Mar 22 16:26:32 2018
@@ -36,7 +36,9 @@ static int os_pushresult (lua_State *L,
static int os_execute (lua_State *L) {
- lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+// lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
return 1;
}
Modified: test-suite/trunk/MultiSource/Applications/siod/slibu.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Applications/siod/slibu.c?rev=328269&r1=328268&r2=328269&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Applications/siod/slibu.c (original)
+++ test-suite/trunk/MultiSource/Applications/siod/slibu.c Thu Mar 22 16:26:32 2018
@@ -119,7 +119,10 @@ LISP lsystem(LISP args)
{int retval;
long iflag;
iflag = no_interrupt(1);
- retval = system(get_c_string(string_append(args)));
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+ retval = 0;
+// retval = system(get_c_string(string_append(args)));
no_interrupt(iflag);
if (retval < 0)
return(cons(flocons(retval),llast_c_errmsg(-1)));
Modified: test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C%2B%2B/HPCCG/CMakeLists.txt?rev=328269&r1=328268&r2=328269&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt (original)
+++ test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt Thu Mar 22 16:26:32 2018
@@ -1,4 +1,5 @@
set(PROG HPCCG)
+list(APPEND CXXFLAGS -DREDSTORM) # -DREDSTORM for mkdir
list(APPEND LDFLAGS -lm)
set(RUN_OPTIONS 50 50 50)
llvm_multisource()
Modified: test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C%2B%2B/miniFE/CMakeLists.txt?rev=328269&r1=328268&r2=328269&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt (original)
+++ test-suite/trunk/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt Thu Mar 22 16:26:32 2018
@@ -1,5 +1,5 @@
set(PROG miniFE)
-list(APPEND CXXFLAGS -I. -DMINIFE_SCALAR=double -DMINIFE_LOCAL_ORDINAL=int -DMINIFE_GLOBAL_ORDINAL=int -DMINIFE_CSR_MATRIX)
+list(APPEND CXXFLAGS -I. -DMINIFE_SCALAR=double -DMINIFE_LOCAL_ORDINAL=int -DMINIFE_GLOBAL_ORDINAL=int -DMINIFE_CSR_MATRIX -DREDSTORM) # -DREDSTORM for mkdir
list(APPEND LDFLAGS -lm)
set(RUN_OPTIONS -nx 64 -ny 64 -nz 64)
llvm_multisource()
Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/z03.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/z03.c?rev=328269&r1=328268&r2=328269&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/z03.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/z03.c Thu Mar 22 16:26:32 2018
@@ -844,7 +844,9 @@ OBJECT *full_name, FILE_POS *xfpos, BOOL
}
else
{
- system(buff);
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+// system(buff);
fp = fopen(LOUT_EPS, READ_TEXT);
*compressed = TRUE;
}
Modified: test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/z40.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/z40.c?rev=328269&r1=328268&r2=328269&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/z40.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/MiBench/consumer-typeset/z40.c Thu Mar 22 16:26:32 2018
@@ -149,7 +149,10 @@ OBJECT FilterExecute(OBJECT x, FULL_CHAR
else
{
/* execute the command, echo error messages, and exit if status problem */
- status = system( (char *) command);
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+ status = 0;
+// status = system( (char *) command);
err_fp = StringFOpen(FILTER_ERR, READ_TEXT);
if( err_fp != NULL )
{ while( fgets(line, MAX_LINE, err_fp) != NULL )
Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/finalout.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/finalout.c?rev=328269&r1=328268&r2=328269&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/finalout.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/finalout.c Thu Mar 22 16:26:32 2018
@@ -109,10 +109,12 @@ if( doCompaction > 0 ) {
redoFlag = 0 ;
addpins() ;
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
sprintf( command , "cp %s.cfs cfss1", cktName ) ;
- system( command ) ;
+// system( command ) ;
sprintf( command , "cp %s.cfb cfbb1", cktName ) ;
- system( command ) ;
+// system( command ) ;
for( c = 1 ; c <= doCompaction ; c++ ) {
@@ -206,10 +208,12 @@ if( doCompaction > 0 ) {
rmain() ;
redoFlag = 0 ;
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
sprintf( command , "cp %s.cfs cfss%d", cktName , c + 1) ;
- system( command ) ;
+// system( command ) ;
sprintf( command , "cp %s.cfb cfbb%d", cktName , c + 1) ;
- system( command ) ;
+// system( command ) ;
}
subpins() ;
fprintf(fpo,"\n\nCORE Bounding Box: l:%d r:%d b:%d t:%d\n\n",
Modified: test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/assembler/assem.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/assembler/assem.c?rev=328269&r1=328268&r2=328269&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/assembler/assem.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Prolangs-C/assembler/assem.c Thu Mar 22 16:26:32 2018
@@ -86,20 +86,12 @@ int main(int argc,char **argv)
/* -------------------------------- Delete the temporary output file */
if (!DEBUG_FLAG_1) {
- char *TEMP;
- TEMP = (char *) malloc((unsigned int)
- (4+strlen(TEMP_OUTPUT_FILE_NAME)));
- (void) sprintf(TEMP,"rm %s",TEMP_OUTPUT_FILE_NAME);
- (void) system(TEMP);
+ (void) remove(TEMP_OUTPUT_FILE_NAME);
}
/* -------------------------------- If errors, delete the object file */
if (ERROR) {
- char *TEMP;
- TEMP = (char *) malloc((unsigned int)
- (4+strlen(OBJECT_FILE)));
- (void) sprintf(TEMP,"rm %s",OBJECT_FILE);
- (void) system(TEMP);
+ (void) remove(OBJECT_FILE);
(void) printf("Errors detected. Deleted object file.\n");
}
}
Modified: test-suite/trunk/MultiSource/Benchmarks/mafft/pairlocalalign.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/mafft/pairlocalalign.c?rev=328269&r1=328268&r2=328269&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/mafft/pairlocalalign.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/mafft/pairlocalalign.c Thu Mar 22 16:26:32 2018
@@ -118,7 +118,10 @@ static void callfoldalign( int nseq, cha
fclose( fp );
sprintf( com, "env PATH=%s foldalign210 %s _foldalignin > _foldalignout ", whereispairalign, foldalignopt );
- res = system( com );
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+ res = 0;
+// res = system( com );
if( res )
{
fprintf( stderr, "Error in foldalign\n" );
@@ -152,7 +155,10 @@ static void calllara( int nseq, char **m
// fprintf( stderr, "calling LaRA\n" );
sprintf( com, "env PATH=%s:/bin:/usr/bin mafft_lara -i _larain -w _laraout -o _lara.params %s", whereispairalign, laraarg );
- res = system( com );
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+ res = 0;
+// res = system( com );
if( res )
{
fprintf( stderr, "Error in lara\n" );
@@ -306,7 +312,9 @@ static float callmxscarna_giving_bpp( ch
fprintf( fp, *bpp2++ );
fclose( fp );
- system( "tr -d '\\r' < _bpporg > _bpp" ); // for cygwin, wakaran
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+// system( "tr -d '\\r' < _bpporg > _bpp" ); // for cygwin, wakaran
t2u( *mseq1 );
t2u( *mseq2 );
@@ -324,10 +332,15 @@ static float callmxscarna_giving_bpp( ch
write1seq( fp, *mseq2 );
fclose( fp );
- system( "tr -d '\\r' < _mxscarnainorg > _mxscarnain" ); // for cygwin, wakaran
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+// system( "tr -d '\\r' < _mxscarnainorg > _mxscarnain" ); // for cygwin, wakaran
sprintf( com, "env PATH=%s mxscarnamod -readbpp _mxscarnain > _mxscarnaout 2>_dum", whereispairalign );
- res = system( com );
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+ res = 0;
+// res = system( com );
if( res )
{
fprintf( stderr, "Error in mxscarna\n" );
@@ -379,7 +392,10 @@ static float callmxscarna_slow( char **m
fclose( fp );
sprintf( com, "env PATH=%s mxscarnamod _mxscarnain > _mxscarnaout 2>_dum", whereispairalign );
- res = system( com );
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+ res = 0;
+// res = system( com );
if( res )
{
fprintf( stderr, "Error in mxscarna\n" );
Modified: test-suite/trunk/MultiSource/Benchmarks/mafft/rna.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/mafft/rna.c?rev=328269&r1=328268&r2=328269&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/mafft/rna.c (original)
+++ test-suite/trunk/MultiSource/Benchmarks/mafft/rna.c Thu Mar 22 16:26:32 2018
@@ -220,7 +220,9 @@ void rnaalifoldcall( char **seq, int nse
fclose( fp );
sprintf( cmd, "RNAalifold -p %s", fnamein );
- system( cmd );
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+// system( cmd );
fp = fopen( "alifold.out", "r" );
if( !fp )
@@ -280,7 +282,9 @@ void rnaalifoldcall( char **seq, int nse
}
fclose( fp );
sprintf( cmd, "rm -f %s", fnamein );
- system( cmd );
+ fprintf(stderr, "Cannot execute system calls!\n");
+ abort();
+// system( cmd );
for( i=0; i<lgth; i++ )
{
More information about the llvm-commits
mailing list