1 ;;;; tests of the INFO/globaldb system
3 ;;;; KLUDGE: Unlike most of the system's tests, these are not in the
4 ;;;; problem domain, but in the implementation domain, so modification
5 ;;;; of the system could cause these tests to fail even if the system
6 ;;;; was still a correct implementation of ANSI Common Lisp + SBCL
7 ;;;; extensions. Perhaps such tests should be separate from tests in
8 ;;;; the problem domain. -- WHN 2001-02-11
10 ;;;; This software is part of the SBCL system. See the README file for
11 ;;;; more information.
13 ;;;; While most of SBCL is derived from the CMU CL system, the test
14 ;;;; files (like this one) were written from scratch after the fork
17 ;;;; This software is in the public domain and is provided with
18 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
19 ;;;; more information.
23 (defun foo (a) (list a))
26 (assert (eq (sb-int:info :function :where-from 'foo)
29 (defun foo (a b) (list a b))
30 (let ((x 1)) (foo x 2))
36 ;;; FIXME: This one is commented out since it doesn't work when
37 ;;; the DEFUN is just LOADed instead of COMPILE-FILEd, and it's
38 ;;; not immediately obvious what's the best way to set up
39 ;;; the COMPILE-FILE test.
43 (format nil "~A" (sb-int:info :function :type 'foo))
44 "#<FUN-TYPE (FUNCTION (T T) LIST)>"))
47 (with-test (:name :bug-458015)
48 ;; Make sure layouts have sane source-locations
49 (dolist (env sb-c::*info-environment*)
50 (sb-c::do-info (env :class class :type type :name info-name :value value)
51 (when (and (symbolp info-name)
54 (let* ((classoid (sb-kernel:find-classoid info-name nil))
55 (layout (and classoid (sb-kernel:classoid-layout classoid)))
56 (srcloc (and layout (sb-kernel::layout-source-location layout))))
58 (assert (or (sb-c::definition-source-location-p srcloc)