From d58c6a13a0d4dfc0834d8b0d3712c089fdbad6ad Mon Sep 17 00:00:00 2001
From: Erwan Jahier <erwan.jahier@univ-grenoble-alpes.fr>
Date: Tue, 20 Jun 2017 16:19:36 +0200
Subject: [PATCH] -ec -eei : inline enum constants ("const toto : int = 0;" is
 not valid in ec)

---
 _oasis            |  2 +-
 src/l2lSplit.ml   |  6 ++++--
 src/lv6version.ml |  4 ++--
 test/lus2lic.sum  | 28 ++++++++++++++--------------
 4 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/_oasis b/_oasis
index 51598dbd..3d51fe25 100644
--- a/_oasis
+++ b/_oasis
@@ -1,6 +1,6 @@
 OASISFormat: 0.4
 Name:        lustre-v6
-Version:     1.693
+Version:     1.694
 Synopsis:    The Lustre V6 Verimag compiler
 Description: This package contains:
    (1) lus2lic: the (current) name of the compiler (and interpreter via -exec).
diff --git a/src/l2lSplit.ml b/src/l2lSplit.ml
index 30cd02d3..bbf45c0e 100644
--- a/src/l2lSplit.ml
+++ b/src/l2lSplit.ml
@@ -223,9 +223,11 @@ and (split_val_exp : LicPrg.t -> bool -> bool -> Lic.val_exp -> Lic.val_exp * sp
   )
   | CallByPosLic({it=Lic.VAR_REF _}, _) -> ve, ([],[])
   | CallByPosLic({src=lxm;it=Lic.CONST_REF idl}, vel) ->
-     (* expand const ref in -eei mode  *)
+     (* expand const ref in -ec -eei mode  
+       Should I rather always inline const?
+      *)
      (try
-         if Lv6MainArgs.global_opt.Lv6MainArgs.ec then raise Not_found else
+         if not Lv6MainArgs.global_opt.Lv6MainArgs.ec then raise Not_found else
            let const =
              let c = match LicPrg.find_const lic_prg idl with
                  Some c -> c | None -> raise Not_found  (* meant to catched *)
diff --git a/src/lv6version.ml b/src/lv6version.ml
index dbfbd072..e72753ed 100644
--- a/src/lv6version.ml
+++ b/src/lv6version.ml
@@ -1,7 +1,7 @@
 (** Automatically generated from Makefile *) 
 let tool = "lus2lic"
 let branch = "master"
-let commit = "693"
-let sha_1 = "c533df3e8195236dd128f41e2dd862bba83a2322"
+let commit = "694"
+let sha_1 = "e9232136c982b66346d68bdf2e5d2bf602e5520c"
 let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")")
 let maintainer = "jahier@imag.fr"
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index 1e22de36..97021fd2 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,5 +1,5 @@
 ==> lus2lic0.sum <==
-Test Run By jahier on Tue Jun 20 15:40:10 
+Test Run By jahier on Tue Jun 20 16:07:17 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic0 tests ===
@@ -64,7 +64,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
 XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
 
 ==> lus2lic1.sum <==
-Test Run By jahier on Tue Jun 20 15:40:11 
+Test Run By jahier on Tue Jun 20 16:07:18 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic1 tests ===
@@ -398,7 +398,7 @@ PASS: sh multipar.sh
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus  {}
 
 ==> lus2lic2.sum <==
-Test Run By jahier on Tue Jun 20 15:41:04 
+Test Run By jahier on Tue Jun 20 16:08:11 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic2 tests ===
@@ -738,7 +738,7 @@ PASS: sh zzz2.sh
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus  {}
 
 ==> lus2lic3.sum <==
-Test Run By jahier on Tue Jun 20 15:42:01 
+Test Run By jahier on Tue Jun 20 16:09:07 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic3 tests ===
@@ -1243,7 +1243,7 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
 
 
 ==> lus2lic4.sum <==
-Test Run By jahier on Tue Jun 20 15:43:45 
+Test Run By jahier on Tue Jun 20 16:10:49 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic4 tests ===
@@ -1760,14 +1760,14 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
 # of unexpected failures	6
 ===============================
 # Total number of failures: 23
-lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds
-lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 52 seconds
-lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 57 seconds
-lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 104 seconds
-lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 50 seconds
+lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
+lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 53 seconds
+lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 56 seconds
+lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 102 seconds
+lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 49 seconds
 * Ref time: 
-0.07user 0.00system 4:26.07elapsed 0%CPU (0avgtext+0avgdata 5600maxresident)k
-96inputs+0outputs (0major+6098minor)pagefaults 0swaps
+0.04user 0.03system 4:20.58elapsed 0%CPU (0avgtext+0avgdata 5636maxresident)k
+160inputs+0outputs (0major+6095minor)pagefaults 0swaps
 * Quick time (-j 4):
-0.05user 0.02system 1:54.24elapsed 0%CPU (0avgtext+0avgdata 5644maxresident)k
-128inputs+0outputs (0major+6132minor)pagefaults 0swaps
+0.06user 0.02system 2:27.24elapsed 0%CPU (0avgtext+0avgdata 5584maxresident)k
+64inputs+0outputs (0major+6126minor)pagefaults 0swaps
-- 
GitLab