aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLéo Gourdin <leo.gourdin@univ-grenoble-alpes.fr>2021-06-09 23:54:07 +0200
committerLéo Gourdin <leo.gourdin@univ-grenoble-alpes.fr>2021-06-09 23:54:07 +0200
commitd703ae1ad5e1fcdc63e07b2a50a3e8576a11e61e (patch)
tree4b0e6ab85ab13e32c75f41945fd1792ee3902794 /test
parentf41baaa9cc0a9b715a7348568d5ccbb0cf76254f (diff)
downloadcompcert-kvx-d703ae1ad5e1fcdc63e07b2a50a3e8576a11e61e.tar.gz
compcert-kvx-d703ae1ad5e1fcdc63e07b2a50a3e8576a11e61e.zip
push afadl test example
Diffstat (limited to 'test')
-rwxr-xr-xtest/gourdinl/compare_pp.sh16
-rw-r--r--test/gourdinl/postpass_exp.c5
2 files changed, 21 insertions, 0 deletions
diff --git a/test/gourdinl/compare_pp.sh b/test/gourdinl/compare_pp.sh
new file mode 100755
index 00000000..09183cf9
--- /dev/null
+++ b/test/gourdinl/compare_pp.sh
@@ -0,0 +1,16 @@
+ffname=$(basename $1)
+fname=${ffname%.*}
+nopp=$fname.nopp.s
+pp=$fname.pp.s
+
+../../ccomp -fno-coalesce-mem -fno-postpass -S $1 -o $nopp
+../../ccomp -fno-coalesce-mem -fpostpass= list -S $1 -o $pp
+sed -i '1,2d' $nopp
+sed -i '1,2d' $pp
+if cmp -s $nopp $pp; then
+ echo "same!"
+else
+ echo "differents!"
+ diff -y $nopp $pp
+fi
+
diff --git a/test/gourdinl/postpass_exp.c b/test/gourdinl/postpass_exp.c
new file mode 100644
index 00000000..522ac2a6
--- /dev/null
+++ b/test/gourdinl/postpass_exp.c
@@ -0,0 +1,5 @@
+int main(int x, int y) {
+ int z = x << 32;
+ y = y - z;
+ return x + y;
+}