diff options
| author | Andrea Corallo | 2019-11-02 12:16:41 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2020-01-01 11:38:00 +0100 |
| commit | a18e54f54bdcd5d9b2c11b0307b0a157f52e5926 (patch) | |
| tree | 15bcd128bee30f7da9b466fb378fb57b21de124b /test/src | |
| parent | e0e0b92c1d3fe39085731db04bacd9def31f3940 (diff) | |
| download | emacs-a18e54f54bdcd5d9b2c11b0307b0a157f52e5926.tar.gz emacs-a18e54f54bdcd5d9b2c11b0307b0a157f52e5926.zip | |
add a test for functions with more than 8 arguments
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/comp-test-funcs.el | 10 | ||||
| -rw-r--r-- | test/src/comp-tests.el | 6 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el index 540170ea966..66ce0e70e8d 100644 --- a/test/src/comp-test-funcs.el +++ b/test/src/comp-test-funcs.el | |||
| @@ -81,6 +81,14 @@ | |||
| 81 | (defun comp-tests-ffuncall-callee-rest-f (a b &rest c) | 81 | (defun comp-tests-ffuncall-callee-rest-f (a b &rest c) |
| 82 | (list a b c)) | 82 | (list a b c)) |
| 83 | 83 | ||
| 84 | (defun comp-tests-ffuncall-callee-more8-f (p1 p2 p3 p4 p5 p6 p7 p8 p9 p10) | ||
| 85 | ;; More then 8 args. | ||
| 86 | (list p1 p2 p3 p4 p5 p6 p7 p8 p9 p10)) | ||
| 87 | |||
| 88 | (defun comp-tests-ffuncall-callee-more8-rest-f (p1 p2 p3 p4 p5 p6 p7 p8 p9 &rest p10) | ||
| 89 | ;; More then 8 args. | ||
| 90 | (list p1 p2 p3 p4 p5 p6 p7 p8 p9 p10)) | ||
| 91 | |||
| 84 | (defun comp-tests-ffuncall-native-f () | 92 | (defun comp-tests-ffuncall-native-f () |
| 85 | "Call a primitive with no dedicate op." | 93 | "Call a primitive with no dedicate op." |
| 86 | (make-vector 1 nil)) | 94 | (make-vector 1 nil)) |
| @@ -342,6 +350,7 @@ | |||
| 342 | 350 | ||
| 343 | (defun comp-test-callee (_ __) t) | 351 | (defun comp-test-callee (_ __) t) |
| 344 | (defun comp-test-silly-frame1 (x) | 352 | (defun comp-test-silly-frame1 (x) |
| 353 | ;; Check robustness against dead code. | ||
| 345 | (cl-case x | 354 | (cl-case x |
| 346 | (0 (comp-test-callee | 355 | (0 (comp-test-callee |
| 347 | (pcase comp-tests-var1 | 356 | (pcase comp-tests-var1 |
| @@ -350,6 +359,7 @@ | |||
| 350 | 3)))) | 359 | 3)))) |
| 351 | 360 | ||
| 352 | (defun comp-test-silly-frame2 (token) | 361 | (defun comp-test-silly-frame2 (token) |
| 362 | ;; Check robustness against dead code. | ||
| 353 | (while c | 363 | (while c |
| 354 | (cl-case c | 364 | (cl-case c |
| 355 | (?< 1) | 365 | (?< 1) |
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 16726cb4bbe..06a1ae90542 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -124,6 +124,12 @@ | |||
| 124 | (should (equal (comp-tests-ffuncall-callee-rest-f 1 2 3 4) | 124 | (should (equal (comp-tests-ffuncall-callee-rest-f 1 2 3 4) |
| 125 | '(1 2 (3 4)))) | 125 | '(1 2 (3 4)))) |
| 126 | 126 | ||
| 127 | (should (equal (comp-tests-ffuncall-callee-more8-f 1 2 3 4 5 6 7 8 9 10) | ||
| 128 | '(1 2 3 4 5 6 7 8 9 10))) | ||
| 129 | |||
| 130 | (should (equal (comp-tests-ffuncall-callee-more8-rest-f 1 2 3 4 5 6 7 8 9 10 11) | ||
| 131 | '(1 2 3 4 5 6 7 8 9 (10 11)))) | ||
| 132 | |||
| 127 | (should (equal (comp-tests-ffuncall-native-f) [nil])) | 133 | (should (equal (comp-tests-ffuncall-native-f) [nil])) |
| 128 | 134 | ||
| 129 | (should (equal (comp-tests-ffuncall-native-rest-f) [1 2 3])) | 135 | (should (equal (comp-tests-ffuncall-native-rest-f) [1 2 3])) |