X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fdebug.impure.lisp;h=a593394a5769328968e6a59af77ceafdd981ebf0;hb=78fa16bf55be44cc16845be84d98023e83fb14bc;hp=a1d1e19d0c8539f4beff7c0e3816b550bd363262;hpb=ace140856e6b3f92bb06597092a59753f1e59142;p=sbcl.git diff --git a/tests/debug.impure.lisp b/tests/debug.impure.lisp index a1d1e19..a593394 100644 --- a/tests/debug.impure.lisp +++ b/tests/debug.impure.lisp @@ -74,20 +74,22 @@ (let ((backtrace (ignore-errors (sb-debug:backtrace-as-list)))) ;; Make sure we find what we're looking for. - (when (member frame-name backtrace - :key key :test test) - (setf result (list :error condition))) + (if (member frame-name backtrace :key key :test test) + (setf result (list :error condition)) + (print (list :failed :frame frame-name :backtrace backtrace))) ;; Make sure there's no bogus stack frames ;; unless they're explicitly allowed. (when (and (not allow-bogus-frames) (member "bogus stack frame" backtrace :key #'first :test #'equal)) + (print 'verify-backtrace-bogus) (setf result nil)) ;; Make sure the backtrace isn't stunted in ;; any way. (Depends on running in the main ;; thread.) (unless (member 'sb-impl::toplevel-init backtrace :key #'first :test #'equal) + (print 'verify-backtrace-stunted) (setf result nil))) (return-from outer-handler)))) (funcall test-function))) @@ -97,19 +99,28 @@ ;;; Try it with and without tail call elimination, since they can have ;;; different effects. (Specifically, if undefined_tramp is incorrect ;;; a stunted stack can result from the tail call variant.) -#-(or alpha x86) ; bug 345 -(progn - (flet ((test-function () - (declare (optimize (speed 2) (debug 1))) ; tail call elimination - (#:undefined-function 42))) - (assert (verify-backtrace #'test-function "undefined function" - :test #'equal))) - - (flet ((test-function () - (declare (optimize (speed 1) (debug 2))) ; no tail call elimination - (#:undefined-function 42))) - (assert (verify-backtrace #'test-function "undefined function" - :test #'equal)))) +#-(or alpha) ; bug 346 +(flet ((optimized () + (declare (optimize (speed 2) (debug 1))) ; tail call elimination + (#:undefined-function 42)) + (not-optimized () + (declare (optimize (speed 1) (debug 2))) ; no tail call elimination + (#:undefined-function 42)) + (test (fun) + (declare (optimize (speed 1) (debug 2))) ; no tail call elimination + (funcall fun))) + #-x86 ; <- known bug (?): fails for me on 0.8.17.31/Linux/x86 -- WHN 2004-12-27 + (dolist (frame '(#-(or x86 x86-64) "undefined function" ; bug 353 + "FLET COMMON-LISP-USER::TEST")) + (assert (verify-backtrace (lambda () (test #'optimized)) frame + :test #'equal + :allow-bogus-frames (or #+(or x86 x86-64) t)))) + (dolist (frame '(#-(or x86 x86-64) "undefined function" ; bug 353 + "FLET COMMON-LISP-USER::NOT-OPTIMIZED" + "FLET COMMON-LISP-USER::TEST")) + (assert (verify-backtrace (lambda () (test #'not-optimized)) frame + :test #'equal + :allow-bogus-frames (or #+(or x86 x86-64) t))))) ;;; Division by zero was a common error on PPC. It depended on the ;;; return function either being before INTEGER-/-INTEGER in memory, @@ -135,11 +146,14 @@ (/ 42 0))) (assert (verify-backtrace #'test-function '/)))) -#-(or x86 alpha) ; bug 61 +#-(or alpha) ; bug 61 (progn (defun throw-test () (throw 'no-such-tag t)) - (assert (verify-backtrace #'throw-test 'throw-test))) + (assert (verify-backtrace #'throw-test + #-(or x86 x86-64 sparc) 'throw-test + #+(or x86 x86-64 sparc) "XEP for COMMON-LISP-USER::THROW-TEST" ; bug 354 + :test #'equal))) ;;; success (quit :unix-status 104)