-ab702e73e56aefb3b77b8f8f42da94bc22143eeb
+5dd3eccc3b0758346f77bee3cdc3f6bd15de339b
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
+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
-// REQUIRED_ARGS: -c -Icompilable/extra-files
+// REQUIRED_ARGS: -Icompilable/extra-files
// EXTRA_SOURCES: b6395.d
+// EXTRA_FILES: extra-files/c6395.d
// 6395
// 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;
-// REQUIRED_ARGS: -c
// EXTRA_SOURCES: imports/test9436interp.d
// this is a dummy module for test 9436.
// 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()
{
// 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;
// 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;
// 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;
close $fdin
close $fdout
+ # Remove file once test is finished.
+ upvar 2 cleanup_extra_files cleanups
+ lappend cleanups $extra
+
return $extra
}
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]
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
# 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]"
}
}
- # Cleanup
+ # Cleanup test directory.
+ foreach srcfile $cleanup_extra_files {
+ file delete $subdir/$srcfile
+ }
file delete $filename
}
-// EXTRA_CPP_SOURCES: extra-files/cabi2.cpp
+// EXTRA_CPP_SOURCES: cabi2.cpp
import core.stdc.stdio;
import core.stdc.config;
-// EXTRA_CPP_SOURCES: extra-files/cpp_abi_tests.cpp
+// EXTRA_CPP_SOURCES: cpp_abi_tests.cpp
extern(C++) {
// PERMUTE_ARGS: -g
-// EXTRA_CPP_SOURCES: extra-files/cppb.cpp
+// EXTRA_CPP_SOURCES: cppb.cpp
import core.stdc.stdio;
import core.stdc.stdarg;
-// EXTRA_CPP_SOURCES: extra-files/externmangle.cpp
+// EXTRA_CPP_SOURCES: externmangle.cpp
extern(C++):
-// EXTRA_CPP_SOURCES: extra-files/externmangle2.cpp
+// EXTRA_CPP_SOURCES: externmangle2.cpp
version(Windows)
{
-// EXTRA_SOURCES: imports/ice10086x.d imports/ice10086y.d
+// EXTRA_SOURCES: imports/ice10086x.d
+// EXTRA_SOURCES: imports/ice10086y.d
import imports.ice10086x;
import imports.ice10086y;
-// EXTRA_SOURCES: imports/ice10086y.d imports/ice10086x.d
+// EXTRA_SOURCES: imports/ice10086y.d
+// EXTRA_SOURCES: imports/ice10086x.d
import imports.ice10086y;
import imports.ice10086x;
-// EXTRA_SOURCES: imports/ice4481a.d imports/ice4481b.d
+// EXTRA_SOURCES: imports/ice4481a.d
+// EXTRA_SOURCES: imports/ice4481b.d
import imports.ice4481a;
import imports.ice4481b;
-module imports.std12010container;
struct Array(T)
{
private struct Payload
// 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;
// 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.
// 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;
-// 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;
-// EXTRA_SOURCES: imports/test10736a.d imports/test10736b.d
+// EXTRA_SOURCES: imports/test10736a.d
+// EXTRA_SOURCES: imports/test10736b.d
import imports.test10736a;
import imports.test10736b;
// COMPILE_SEPARATELY
-// EXTRA_SOURCES: imports/std11863conv.d imports/std11863format.d
+// EXTRA_SOURCES: imports/std11863conv.d
+// EXTRA_FILES: imports/std11863format.d
import imports.std11863conv;
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);