From e100af592b7f78166ba867bf4f9b151d3adece08 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 1 Feb 2018 16:55:59 +0100 Subject: Fix for rematerializer. --- test/libjulia/Rematerialiser.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/libjulia/Rematerialiser.cpp b/test/libjulia/Rematerialiser.cpp index 020f0020..d6cc0dae 100644 --- a/test/libjulia/Rematerialiser.cpp +++ b/test/libjulia/Rematerialiser.cpp @@ -118,6 +118,18 @@ BOOST_AUTO_TEST_CASE(branches_for) ); } +BOOST_AUTO_TEST_CASE(branches_for_declared_in_init) +{ + CHECK( + "{ let b := 0 for { let a := 1 pop(a) } a { pop(a) } { b := 1 pop(a) } }", + "{ let b := 0 for { let a := 1 pop(1) } 1 { pop(1) } { b := 1 pop(1) } }" + ); + CHECK( + "{ let b := 0 for { let a := 1 pop(a) } lt(a, 0) { pop(a) a := add(a, 3) } { b := 1 pop(a) } }", + "{ let b := 0 for { let a := 1 pop(1) } lt(a, 0) { pop(a) a := add(a, 3) } { b := 1 pop(a) } }" + ); +} + BOOST_AUTO_TEST_CASE(reassignment) { CHECK( -- cgit v1.2.3