aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorAndrea Corallo2020-11-15 23:31:00 +0100
committerAndrea Corallo2020-11-16 15:32:52 +0100
commit898f929215cf644c651abf789b564fcbc50ffbdd (patch)
treeb26431fbdeb28c7bc2509cf732c6bb83c375c667 /test/src
parent54f2e9c06d599b795af45ab872915887e7649ef2 (diff)
downloademacs-898f929215cf644c651abf789b564fcbc50ffbdd.tar.gz
emacs-898f929215cf644c651abf789b564fcbc50ffbdd.zip
Fix nativecomp cond-rw pass
* lisp/emacs-lisp/comp.el (comp-mvar-symbol-p): Improve it. (comp-cond-rw-func): Fix logic for multiple predecessor on target block. * test/src/comp-tests.el (comp-test-cond-rw-1): New test. * test/src/comp-test-funcs.el (comp-test-cond-rw-1-1-f) (comp-test-cond-rw-1-2-f): New functions.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/comp-test-funcs.el10
-rw-r--r--test/src/comp-tests.el4
2 files changed, 14 insertions, 0 deletions
diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el
index bcf9fcb0fd1..207b6455f73 100644
--- a/test/src/comp-test-funcs.el
+++ b/test/src/comp-test-funcs.el
@@ -370,6 +370,16 @@
370 (copy-comp-mvar insn) 370 (copy-comp-mvar insn)
371 insn))) 371 insn)))
372 372
373(defun comp-test-cond-rw-1-1-f ())
374
375(defun comp-test-cond-rw-1-2-f ()
376 (let ((it (comp-test-cond-rw-1-1-f))
377 (key 't))
378 (if (or (equal it key)
379 (eq key t))
380 it
381 nil)))
382
373 383
374;;;;;;;;;;;;;;;;;;;; 384;;;;;;;;;;;;;;;;;;;;
375;; Tromey's tests ;; 385;; Tromey's tests ;;
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index d377b089932..bf3f57a85e3 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -449,6 +449,10 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
449 '(1 2 3 (4 5 6)))) 449 '(1 2 3 (4 5 6))))
450 (should (null (comp-test-copy-insn-f nil)))) 450 (should (null (comp-test-copy-insn-f nil))))
451 451
452(comp-deftest comp-test-cond-rw-1 ()
453 "Check cond-rw does not break target blocks with multiple predecessor."
454 (should (null (comp-test-cond-rw-1-2-f))))
455
452 456
453;;;;;;;;;;;;;;;;;;;;; 457;;;;;;;;;;;;;;;;;;;;;
454;; Tromey's tests. ;; 458;; Tromey's tests. ;;