summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ghdldrv/ghdllocal.adb12
-rw-r--r--src/ghdldrv/ghdllocal.ads5
-rwxr-xr-xtestsuite/gna/ticket87/testsuite.sh9
3 files changed, 11 insertions, 15 deletions
diff --git a/src/ghdldrv/ghdllocal.adb b/src/ghdldrv/ghdllocal.adb
index 8419715..bd4257c 100644
--- a/src/ghdldrv/ghdllocal.adb
+++ b/src/ghdldrv/ghdllocal.adb
@@ -564,19 +564,13 @@ package body Ghdllocal is
return String_Access
is
use Name_Table;
- Basename : constant String := Get_Base_Name (File);
begin
if In_Work then
- Image (Libraries.Work_Directory);
+ return new String'(Image (Libraries.Work_Directory)
+ & Get_Base_Name (File) & Suffix);
else
- Nam_Length := Nam_Buffer'First - 1;
+ return new String'(File & Suffix);
end if;
- Nam_Buffer (Nam_Length + 1 .. Nam_Length + Basename'Length) :=
- Basename;
- Nam_Length := Nam_Length + Basename'Length;
- Nam_Buffer (Nam_Length + 1 .. Nam_Length + Suffix'Length) := Suffix;
- Nam_Length := Nam_Length + Suffix'Length;
- return new String'(Nam_Buffer (1 .. Nam_Length));
end Append_Suffix;
diff --git a/src/ghdldrv/ghdllocal.ads b/src/ghdldrv/ghdllocal.ads
index b051aae..b744950 100644
--- a/src/ghdldrv/ghdllocal.ads
+++ b/src/ghdldrv/ghdllocal.ads
@@ -75,8 +75,9 @@ package Ghdllocal is
-- if none.
function Get_Basename_Pos (Pathname : String) return Natural;
- -- Build a filename based on FILE: append SUFFIX as extension, and
- -- if IN_WORK is true prepend the workdir.
+ -- Build a filename based on FILE. If IN_WORK is true, the result is
+ -- the concatenation of the workdir, the basename of FILE and SUFFIX.
+ -- If IN_WORK is false, the result is the concatenation of FILE and SUFFIX.
function Append_Suffix
(File : String; Suffix : String; In_Work : Boolean := True)
return String_Access;
diff --git a/testsuite/gna/ticket87/testsuite.sh b/testsuite/gna/ticket87/testsuite.sh
index 8e87fd9..c20ce29 100755
--- a/testsuite/gna/ticket87/testsuite.sh
+++ b/testsuite/gna/ticket87/testsuite.sh
@@ -2,16 +2,17 @@
. ../../testenv.sh
-mkdir dir1 dir2 || true
+mkdir dir1 dir2 dir3 || true
cd dir1
analyze ../hello.vhdl
-elab_simulate hello
+elab_simulate -v hello
+elab -v -o ../dir3/hello1 hello
cd ../dir2
-elab_simulate --workdir=../dir1 hello
+elab_simulate -v --workdir=../dir1 hello
cd ..
-rm -rf dir1 dir2
+rm -rf dir1 dir2 dir3 dir4
echo "Test successful"