source: trunk/source/tests/ansi-tests/ignorable.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 12 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.1 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat May 21 08:16:27 2005
4;;;; Contains: Tests of the IGNORABLE declaration
5
6(in-package :cl-test)
7
8(deftest ignorable.1
9  (let ((x 'foo)) (declare (ignorable x)))
10  nil)
11
12(deftest ignorable.2
13  (let ((x 'foo)) (declare (ignorable x)) x)
14  foo)
15
16(deftest ignorable.3
17  (flet ((%f () 'foo))
18    (declare (ignorable (function %f))))
19  nil)
20   
21(deftest ignorable.4
22  (flet ((%f () 'foo))
23    (declare (ignorable (function %f)))
24    (%f))
25  foo)
26
27;;; TODO: add a test for (function (setf foo))
28
29(deftest ignorable.5
30  (flet (((setf %f) (x y) nil))
31        (declare (ignorable (function (setf %f))))
32        :good)
33  :good)
34
35(deftest ignorable.6
36  (flet (((setf %f) (x y) (setf (car y) x)))
37        (declare (ignorable (function (setf %f))))
38        (let ((z (cons 'a 'b)))
39          (values (setf (%f z) 'c) z)))
40  c (c . b))
41
42(deftest ignorable.7
43  (labels (((setf %f) (x y) nil))
44          (declare (ignorable (function (setf %f))))
45          :good)
46  :good)
47
48(deftest ignorable.8
49  (labels (((setf %f) (x y) (setf (car y) x)))
50          (declare (ignorable (function (setf %f))))
51          (let ((z (cons 'a 'b)))
52            (values (setf (%f z) 'c) z)))
53  c (c . b))
54
55
56
Note: See TracBrowser for help on using the repository browser.