self-referential c record imports
This commit is contained in:
@@ -1972,6 +1972,20 @@ by_value_c_records_and_unions_compile_and_link :: proc(t: ^testing.T) {
|
||||
testing.expect_value(t, state.exit_code, 1)
|
||||
}
|
||||
|
||||
@(test)
|
||||
self_referential_c_records_import_and_compile :: proc(t: ^testing.T) {
|
||||
// `struct Node { struct Node *next; int value; }`: the importer must not recurse
|
||||
// forever populating the self-referential record, and the checker must accept the
|
||||
// self-referential `?*mut Node` field as C-layout-compatible.
|
||||
output := "/tmp/brolang-test-recursive"
|
||||
defer _ = os.remove(output)
|
||||
c_options := cimport.Options{include_paths=[]string{"examples/interop/recursive/include"}}
|
||||
status := compiler_core.compile_package("examples/interop/recursive/app", output, nil, target.DEFAULT, c_options)
|
||||
testing.expect_value(t, status, 0)
|
||||
state := run_executable(output)
|
||||
testing.expect_value(t, state.exit_code, 0)
|
||||
}
|
||||
|
||||
@(test)
|
||||
unsupported_c_header_members_diagnose_only_when_referenced :: proc(t: ^testing.T) {
|
||||
output := "/tmp/brolang-test-header-unsupported"
|
||||
|
||||
Reference in New Issue
Block a user