From 6b542899c41f8dafda07c01105ba0616984ec791 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 8 Dec 2023 07:26:50 +0200 Subject: Re-enable modules tests for MSVC and drop workarounds for old bugs --- tests/cc/modules/common.testscript | 3 ++- tests/cc/modules/modules.testscript | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) (limited to 'tests/cc') diff --git a/tests/cc/modules/common.testscript b/tests/cc/modules/common.testscript index f2e107f..801cf02 100644 --- a/tests/cc/modules/common.testscript +++ b/tests/cc/modules/common.testscript @@ -25,7 +25,8 @@ cxx.features.symexport = true # Note: there are some issues with enabling modules in Apple Clang 15 so # for now we only test vanilla Clang. # -if ($cxx.id == 'gcc' || \ +if ($cxx.id == 'gcc' || \ + $cxx.id == 'msvc' || \ ($cxx.id == 'clang' && $cxx.version.major >= 16)) cxx.features.modules = true diff --git a/tests/cc/modules/modules.testscript b/tests/cc/modules/modules.testscript index 7e860fd..c286c1f 100644 --- a/tests/cc/modules/modules.testscript +++ b/tests/cc/modules/modules.testscript @@ -205,8 +205,6 @@ $* test clean <=g.hxx; void g (); EOI @@ -220,7 +218,6 @@ ln -s ../core.cxx ../driver.cxx ./; $* test clean <=core.mxx; export __symexport int f (int); - __symexport int g_impl (int i) {return i - 1;} + __symexport int g_impl (int i); export __symexport inline int g (int i) {return g_impl (i);} + + export __symexport int v1 = 1; + export __symexport extern int v2; EOI ln -s ../core.cxx core-f.cxx; cat <=core-g.cxx; module foo.core; int g_impl (int i) {return i - 1;} + int v = 1; + EOI +cat <=core-v.cxx; + module foo.core; + int v2 = -1; EOI cat <=driver.cxx; import foo.core; - int main (int argc, char*[]) {return f (argc) + g (argc);} + int main (int argc, char*[]) {return f (argc) + g (argc) + v1 + v2;} EOI $* test clean <