X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Falien.impure.lisp;h=e215ad248069f7f2d56686b27e4a77ce9ea63d1f;hb=64d420902d31cb87ea752f09b314e4767816a9c9;hp=7192ba340187197707cb1b0101607ffc8300af3a;hpb=175c318c892b0627b36fa3c4db66f59680242204;p=sbcl.git diff --git a/tests/alien.impure.lisp b/tests/alien.impure.lisp index 7192ba3..e215ad2 100644 --- a/tests/alien.impure.lisp +++ b/tests/alien.impure.lisp @@ -115,6 +115,17 @@ (deref integer-array 1))) (assert (eql (deref enum-array 2) 'k-two)))) +;; enums used to allow values to be used only once +;; C enums allow for multiple tags to point to the same value +(define-alien-type enum.4 + (enum nil (:key1 1) (:key2 2) (:keytwo 2))) +(with-alien ((enum-array (array enum.4 3))) + (setf (deref enum-array 0) :key1) + (setf (deref enum-array 1) :key2) + (setf (deref enum-array 2) :keytwo) + (assert (and (eql (deref enum-array 1) (deref enum-array 2)) + (eql (deref enum-array 1) :key2)))) + ;;; As reported by Baughn on #lisp, ALIEN-FUNCALL loops forever when ;;; compiled with (DEBUG 3). (sb-kernel::values-specifier-type-cache-clear)