declaim.lsp 1.07 KB
Newer Older
pfdietz's avatar
pfdietz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat May 21 07:44:07 2005
;;;; Contains: Tests of DECLAIM

(in-package :cl-test)

(deftest declaim.1
  (progn (declaim) nil)
  nil)

(deftest declaim.2
  (progn (eval `(declaim (optimize))) nil)
  nil)

(deftest declaim.3
  (progn (eval `(declaim (inline))) nil)
  nil)

(deftest declaim.4
  (progn (eval `(declaim (notinline))) nil)
  nil)

(deftest declaim.5
  (progn (eval `(declaim (type t))) nil)
  nil)

(deftest declaim.6
  (progn (eval `(declaim (special))) nil)
  nil)

(deftest declaim.7
  (progn (eval `(declaim (integer))) nil)
  nil)

(deftest declaim.8
  (progn (eval `(declaim (declaration))) nil)
  nil)

(deftest declaim.9
41 42 43 44
  (progn (eval `(declaim (ftype (function (t) t)))) nil)
  nil)

(deftest declaim.10
pfdietz's avatar
pfdietz committed
45 46 47 48 49 50
  (let ((sym (gensym)))
    (eval `(declaim (declaration ,sym)))
    (eval `(declaim (,sym)))
    nil)
  nil)

51
(deftest declaim.11
pfdietz's avatar
pfdietz committed
52 53 54
  (let ((sym (gensym)))
    (eval `(declaim (optimize) (special ,sym) (inline) (special)))
    (eval `(flet ((%f () ,sym))
sds's avatar
sds committed
55
             (let ((,sym :good)) (%f)))))
pfdietz's avatar
pfdietz committed
56
  :good)