summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSerge Steer <serge.steer@scilab.org>2007-11-19 14:28:38 +0000
committerSerge Steer <serge.steer@scilab.org>2007-11-19 14:28:38 +0000
commitb6575de6afd9ce0170e781654845e4c8bdb5be62 (patch)
tree32fe7c008cac5bc46076ca293ec3ba50aff4ae7a /tests
parent271914b73e4ec04444f8443e151e3d4527a5654e (diff)
downloadscilab-b6575de6afd9ce0170e781654845e4c8bdb5be62.zip
scilab-b6575de6afd9ce0170e781654845e4c8bdb5be62.tar.gz
bug 2616 fixed
Diffstat (limited to 'tests')
-rw-r--r--tests/nonRegression/bug2616.sci56
1 files changed, 56 insertions, 0 deletions
diff --git a/tests/nonRegression/bug2616.sci b/tests/nonRegression/bug2616.sci
new file mode 100644
index 0000000..28bab0a
--- /dev/null
+++ b/tests/nonRegression/bug2616.sci
@@ -0,0 +1,56 @@
1// Scilab Project - Serge Steer
2// Copyright INRIA 2007
3// Date : June 2007
4
5mode(-1) ;
6clear ;
7BugNumber=2616;
8T=[];
9//simple case uncompiled
10s=0;for k=1:3,s=s+1;end
11T=[T,s<>3];
12
13
14s=0;for k=(1:3)+1,s=s+1;end
15T=[T,s<>3];
16
17s=0;for k=[(1:3) 1],s=s+1;end
18T=[T,s<>4];
19
20function s=foo(),s=0;for k=1:3,s=s+1;end,endfunction
21T=[T,foo()<>3];
22
23function s=foo(),s=0;for k=(1:3)+1,s=s+1;end,endfunction
24T=[T,foo()<>3];
25
26function s=foo(),s=0;for k=[(1:3) 1],s=s+1;end,endfunction
27T=[T,foo()<>4];
28
29//check if implicit vector is created or not
30old=stacksize();
31stacksize(180000)
32
33//should evaluate
34ierr=execstr('s=0;for k=1:200000,s=s+1;end','errcatch')
35T=[T,ierr<>0|s<>200000];
36
37//should produce a stacksize error
38ierr=execstr('s=0;for k=(1:200000)+1,s=s+1;end','errcatch')
39T=[T,ierr<>17];
40
41ierr=execstr('s=0;for k=[(1:200000) 1],s=s+1;end','errcatch')
42T=[T,ierr<>17];
43
44function s=foo(),s=0;for k=1:200000,s=s+1;end,endfunction
45ierr=execstr('s=foo();','errcatch');
46T=[T,ierr<>0|s<>200000];
47
48
49function s=foo(),s=0;for k=1+(1:200000),s=s+1;end,endfunction
50ierr=execstr('s=foo();','errcatch');
51T=[T,ierr<>17];
52stacksize(old(1))
53
54affich_result(and(~T),BugNumber) ;
55clear ;
56