Fix data truncation in printf strings
[sbcl.git] / contrib / sb-introspect / test.lisp
blobbffdeda7a2c232d55389bd657495e53f9b07d67e
2 ;;;
3 ;;; The order of the forms must not change, as the order is checked in
4 ;;; `test-driver.lisp'. Thus do not alter this file unless you edit
5 ;;; test-driver.lisp to match.
6 ;;;
8 (declaim (optimize (debug 3)))
9 (in-package :cl-user)
11 (defun one (a b c) (+ a b c))
13 (defgeneric two (a b))
14 (defmethod two ((a number) b)
15 (* 2 a))
17 (defstruct three four five)
19 (with-compilation-unit (:source-plist (list :test-inner "IN"))
20 (eval '(defun four () 4)))
22 "oops-off-by-one"
24 (defparameter *a* 1)
26 (defvar *b* 2)
28 (defclass a ()
29 (a))
31 (define-condition b (warning) (a))
33 (defstruct c e f)
35 (defstruct (d (:type list)) e f)
37 (defpackage e (:use :cl))
39 (define-symbol-macro f 'e)
41 (deftype g () 'fixnum)
43 (defconstant +h+ 1)
45 (defmethod j ((a t))
48 (defmethod j ((b null))
51 (defmacro l (a)
54 (define-compiler-macro m (a)
55 (declare (ignore a))
56 'b)
58 (defsetf n (a) (store)
59 (format t "~a ~a~%" a store))
61 (defun (setf o) (x)
62 (print x))
64 (defmethod (setf p) (x y)
65 (format t "~a ~a~%" x y))
67 (define-modify-macro q (x) logand)
69 (define-method-combination r nil)
71 (define-setf-expander s (a b)
72 (format t "~a ~a~%" a b))
74 (eval-when (:compile-toplevel)
75 (defun compile-time-too-fun ()
76 :foo))
78 (sb-ext:defglobal **global** 'value)
80 (sb-alien:define-alien-type test-alien-type sb-alien:long)
82 (sb-alien:define-alien-type nil
83 (struct test-alien-struct
84 (x sb-alien:system-area-pointer)))
86 (sb-alien:define-alien-variable ("errno" test-alien-var) sb-alien:int)
88 (define-condition test-condition (error)
89 ((a :reader condition-slot-reader
90 :writer condition-slot-writer)))