mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Add test: writes to specific fields clobber reads of whole objects
* test-suite/tests/compiler.test ("cse auxiliary definitions"): New test.
This commit is contained in:
parent
54c4753dd3
commit
b012c80875
1 changed files with 9 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;;; compiler.test --- tests for the compiler -*- scheme -*-
|
;;;; compiler.test --- tests for the compiler -*- scheme -*-
|
||||||
;;;; Copyright (C) 2008-2014, 2018, 2021-2022 Free Software Foundation, Inc.
|
;;;; Copyright (C) 2008-2014, 2018, 2021-2022, 2024 Free Software Foundation, Inc.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This library is free software; you can redistribute it and/or
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -356,7 +356,14 @@
|
||||||
(trampoline (lambda () (test count))))
|
(trampoline (lambda () (test count))))
|
||||||
main)))
|
main)))
|
||||||
|
|
||||||
(pass-if-equal "running test" 42 (test-proc)))
|
(pass-if-equal "running test" 42 (test-proc))
|
||||||
|
|
||||||
|
(define test2
|
||||||
|
(compile '(lambda (x)
|
||||||
|
(define pair (cons 42 69))
|
||||||
|
(when x (set-car! pair 100))
|
||||||
|
(car pair))))
|
||||||
|
(pass-if-equal "clobbering" 100 (test2 #t)))
|
||||||
|
|
||||||
(with-test-prefix "closure conversion"
|
(with-test-prefix "closure conversion"
|
||||||
(define test-proc
|
(define test-proc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue