diff options
author | Andy Wingo <wingo@pobox.com> | 2024-03-20 11:29:38 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2024-03-20 11:50:53 +0100 |
commit | b012c80875f6ac5235bf518b594513a6031304ad (patch) | |
tree | d5cb0a69e075a4da8235b4e4db73ea93487fb8dc | |
parent | 54c4753dd3f7506bee2778b36d7263b613ffd579 (diff) | |
download | guile-b012c80875f6ac5235bf518b594513a6031304ad.tar.gz |
Add test: writes to specific fields clobber reads of whole objects
* test-suite/tests/compiler.test ("cse auxiliary definitions"): New
test.
-rw-r--r-- | test-suite/tests/compiler.test | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test-suite/tests/compiler.test b/test-suite/tests/compiler.test index a018e0c41..0b47d0e32 100644 --- a/test-suite/tests/compiler.test +++ b/test-suite/tests/compiler.test @@ -1,5 +1,5 @@ ;;;; 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 ;;;; modify it under the terms of the GNU Lesser General Public @@ -356,7 +356,14 @@ (trampoline (lambda () (test count)))) 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" (define test-proc |