From 6e00ab6236e9d65376ac8c603e1321a6a0af6b57 Mon Sep 17 00:00:00 2001 From: GoaLitiuM Date: Mon, 20 Aug 2018 18:21:34 +0300 Subject: Improve D mixed language test case --- test cases/d/10 d cpp/cppmain.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test cases/d/10 d cpp/cppmain.cpp') diff --git a/test cases/d/10 d cpp/cppmain.cpp b/test cases/d/10 d cpp/cppmain.cpp index aeddf56e8..ff90e3f41 100644 --- a/test cases/d/10 d cpp/cppmain.cpp +++ b/test cases/d/10 d cpp/cppmain.cpp @@ -1,6 +1,18 @@ +extern "C" int rt_init(); +extern "C" int rt_term(); extern void print_hello(int i); int main(int, char**) { + // initialize D runtime + if (!rt_init()) + return 1; + print_hello(1); + + // terminate D runtime, each initialize call + // must be paired with a terminate call. + if (!rt_term()) + return 1; + return 0; } -- cgit v1.2.3