diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-18 09:37:27 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-18 09:37:27 +0000 |
commit | aa382e076ba206cc137f58753ab1b52cb2bb1896 (patch) | |
tree | 3d1bd0cb1bdbea14ebd7b6980805ad7ecaa56c6a /gcc/testsuite | |
parent | fff0da258cb16723d30dbc8a1238940dc12f7bd6 (diff) | |
download | gcc-aa382e076ba206cc137f58753ab1b52cb2bb1896.tar.gz |
2011-03-18 Basile Starynkevitch <basile@starynkevitch.net>
* gcc/testsuite/melt/tgcissue-pv-1run.sh: New script.
* testsuite/melt/tgcissue-pv-1m.melt: Rename everything as tgcissue.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@171128 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/melt/tgcissue-pv-1m.melt | 41 | ||||
-rwxr-xr-x | gcc/testsuite/melt/tgcissue-pv-1run.sh | 59 |
2 files changed, 80 insertions, 20 deletions
diff --git a/gcc/testsuite/melt/tgcissue-pv-1m.melt b/gcc/testsuite/melt/tgcissue-pv-1m.melt index 2314feeeb1c..902a058920d 100644 --- a/gcc/testsuite/melt/tgcissue-pv-1m.melt +++ b/gcc/testsuite/melt/tgcissue-pv-1m.melt @@ -7,43 +7,44 @@ ;; transtate first this file with #| ./cc1 -fmelt-module-path=melt-modules -fmelt-source-path=melt-sources \ - -O2 -c -fmelt-mode=translatetomodule \ - -fmelt-arg=$GCCMELT_SOURCE/gcc/testsuite/melt/tgcissue-pv-1m.melt + -fmelt-mode=translatetomodule \ + -fmelt-arg=$GCCMELT_SOURCE/gcc/testsuite/melt/tgcissue-pv-1m.melt \ + empty-file-for-melt.c |# ;; then run the tgcissue-pv-1c.c test file ;;; trivial gate function -(defun tgissue_gate (pass) - (debug_msg pass "tgissue_gate pass") +(defun tgcissue_gate (pass) + (debug_msg pass "tgcissue_gate pass") (return :true)) ;; trivial exec function -(defun tgissue_exec (pass) - (debug_msg pass "tgissue_exec pass") +(defun tgcissue_exec (pass) + (debug_msg pass "tgcissue_exec pass") (return :true) ) -(defun tgissue_docmd (cmd moduldata) - (let ( (tgissue_pass +(defun tgcissue_docmd (cmd moduldata) + (let ( (tgcissue_pass (instance class_gcc_gimple_pass - :named_name '"tgissue_pass" - :gccpass_gate tgissue_gate - :gccpass_exec tgissue_exec + :named_name '"tgcissue_pass" + :gccpass_gate tgcissue_gate + :gccpass_exec tgcissue_exec )) ) - (debug_msg tgissue_pass "tgissue_docmd tgissue_pass") - (install_melt_gcc_pass tgissue_pass "after" "phiopt" 0) - (return tgissue_pass) + (debug_msg tgcissue_pass "tgcissue_docmd tgcissue_pass") + (install_melt_gcc_pass tgcissue_pass "after" "phiopt" 0) + (return tgcissue_pass) )) -;; we would like to call directly (tgissue_docmd) but for strange reasons it is called but the pass does not happen. +;; we would like to call directly (tgcissue_docmd) but for strange reasons it is called but the pass does not happen. ;; so we have to install a mode -(definstance tgissue_mod +(definstance tgcissue_mode class_melt_mode :named_name '"tgcissue" - :meltmode_help '"tgissue test" - :meltmode_fun tgissue_docmd + :meltmode_help '"tgcissue test" + :meltmode_fun tgcissue_docmd ) -(install_melt_mode tgissue_mod) -;;; eof tgissue-pv-1m.melt +(install_melt_mode tgcissue_mode) +;;; eof tgcissue-pv-1m.melt diff --git a/gcc/testsuite/melt/tgcissue-pv-1run.sh b/gcc/testsuite/melt/tgcissue-pv-1run.sh new file mode 100755 index 00000000000..2fa65739908 --- /dev/null +++ b/gcc/testsuite/melt/tgcissue-pv-1run.sh @@ -0,0 +1,59 @@ +#! /bin/bash +# file tgcissue-pv-1run.sh +# to be run from $GCCMELT_BUILD/gcc +if [ ! -x ./cc1 ]; then + echo no ./cc1 file in $PWD >&2 + exit 1 +fi + +if [ ! -d melt-modules -o ! -d melt-sources ]; then + echo no directories melt-modules or melt-sources in $PWD >&2 + exit 1 +fi + +if [ ! -d "$GCCMELT_SOURCE" ]; then + echo Bad GCCMELT_SOURCE= "$GCCMELT_SOURCE" >&2 + exit 1 +fi + +if [ ! -d "$GCCMELT_BUILD" ]; then + echo Bad GCCMELT_BUILD= "$GCCMELT_BUILD" >&2 + exit 1 +fi + +if [ ! -f "$GCCMELT_SOURCE/gcc/testsuite/melt/tgcissue-pv-1c.c" ]; then + echo missing $GCCMELT_SOURCE/gcc/testsuite/melt/tgcissue-pv-1c.c >&2 + exit 1 +fi + +if [ ! -f "$GCCMELT_SOURCE/gcc/testsuite/melt/tgcissue-pv-1m.melt" ]; then + echo missing $GCCMELT_SOURCE/gcc/testsuite/melt/tgcissue-pv-1m.melt >&2 + exit 1 +fi + +rm -vf tgcissue-pv-1c.* +rm -vf tgcissue-pv-1m.* + +ln -sv "$GCCMELT_SOURCE/gcc/testsuite/melt/tgcissue-pv-1c.c" . +ln -sv "$GCCMELT_SOURCE/gcc/testsuite/melt/tgcissue-pv-1m.melt" . + +echo translation of tgcissue-pv-1m.melt to a MELT module +cc1args=( -fmelt-module-path=melt-modules -fmelt-source-path=melt-sources \ + -fmelt-mode=translatetomodule -fmelt-arg=tgcissue-pv-1m.melt \ + empty-file-for-melt.c) +echo running ./cc1 ${cc1args[@]} +./cc1 ${cc1args[@]} +if [ ! -f tgcissue-pv-1m.so ]; then + echo no generated MELT module tgcissue-pv-1m.so in $PWD >&2 + exit 1 +fi + +echo after translation of tgcissue-pv-1m.melt + + +cc1args=( -fmelt-module-path=.:melt-modules -fmelt-source-path=.:melt-sources \ + -fmelt-init=@@:tgcissue-pv-1m \ + -O2 -v -fmelt-mode=tgcissue \ + tgcissue-pv-1c.c) +echo running ./cc1 ${cc1args[@]} +./cc1 ${cc1args[@]} |