aboutsummaryrefslogtreecommitdiff
path: root/tests/cc/modules/testscript
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-06-29 11:38:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-06-29 11:38:27 +0200
commitbe14f6c87cb3eeb9e3a2ac93802c9c236c191aa5 (patch)
tree1d19f375e60f05ddeb9ec8fa2672beecdc8d810e /tests/cc/modules/testscript
parentb752b85660d2fff149b0822ebe21e9f2d4ee4e1d (diff)
Pass entire BMI graph, not only direct imports and re-exports
All current implementations require access to the entire graph (though Clang embeds the file references so we don't need to pass the options).
Diffstat (limited to 'tests/cc/modules/testscript')
-rw-r--r--tests/cc/modules/testscript39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/cc/modules/testscript b/tests/cc/modules/testscript
index d35de50..1fb1345 100644
--- a/tests/cc/modules/testscript
+++ b/tests/cc/modules/testscript
@@ -285,6 +285,45 @@ if ($cxx.id.type != "clang")
EOI
}
+: import
+:
+: Test module import. Currently, all the implementation require access to the
+: entire, recursively-explored list of BMIs.
+:
+{
+ # Note: using VC export module fixup support.
+
+ +cat <<EOI >=base.mxx
+ export module foo.base;
+ import foo.core;
+ export int g (int i) {return f (i);}
+ EOI
+
+ +cat <<EOI >=extra.mxx
+ export module foo.extra;
+ import foo.base;
+ export int h (int i) {return g (i);}
+ EOI
+
+ : basic
+ :
+ ln -s ../base.mxx ../../core.mxx ../../core.cxx ./;
+ cat <<EOI >=driver.cxx;
+ import foo.base;
+ int main (int argc, char*[]) {return g (argc);}
+ EOI
+ $* test clean <'exe{test}: cxx{driver core} mxx{core base}'
+
+ : recursive
+ :
+ ln -s ../base.mxx ../extra.mxx ../../core.mxx ../../core.cxx ./;
+ cat <<EOI >=driver.cxx;
+ import foo.extra;
+ int main (int argc, char*[]) {return h (argc);}
+ EOI
+ $* test clean <'exe{test}: cxx{driver core} mxx{core base extra}'
+}
+
: resolve-change
:
: Test detection of module name to BMI resolution change.