From bdb0fe81d8918fd9a6427722656a738501a5b604 Mon Sep 17 00:00:00 2001 From: Jade Abraham Date: Wed, 6 Mar 2024 16:08:24 -0800 Subject: [PATCH] add prediff Signed-off-by: Jade Abraham --- test/studies/sinLUT/PREDIFF | 23 +++++++++++++++++++ test/studies/sinLUT/chplSin.good | 6 ++--- test/studies/sinLUT/chplSinBlock.good | 6 ++--- test/studies/sinLUT/chplSinReplicated.good | 6 ++--- .../sinLUT/chplSinReplicatedReplicand.good | 6 ++--- 5 files changed, 31 insertions(+), 16 deletions(-) create mode 100755 test/studies/sinLUT/PREDIFF diff --git a/test/studies/sinLUT/PREDIFF b/test/studies/sinLUT/PREDIFF new file mode 100755 index 000000000000..f396dcd4ee8b --- /dev/null +++ b/test/studies/sinLUT/PREDIFF @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +cp $2 $2.prediff.tmp +> $2 + +# check that Chapel Calculated == Chapel Lookup +calc=`sed '1q;d' $2.prediff.tmp | sed 's/.*: //'` +lookup=`sed '2q;d' $2.prediff.tmp | sed 's/.*: //'` +if [ "$calc" = "$lookup" ]; then + echo "Chapel Calculated == Chapel Lookup" >> $2 +else + echo "Chapel Calculated != Chapel Lookup" >> $2 +fi +# check that C Caclulated == C Lookup +calc=`sed '3q;d' $2.prediff.tmp | sed 's/.*: //'` +lookup=`sed '4q;d' $2.prediff.tmp | sed 's/.*: //'` +if [ "$calc" = "$lookup" ]; then + echo "C Calculated == C Lookup" >> $2 +else + echo "C Calculated != C Lookup" >> $2 +fi + +rm $2.prediff.tmp diff --git a/test/studies/sinLUT/chplSin.good b/test/studies/sinLUT/chplSin.good index b83798a01338..b3da301ebcb9 100644 --- a/test/studies/sinLUT/chplSin.good +++ b/test/studies/sinLUT/chplSin.good @@ -1,4 +1,2 @@ -Chapel Calculated: -1.2311 -Chapel Lookup: -1.2311 -C Calculated: -4.23134 -C Lookup: -4.23134 +Chapel Calculated == Chapel Lookup +C Calculated == C Lookup diff --git a/test/studies/sinLUT/chplSinBlock.good b/test/studies/sinLUT/chplSinBlock.good index b83798a01338..b3da301ebcb9 100644 --- a/test/studies/sinLUT/chplSinBlock.good +++ b/test/studies/sinLUT/chplSinBlock.good @@ -1,4 +1,2 @@ -Chapel Calculated: -1.2311 -Chapel Lookup: -1.2311 -C Calculated: -4.23134 -C Lookup: -4.23134 +Chapel Calculated == Chapel Lookup +C Calculated == C Lookup diff --git a/test/studies/sinLUT/chplSinReplicated.good b/test/studies/sinLUT/chplSinReplicated.good index b83798a01338..b3da301ebcb9 100644 --- a/test/studies/sinLUT/chplSinReplicated.good +++ b/test/studies/sinLUT/chplSinReplicated.good @@ -1,4 +1,2 @@ -Chapel Calculated: -1.2311 -Chapel Lookup: -1.2311 -C Calculated: -4.23134 -C Lookup: -4.23134 +Chapel Calculated == Chapel Lookup +C Calculated == C Lookup diff --git a/test/studies/sinLUT/chplSinReplicatedReplicand.good b/test/studies/sinLUT/chplSinReplicatedReplicand.good index b83798a01338..b3da301ebcb9 100644 --- a/test/studies/sinLUT/chplSinReplicatedReplicand.good +++ b/test/studies/sinLUT/chplSinReplicatedReplicand.good @@ -1,4 +1,2 @@ -Chapel Calculated: -1.2311 -Chapel Lookup: -1.2311 -C Calculated: -4.23134 -C Lookup: -4.23134 +Chapel Calculated == Chapel Lookup +C Calculated == C Lookup