1 USING: tools.test namespaces assocs alien.syntax kernel
2 compiler.errors accessors alien alien.c-types alien.strings
3 debugger literals kernel.private alien.libraries ;
4 IN: compiler.tests.linkage-errors
6 ! Regression: calling an undefined function would raise a protection fault
7 FUNCTION: void this_does_not_exist ( )
9 [ this_does_not_exist ] try
11 [ this_does_not_exist ] [
12 ${ "kernel-error" ERROR-UNDEFINED-SYMBOL "this_does_not_exist" string>symbol f }
16 [ T{ no-such-symbol { name "this_does_not_exist" } } ]
18 \ this_does_not_exist linkage-errors get at error>>
19 ! We don't care about the error message from dlerror, just
24 << "no_such_library" "no_such_library" cdecl add-library >>
26 LIBRARY: no_such_library
28 FUNCTION: void no_such_function ( )
30 [ no_such_function ] try
32 [ no_such_function ] [
34 "kernel-error" ERROR-UNDEFINED-SYMBOL
35 "no_such_function" string>symbol
36 "no_such_library" load-library
41 [ T{ no-such-library { name "no_such_library" } } ]
43 \ no_such_function linkage-errors get at error>>
44 ! We don't care about the error message from dlerror, just