testsuite/gdc.test: Merge upstream dmd 5dd3eccc3
authorIain Buclaw <ibuclaw@gdcproject.org>
Sat, 30 Mar 2019 22:10:12 +0000 (22:10 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Sat, 30 Mar 2019 22:10:12 +0000 (22:10 +0000)
The D2 testsuite script has been updated to handle EXTRA_SOURCES and
EXTRA_FILES settings being split across multiple lines, which is how
they appear in upstream.

Reviewed-on: https://github.com/dlang/dmd/pull/9517

gcc/testsuite/ChangeLog:

2019-03-30  Iain Buclaw  <ibuclaw@gdcproject.org>

* gdc.test/gdc-test.exp (gdc-copy-extra): Append copied files to
cleanup_extra_files.
(dmd2dg): Copy additional files after test is processed.
(gdc-do-test): Remove all copied files after test.

From-SVN: r270038

26 files changed:
gcc/d/dmd/MERGE
gcc/testsuite/ChangeLog
gcc/testsuite/gdc.test/compilable/test6395.d
gcc/testsuite/gdc.test/compilable/test7190.d
gcc/testsuite/gdc.test/compilable/test9436.d
gcc/testsuite/gdc.test/compilable/testDIP37.d
gcc/testsuite/gdc.test/compilable/testDIP37_10302.d
gcc/testsuite/gdc.test/compilable/testDIP37_10354.d
gcc/testsuite/gdc.test/compilable/testDIP37_10421.d
gcc/testsuite/gdc.test/gdc-test.exp
gcc/testsuite/gdc.test/runnable/cabi1.d
gcc/testsuite/gdc.test/runnable/cpp_abi_tests.d
gcc/testsuite/gdc.test/runnable/cppa.d
gcc/testsuite/gdc.test/runnable/externmangle.d
gcc/testsuite/gdc.test/runnable/externmangle2.d
gcc/testsuite/gdc.test/runnable/ice10086a.d
gcc/testsuite/gdc.test/runnable/ice10086b.d
gcc/testsuite/gdc.test/runnable/ice4481.d
gcc/testsuite/gdc.test/runnable/imports/std12010container.d
gcc/testsuite/gdc.test/runnable/link11069b.d
gcc/testsuite/gdc.test/runnable/link12010.d
gcc/testsuite/gdc.test/runnable/link2644.d
gcc/testsuite/gdc.test/runnable/overload.d
gcc/testsuite/gdc.test/runnable/test10736.d
gcc/testsuite/gdc.test/runnable/test11863.d
gcc/testsuite/gdc.test/runnable/test42.d

index ffad6cb524d9b63b1265326cf752e4a4339164cb..31ea106965b57c11f2db675a7737d2d24e216dfe 100644 (file)
@@ -1,4 +1,4 @@
-ab702e73e56aefb3b77b8f8f42da94bc22143eeb
+5dd3eccc3b0758346f77bee3cdc3f6bd15de339b
 
 The first line of this file holds the git revision number of the last
 merge done from the dlang/dmd repository.
index 390ae076ac8ae3bd344397831ee0b6e0c85a0581..8c46400a1f366ef0c307ebed9cfaedec34bae366 100644 (file)
@@ -1,3 +1,10 @@
+2019-03-30  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       * gdc.test/gdc-test.exp (gdc-copy-extra): Append copied files to
+       cleanup_extra_files.
+       (dmd2dg): Copy additional files after test is translated.
+       (gdc-do-test): Remove all copied files after test.
+
 2019-03-30  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/89841
index 95f1a7eae6e3b146b4110080154e36e89a656621..a1bac8e48f1692660834b3994f447777d3088cd0 100644 (file)
@@ -1,5 +1,6 @@
-// REQUIRED_ARGS: -c -Icompilable/extra-files
+// REQUIRED_ARGS: -Icompilable/extra-files
 // EXTRA_SOURCES: b6395.d
+// EXTRA_FILES: extra-files/c6395.d
 
 // 6395
 
index 5143f55e7725c68bc961d2eae09b2bbbff1a6711..45344f13b8f27dd004799272f6c071271e7fffbb 100644 (file)
@@ -1,6 +1,9 @@
 // PERMUTE_ARGS:
 // REQUIRED_ARGS: -Icompilable/extra-files
-// EXTRA_FILES: extra-files/example7190/controllers/HomeController.d extra-files/example7190/models/HomeModel.d extra-files/serenity7190/core/Controller.d  extra-files/serenity7190/core/Model.d
+// EXTRA_FILES: extra-files/example7190/controllers/HomeController.d
+// EXTRA_FILES: extra-files/example7190/models/HomeModel.d
+// EXTRA_FILES: extra-files/serenity7190/core/Controller.d
+// EXTRA_FILES: extra-files/serenity7190/core/Model.d
 
 import example7190.controllers.HomeController;
 import example7190.models.HomeModel;
index c80bdc59e825505a240cf869032e120865abd0db..2baee7c216bb9ef41317329f394920346219c47f 100644 (file)
@@ -1,4 +1,3 @@
-// REQUIRED_ARGS: -c
 // EXTRA_SOURCES: imports/test9436interp.d
 
 // this is a dummy module for test 9436.
index a612365eaf4ef9bf84be6a2541bbc755732f7b9e..7188758414c8c06ca708f3b975e9939298116258 100644 (file)
@@ -1,6 +1,9 @@
 // PERMUTE_ARGS:
 // REQUIRED_ARGS: -Icompilable/extra-files
-// EXTRA_FILES: extra-files/pkgDIP37/datetime/package.d extra-files/pkgDIP37/datetime/common.d extra-files/pkgDIP37/test17629/package.di extra-files/pkgDIP37/test17629/common.di
+// EXTRA_FILES: extra-files/pkgDIP37/datetime/package.d
+// EXTRA_FILES: extra-files/pkgDIP37/datetime/common.d
+// EXTRA_FILES: extra-files/pkgDIP37/test17629/package.di
+// EXTRA_FILES: extra-files/pkgDIP37/test17629/common.di
 
 void test1()
 {
index 7e76595f06f9a818234d9aa8e4b355f318d77773..3c4a409b709090228de41bea691da5dc7e84adf4 100644 (file)
@@ -1,6 +1,7 @@
 // PERMUTE_ARGS:
-// REQUIRED_ARGS: -c -Icompilable/extra-files
-// EXTRA_SOURCES: extra-files/pkgDIP37_10302/liba.d extra-files/pkgDIP37_10302/libb.d
+// REQUIRED_ARGS: -Icompilable/extra-files
+// COMPILED_IMPORTS: extra-files/pkgDIP37_10302/liba.d
+// COMPILED_IMPORTS: extra-files/pkgDIP37_10302/libb.d
 // EXTRA_FILES: extra-files/pkgDIP37_10302/package.d
 
 module test;
index 2993fa94d391c732dee9209e6c1c4f92c2370edf..f9adf86307c0392f533e68c02271e6259e908155 100644 (file)
@@ -1,6 +1,8 @@
 // PERMUTE_ARGS:
 // REQUIRED_ARGS: -o- -Icompilable/extra-files
-// EXTRA_FILES: extra-files/pkgDIP37_10354/mbar.d extra-files/pkgDIP37_10354/mfoo.d extra-files/pkgDIP37_10354/package.d
+// EXTRA_FILES: extra-files/pkgDIP37_10354/mbar.d
+// EXTRA_FILES: extra-files/pkgDIP37_10354/mfoo.d
+// EXTRA_FILES: extra-files/pkgDIP37_10354/package.d
 
 module testDIP37_10354;
 import pkgDIP37_10354.mfoo;
index 859347331b19ccf3f2bd4699aaae3285f8de3d46..7da5bcf2d08f2b769b6a735860960151417868d8 100644 (file)
@@ -1,6 +1,8 @@
 // PERMUTE_ARGS:
 // REQUIRED_ARGS: -Icompilable/extra-files
-// COMPILED_IMPORTS: extra-files/pkgDIP37_10421/algo/package.d extra-files/pkgDIP37_10421/algo/mod.d extra-files/pkgDIP37_10421/except.d
+// COMPILED_IMPORTS: extra-files/pkgDIP37_10421/algo/package.d
+// COMPILED_IMPORTS: extra-files/pkgDIP37_10421/algo/mod.d
+// COMPILED_IMPORTS: extra-files/pkgDIP37_10421/except.d
 
 module testDIP37_10421;
 import pkgDIP37_10421.algo;
index 59abf74dc89a138579ca50194841da6b7c269189..ab8a4a3cfbdc217ebd16b45a583098f60989e14f 100644 (file)
@@ -153,6 +153,10 @@ proc gdc-copy-extra { base extra } {
     close $fdin
     close $fdout
 
+    # Remove file once test is finished.
+    upvar 2 cleanup_extra_files cleanups
+    lappend cleanups $extra
+
     return $extra
 }
 
@@ -184,6 +188,9 @@ proc dmd2dg { base test } {
     set PERMUTE_ARGS $DEFAULT_DFLAGS
     set GDC_EXECUTE_ARGS ""
 
+    set extra_sources ""
+    set extra_files ""
+
     # Split base, folder/file.
     set type [file dirname $test]
     set name [file tail $test]
@@ -230,46 +237,57 @@ proc dmd2dg { base test } {
            regsub -- {REQUIRED_ARGS.*$} $copy_line $new_option out_line
 
        } elseif [regexp -- {EXTRA_SOURCES\s*:\s*(.*)} $copy_line match sources] {
-           # Copy all sources to the testsuite build directory.
-           foreach import $sources {
-               # print "Import: $base $type/$import"
-               gdc-copy-extra $base "$type/$import"
+           # EXTRA_SOURCES are appended to extra_sources list
+           foreach srcfile $sources {
+               lappend extra_sources $srcfile
            }
-           set new_option "{ dg-additional-sources \"$sources\" }"
-           regsub -- {EXTRA_SOURCES.*$} $copy_line $new_option out_line
+           regsub -- {EXTRA_SOURCES.*$} $copy_line "" out_line
 
        } elseif [regexp -- {EXTRA_CPP_SOURCES\s*:\s*(.*)} $copy_line match sources] {
-           # Copy all sources to the testsuite build directory.
-           foreach import $sources {
-               # print "Import: $base $type/$import"
-               gdc-copy-extra $base "$type/$import"
+           # EXTRA_CPP_SOURCES are appended to extra_sources list
+           foreach srcfile $sources {
+               # C++ sources are found in the extra-files directory.
+               lappend extra_sources "extra-files/$srcfile"
            }
-           set new_option "{ dg-additional-sources \"$sources\" }"
-           regsub -- {EXTRA_CPP_SOURCES.*$} $copy_line $new_option out_line
+           regsub -- {EXTRA_CPP_SOURCES.*$} $copy_line "" out_line
 
        } elseif [regexp -- {EXTRA_FILES\s*:\s*(.*)} $copy_line match files] {
-           # Copy all files to the testsuite build directory.
-           foreach import $files {
-               # print "Import: $base $type/$import"
-               gdc-copy-extra $base "$type/$import"
+           # EXTRA_FILES are appended to extra_files list
+           foreach file $files {
+               lappend extra_files $file
            }
-           set new_option "{ dg-additional-files \"$files\" }"
-           regsub -- {EXTRA_FILES.*$} $copy_line $new_option out_line
+           regsub -- {EXTRA_FILES.*$} $copy_line "" out_line
 
        } elseif [regexp -- {COMPILED_IMPORTS\s*:\s*(.*)} $copy_line match sources] {
-           # Copy all sources to the testsuite build directory.
+           # COMPILED_IMPORTS are appended to extra_sources list
            foreach import $sources {
-               # print "Import: $base $type/$import"
-               gdc-copy-extra $base "$type/$import"
+               lappend extra_sources $import
            }
-           set new_option "{ dg-additional-sources \"$sources\" }"
-           regsub -- {COMPILED_IMPORTS.*$} $copy_line $new_option out_line
+           regsub -- {COMPILED_IMPORTS.*$} $copy_line "" out_line
 
        }
 
        puts $fdout $out_line
     }
 
+    # Now that all extra sources and files have been collected, copy them all
+    # to the testsuite build directory.
+    if { [llength $extra_sources] > 0 } {
+       foreach srcfile $extra_sources {
+           gdc-copy-extra $base "$type/$srcfile"
+       }
+       set out_line "// { dg-additional-sources \"$extra_sources\" }"
+       puts $fdout $out_line
+    }
+
+    if { [llength $extra_files] > 0 } {
+       foreach file $extra_files {
+           gdc-copy-extra $base "$type/$file"
+       }
+       set out_line "// { dg-additional-files \"$extra_files\" }"
+       puts $fdout $out_line
+    }
+
     # Add specific options for test type
 
     # DMD's testsuite is extremely verbose, compiler messages from constructs
@@ -387,6 +405,7 @@ proc gdc-do-test { } {
 
        # Convert to DG test.
        set imports [format "-I%s/%s" $base $dir]
+       set cleanup_extra_files ""
        # Include $subdir prefix so test names follow DejaGnu conventions.
        set filename "$subdir/[dmd2dg $base $dir/$name.$ext]"
 
@@ -430,7 +449,10 @@ proc gdc-do-test { } {
            }
        }
 
-       # Cleanup
+       # Cleanup test directory.
+       foreach srcfile $cleanup_extra_files {
+           file delete $subdir/$srcfile
+       }
        file delete $filename
     }
 
index b58e25ca5dcb93964522e31accd16c15a84de146..3a914cd0e57d05fc5eb0cfe5b1df2fe2848e16d3 100644 (file)
@@ -1,5 +1,5 @@
 
-// EXTRA_CPP_SOURCES: extra-files/cabi2.cpp
+// EXTRA_CPP_SOURCES: cabi2.cpp
 
 import core.stdc.stdio;
 import core.stdc.config;
index f0c0c097904cd3436308b8d4419cba0ff8dc17e9..83e1cff10d91cb0a369cfc6a6e4ae8a9362bfd2d 100644 (file)
@@ -1,4 +1,4 @@
-// EXTRA_CPP_SOURCES: extra-files/cpp_abi_tests.cpp
+// EXTRA_CPP_SOURCES: cpp_abi_tests.cpp
 
 extern(C++) {
 
index 6b2bafbe7bca64dbae464d31269dd81c6a73de92..b9b4832991e879008de2cec9455e87baa38c6e01 100644 (file)
@@ -1,5 +1,5 @@
 // PERMUTE_ARGS: -g
-// EXTRA_CPP_SOURCES: extra-files/cppb.cpp
+// EXTRA_CPP_SOURCES: cppb.cpp
 
 import core.stdc.stdio;
 import core.stdc.stdarg;
index bf80adafe0285648e73e6d9d3cf024ba9aaed413..9099f94f2d0aaa8e8cb8b50058c7ac45971aa688 100644 (file)
@@ -1,4 +1,4 @@
-// EXTRA_CPP_SOURCES: extra-files/externmangle.cpp
+// EXTRA_CPP_SOURCES: externmangle.cpp
 
 extern(C++):
 
index 7d87fbd67f33fd17e7b735f536bb66c1849295bd..74beb2581f0210bdc306e45be6215d55885aba82 100644 (file)
@@ -1,4 +1,4 @@
-// EXTRA_CPP_SOURCES: extra-files/externmangle2.cpp
+// EXTRA_CPP_SOURCES: externmangle2.cpp
 
 version(Windows)
 {
index c2f5ae6f729bf5c3f26fda8252525e94b1d01566..31a5b568b502b93452ec5412978b83a1b6863820 100644 (file)
@@ -1,4 +1,5 @@
-// EXTRA_SOURCES: imports/ice10086x.d imports/ice10086y.d
+// EXTRA_SOURCES: imports/ice10086x.d
+// EXTRA_SOURCES: imports/ice10086y.d
 
 import imports.ice10086x;
 import imports.ice10086y;
index 0dc64f84c163f9e2f144b7a5b1704b2ea6ee39bd..abb6f78a4acf5bbe7cdfa823d6a71442ee30d434 100644 (file)
@@ -1,4 +1,5 @@
-// EXTRA_SOURCES: imports/ice10086y.d imports/ice10086x.d
+// EXTRA_SOURCES: imports/ice10086y.d
+// EXTRA_SOURCES: imports/ice10086x.d
 
 import imports.ice10086y;
 import imports.ice10086x;
index 638d1518f60e04724fd271a9e78493aff03ebfd0..e1467963ee7d1602eeaf4700636713124502ae07 100644 (file)
@@ -1,4 +1,5 @@
-// EXTRA_SOURCES: imports/ice4481a.d imports/ice4481b.d
+// EXTRA_SOURCES: imports/ice4481a.d
+// EXTRA_SOURCES: imports/ice4481b.d
 
 import imports.ice4481a;
 import imports.ice4481b;
index a2288059927fc6dacfb9145700cbc7994c98f64f..1fe8aff14a9cce47b8fbf1fe24e26d33622830b8 100644 (file)
@@ -1,4 +1,3 @@
-module imports.std12010container;
 struct Array(T)
 {
     private struct Payload
index a6253504f98b201053ca935ef4b2ef7944eb811f..658f46eb51b008c1b8c173fb1b122e752cc4f2d5 100644 (file)
@@ -1,5 +1,7 @@
 // COMPILE_SEPARATELY
-// EXTRA_SOURCES: imports/link11069x.d imports/link11069y.d imports/link11069z.d
+// EXTRA_SOURCES: imports/link11069x.d
+// EXTRA_SOURCES: imports/link11069y.d
+// EXTRA_SOURCES: imports/link11069z.d
 
 import imports.link11069y;
 import imports.link11069z;
index 41fa719f799b7035c62b57cd4f282d6b94fbcdb5..49c4eb184b1f610f24a2a28b0781cec798ee4d05 100644 (file)
@@ -1,5 +1,6 @@
 // COMPILE_SEPARATELY
-// EXTRA_SOURCES: imports/a12010.d imports/std12010container.d
+// EXTRA_SOURCES: imports/a12010.d
+// EXTRA_FILES: imports/std12010container.d
 // REQUIRED_ARGS: -release
 // -release is necessary to avoid __assert.
 
index bf656f7ef81cda7d3acdafae3ad1178e603b8acd..f38b8cab8c2500796b8f096169e5d078148ac279 100644 (file)
@@ -1,5 +1,7 @@
 // PERMUTE_ARGS: -version=X -inline -release -g -O
-// EXTRA_SOURCES: imports/link2644a.d imports/link2644b.d imports/link2644c.d
+// EXTRA_SOURCES: imports/link2644a.d
+// EXTRA_SOURCES: imports/link2644b.d
+// EXTRA_SOURCES: imports/link2644c.d
 // COMPILE_SEPARATELY:
 
 module link2644;
index 73354281df494473b2d7a3e6b8efcb49a44a84be..f8fa7d5cdda2633d0265dd8fba745d602d4bad98 100644 (file)
@@ -1,4 +1,5 @@
-// EXTRA_SOURCES: imports/ovs1528a.d imports/ovs1528b.d imports/template_ovs1.d imports/template_ovs2.d imports/template_ovs3.d
+// EXTRA_SOURCES: imports/ovs1528a.d imports/ovs1528b.d
+// EXTRA_SOURCES: imports/template_ovs1.d imports/template_ovs2.d imports/template_ovs3.d
 
 import imports.template_ovs1;
 import imports.template_ovs2;
index 373b536129bfe563c79066164033680e4ab00cfd..55b6f539887f55b73fb828705efdcb334fd2f38d 100644 (file)
@@ -1,4 +1,5 @@
-// EXTRA_SOURCES: imports/test10736a.d imports/test10736b.d
+// EXTRA_SOURCES: imports/test10736a.d
+// EXTRA_SOURCES: imports/test10736b.d
 
 import imports.test10736a;
 import imports.test10736b;
index f42ac45d3487128dd10d9a77a0b28f039cc15069..c1285b3bef7e15199da4393d0903b1da33c167ba 100644 (file)
@@ -1,5 +1,6 @@
 // COMPILE_SEPARATELY
-// EXTRA_SOURCES: imports/std11863conv.d imports/std11863format.d
+// EXTRA_SOURCES: imports/std11863conv.d
+// EXTRA_FILES: imports/std11863format.d
 
 import imports.std11863conv;
 
index b9619c992ff15ea360409b99b0122723f6cb61d7..87ee7a8e73a20a692273e1a804473f5ed67fbf94 100644 (file)
@@ -5676,7 +5676,11 @@ void testreal_to_ulong()
     real adjust = 1.0L/real.epsilon;
     u = r2ulong(adjust);
     //writefln("%s %s", adjust, u);
-    static if(real.mant_dig == 64)
+    static if(real.mant_dig == 113)
+        assert(u == 18446744073709551615UL);
+    else static if(real.mant_dig == 106)
+        assert(u == 18446744073709551615UL);
+    else static if(real.mant_dig == 64)
         assert(u == 9223372036854775808UL);
     else static if(real.mant_dig == 53)
         assert(u == 4503599627370496UL);