| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  | USING: tools.test namespaces assocs alien.syntax kernel | 
					
						
							|  |  |  | compiler.errors accessors alien alien.c-types alien.strings | 
					
						
							| 
									
										
										
										
											2015-08-12 12:08:24 -04:00
										 |  |  | debugger literals kernel.private alien.libraries ;
 | 
					
						
							| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  | IN: compiler.tests.linkage-errors | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ! Regression: calling an undefined function would raise a protection fault | 
					
						
							| 
									
										
										
										
											2015-07-19 23:09:21 -04:00
										 |  |  | FUNCTION: void this_does_not_exist ( )
 | 
					
						
							| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ this_does_not_exist ] try | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ this_does_not_exist ] [ | 
					
						
							| 
									
										
										
										
											2016-03-22 18:22:15 -04:00
										 |  |  |     ${ KERNEL-ERROR ERROR-UNDEFINED-SYMBOL "this_does_not_exist" string>symbol f } | 
					
						
							| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  |     =
 | 
					
						
							|  |  |  | ] must-fail-with | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-12 14:58:38 -04:00
										 |  |  | { t } [ | 
					
						
							| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  |     \ this_does_not_exist linkage-errors get at error>> | 
					
						
							| 
									
										
										
										
											2015-08-12 14:58:38 -04:00
										 |  |  |     [ no-such-symbol? ] [ name>> "this_does_not_exist" = ] bi and
 | 
					
						
							| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  |     ! We don't care about the error message from dlerror, just | 
					
						
							|  |  |  |     ! wipe it out | 
					
						
							| 
									
										
										
										
											2015-08-12 14:58:38 -04:00
										 |  |  |     ! clone f >>message | 
					
						
							| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | << "no_such_library" "no_such_library" cdecl add-library >> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | LIBRARY: no_such_library | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-19 23:09:21 -04:00
										 |  |  | FUNCTION: void no_such_function ( )
 | 
					
						
							| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ no_such_function ] try | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [ no_such_function ] [ | 
					
						
							| 
									
										
										
										
											2014-06-04 10:51:26 -04:00
										 |  |  |     ${ | 
					
						
							| 
									
										
										
										
											2016-03-22 18:22:15 -04:00
										 |  |  |         KERNEL-ERROR ERROR-UNDEFINED-SYMBOL | 
					
						
							| 
									
										
										
										
											2014-06-04 10:51:26 -04:00
										 |  |  |         "no_such_function" string>symbol | 
					
						
							| 
									
										
										
										
											2018-02-19 11:34:06 -05:00
										 |  |  |         "no_such_library" library-dll | 
					
						
							| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  |     } | 
					
						
							|  |  |  |     =
 | 
					
						
							|  |  |  | ] must-fail-with | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-12 14:58:38 -04:00
										 |  |  | { t } [ | 
					
						
							| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  |     \ no_such_function linkage-errors get at error>> | 
					
						
							| 
									
										
										
										
											2015-08-12 14:58:38 -04:00
										 |  |  |     [ no-such-library? ] [ name>> "no_such_library" = ] bi and
 | 
					
						
							| 
									
										
										
										
											2014-06-03 17:45:38 -04:00
										 |  |  | ] unit-test |