aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index c622a265e0..3a7502b5da 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -2019,6 +2019,25 @@ static const int int_var = 13;
)SOURCE", 2,
"pub extern var extern_var: c_int;",
"pub const int_var: c_int = 13;");
+
+
+ add_parseh_case("circular struct definitions", R"SOURCE(
+struct Bar;
+
+struct Foo {
+ struct Bar *next;
+};
+
+struct Bar {
+ struct Foo *next;
+};
+ )SOURCE", 2,
+ R"SOURCE(export struct struct_Bar {
+ next: ?&struct_Foo,
+})SOURCE",
+ R"SOURCE(export struct struct_Foo {
+ next: ?&struct_Bar,
+})SOURCE");
}
static void print_compiler_invocation(TestCase *test_case) {