heptagon/test/good/statics1.ept
Gwenal Delaval 6011353cec Added test of options
Added script test_option which:
- compile and run without option
- compile with option given as argument, run
- diff on the two outputs, fails if different outputs

config file checks for existence of compiler (fails if not exist)

statics1.ept is a copy of statics.ept ; statics2.ept depends on statics1.ept
instead of statics.ept (so as dependency order => lexical order on file names)
2012-07-19 15:23:40 +02:00

36 lines
505 B
Plaintext

(* Check manually *)
(* This test should only create two instances of f. *)
const c:int = 3
const k:int = 1
fun f<<n:int>>() returns (y:int)
let
y = n + 3 + c;
tel
fun g<<m:int>>() returns (y:int)
var x:int;
let
x = m + f<<2>>();
y = f<<m>>();
tel
fun i<<m:int>>() returns (o : int)
var x, y, z: int;
let
x = f<<2>>();
y = f<<1 + m>>();
z = f<<k + 1>>();
o = f<<m + k>>();
tel
fun h() returns (y:int)
let
y = c + g<<c>>() + i<<k>>();
tel
node main() returns (y:int)
let
y = h()
tel