Skip to content

Commit

Permalink
Minor improvements to kcc support.
Browse files Browse the repository at this point in the history
  • Loading branch information
regehr committed Aug 5, 2011
1 parent 02c05c0 commit 7dfe62f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/test_csmith.pl
Expand Up @@ -53,7 +53,7 @@

#######################################################################

my $HEADER = "-I${CSMITH_HOME}/runtime";
my $HEADER = "-I${CSMITH_HOME}/runtime -DCSMITH_MINIMAL";

# properly parse the return value from system()
sub runit ($$) {
Expand All @@ -79,8 +79,9 @@ ($)
sub run_test () {
my $cfile = "test.c";
my $ofile = "test.exe";
my $ofile_kcc = "test_kcc.exe";

system "rm -f $cfile";
system "rm -f $cfile $ofile $ofile_kcc";

my $CSMITH_OPTIONS = "";
if (rand()<0.5) { $CSMITH_OPTIONS .= " --quiet "; }
Expand Down Expand Up @@ -138,14 +139,14 @@ ()

if ($RUN_KCC) {

my $cmd3 = "kcc $cfile $HEADER -o $ofile";
my $cmd3 = "kcc $cfile $HEADER -o $ofile_kcc";
$res = runit ($cmd3, "csmith.out");
if ($res != 0 || !(-f $ofile)) {
if ($res != 0 || !(-f $ofile_kcc)) {
print "KCC failed to compile program generated by $cmd\n";
exit (-1);
}

my $cmd4 = "RunSafely.sh 600 1 /dev/null out.txt ./$ofile";
my $cmd4 = "RunSafely.sh 600 1 /dev/null out.txt ./$ofile_kcc";
$res = runit ($cmd4, "out2.txt");
if ($res != 0 && $res != 137) {
print "KCC output died with error code $res\n";
Expand Down

0 comments on commit 7dfe62f

Please sign in to comment.