diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-01-09 08:39:55 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-01-09 09:17:51 +0100 |
commit | 450483c01607d3032d65e9a7dd9d3f3215697b72 (patch) | |
tree | 975bc0fbefa909b1f79e410af51f9a3c7816cd55 /testsuite/gna/bug0120 | |
parent | 3064b81281132863c0597aa5b14b6bde487253b1 (diff) | |
download | ghdl-450483c01607d3032d65e9a7dd9d3f3215697b72.tar.gz ghdl-450483c01607d3032d65e9a7dd9d3f3215697b72.tar.bz2 ghdl-450483c01607d3032d65e9a7dd9d3f3215697b72.zip |
testsuite/gna: add a test for fmt command
Diffstat (limited to 'testsuite/gna/bug0120')
-rw-r--r-- | testsuite/gna/bug0120/print1.ref | 25 | ||||
-rw-r--r-- | testsuite/gna/bug0120/print1.vhdl | 25 | ||||
-rw-r--r-- | testsuite/gna/bug0120/print2.ref | 1 | ||||
-rwxr-xr-x | testsuite/gna/bug0120/testsuite.sh | 11 |
4 files changed, 62 insertions, 0 deletions
diff --git a/testsuite/gna/bug0120/print1.ref b/testsuite/gna/bug0120/print1.ref new file mode 100644 index 000000000..6a16467fe --- /dev/null +++ b/testsuite/gna/bug0120/print1.ref @@ -0,0 +1,25 @@ +entity print1 is +end; + +architecture behav of print1 is + -- Check comment 1 + -- Check comment 2 + + -- Check long declaration indentation + constant bv1: bit_vector := + "0010001"; + constant bv2: bit_vector := x"af"; + -- Trailing comment +begin + /* A long comment + for vhdl 08 + */ + + process + begin + if (true /= false) + then + report "OK"; + end if; + end process; +end behav; diff --git a/testsuite/gna/bug0120/print1.vhdl b/testsuite/gna/bug0120/print1.vhdl new file mode 100644 index 000000000..39e74c973 --- /dev/null +++ b/testsuite/gna/bug0120/print1.vhdl @@ -0,0 +1,25 @@ +entity print1 is +end; + +architecture behav of print1 is + -- Check comment 1 + -- Check comment 2 + + -- Check long declaration indentation + constant bv1 : bit_vector := + "0010001"; +constant bv2 : bit_vector := x"af"; + -- Trailing comment +begin + /* A long comment + for vhdl 08 + */ + + process + begin + if(true/=false) + then + report "OK"; + end if; + end process; +end behav; diff --git a/testsuite/gna/bug0120/print2.ref b/testsuite/gna/bug0120/print2.ref new file mode 100644 index 000000000..16f27b1a6 --- /dev/null +++ b/testsuite/gna/bug0120/print2.ref @@ -0,0 +1 @@ + "0010001"; diff --git a/testsuite/gna/bug0120/testsuite.sh b/testsuite/gna/bug0120/testsuite.sh new file mode 100755 index 000000000..dc4eed9b0 --- /dev/null +++ b/testsuite/gna/bug0120/testsuite.sh @@ -0,0 +1,11 @@ +#! /bin/sh + +. ../../testenv.sh + +$GHDL fmt --std=08 --level=space print1.vhdl > print1.out +diff --strip-trailing-cr print1.ref print1.out + +$GHDL fmt --std=08 --range=10:10 print1.vhdl > print2.out +diff --strip-trailing-cr print2.ref print2.out + +echo "Test successful" |