diff options
author | Yuuki Harano <masm+github@masm11.me> | 2021-05-29 18:00:13 +0900 |
---|---|---|
committer | Yuuki Harano <masm+github@masm11.me> | 2021-05-29 18:00:13 +0900 |
commit | 67ae4b6271233559271f7a7158ba0e059b643ba5 (patch) | |
tree | 9ceee3c99afb42b252ac11116cc31163acaaeb40 /test/lisp/emacs-lisp/bytecomp-tests.el | |
parent | 67a4c8b5ad9ebfb3fa2c7fae433aa6b6b5e92154 (diff) | |
parent | e3fc16fd71a46990503a71b11a2ad592e99d9edb (diff) | |
download | emacs-67ae4b6271233559271f7a7158ba0e059b643ba5.tar.gz emacs-67ae4b6271233559271f7a7158ba0e059b643ba5.tar.bz2 emacs-67ae4b6271233559271f7a7158ba0e059b643ba5.zip |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'test/lisp/emacs-lisp/bytecomp-tests.el')
-rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index c9ab3ec1f1b..33413f5a002 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el @@ -1312,6 +1312,24 @@ compiled correctly." (funcall f 3)) 4))) +(declare-function bc-test-alpha-f (ert-resource-file "bc-test-alpha.el")) + +(ert-deftest bytecomp-defsubst () + ;; Check that lexical variables don't leak into inlined code. See + ;; https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg01227.html + + ;; First, remove any trace of the functions and package defined: + (fmakunbound 'bc-test-alpha-f) + (fmakunbound 'bc-test-beta-f) + (setq features (delq 'bc-test-beta features)) + ;; Byte-compile one file that uses a function from another file that isn't + ;; compiled. + (let ((file (ert-resource-file "bc-test-alpha.el")) + (load-path (cons (ert-resource-directory) load-path))) + (byte-compile-file file) + (load-file (concat file "c")) + (should (equal (bc-test-alpha-f 'a) '(nil a))))) + ;; Local Variables: ;; no-byte-compile: t ;; End: |