Init
This commit is contained in:
18
cs420-acc/l3-warmup/tests/expr-if.l3
Normal file
18
cs420-acc/l3-warmup/tests/expr-if.l3
Normal file
@@ -0,0 +1,18 @@
|
||||
;; In Emacs, open this file in -*- Scheme -*- mode
|
||||
|
||||
;; Test the "if" expression
|
||||
|
||||
(@byte-write 71)
|
||||
|
||||
(if (@byte-write 65) 1 2)
|
||||
(@byte-write (if #t 66 63))
|
||||
(@byte-write (if #f 63 67))
|
||||
(if #t (@byte-write 68) (@byte-write 63))
|
||||
(if #f (@byte-write 63) (@byte-write 69))
|
||||
(if (@= #u (if #f 15))
|
||||
(@byte-write 70))
|
||||
|
||||
;; The condition has a side effect, and should therefore not be optimized away.
|
||||
;; This expression is made to enter tail mode in CL3ToCPSTranslator, where we
|
||||
;; want to check that it isn't optimized away
|
||||
(let ((a 71)) (if (if (@byte-write 71) #t #t) 1 2))
|
Reference in New Issue
Block a user