t_id
548
t_version
1.1
t_adddate
2003/10/03
t_result
0
t_knownrunerror
0
t_opts
-Or
tr_id | run | tr_ok | tr_skip | tr_result |
---|---|---|---|---|
482115161 | 941174 | True | False | Successfully run |
Record count: 1
{ %VERSION=1.1 } { %OPT=-Or } { test for full boolean eval and register usage with b+ } {$b+} var funcscalled: byte; ok: boolean; function function1: boolean; begin writeln('function1 called!'); inc(funcscalled); function1 := false; end; function function2: boolean; begin writeln('function2 called!'); inc(funcscalled); function2 := false; end; function function3: boolean; begin writeln('function3 called!'); inc(funcscalled); function3 := false; end; function function4: boolean; begin writeln('function4 called!'); inc(funcscalled); function4 := false; end; function test2: boolean; var j, k, l, m: longint; begin test2 := true; m := 0; { get as much regvars occupied as possible } for j := 1 to 1000 do for k := 1 to 1000 do for l := k downto 0 do inc(m,j - k + l); if (j = 5) and (k = 0) and (l = 100) and function1 then begin test2 := false; writeln('bug'); end; end; begin ok := true; funcscalled := 0; if function1 and function2 and function3 and function4 then begin writeln('bug!'); end; ok := funcscalled = 4; if ok then writeln('all functions called!') else writeln('not all functions called'); ok := test2 and (funcscalled = 5); if ok then writeln('test2 passed') else writeln('test2 not passed'); if not ok then begin writeln('full boolean evaluation is not working!'); halt(1); end; end.