summaryrefslogtreecommitdiffstats
path: root/tests/nonRegression/bug1619.sci
blob: bfd9d3108565bccdc987c47aa4eca94f761f5aec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// <-- Non-regression test for bug 1619 -->
//
// <-- Bugzilla URL -->
// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=1619
//
// <-- Short Description -->
//    macr2tree doesn't like functions compiled for profiling. It hates them 
//    so much,
//    that causes spectacular crashes of scilab.

// Copyright INRIA
// Scilab Project - Serge Steer
// Copyright INRIA 2006
// Date : 2 octobre 2006

deff('x=foo(n)',['if n==0 then'
                 '  x=[]'
                 'else'
                 '  x=0'
                 '  for k=1:n'
                 '    s=svd(rand(n+10,n+10))'
                 '    x=x+s(1)'
                 '  end'
                 'end'],'p')
T1=execstr('T=macr2tree(foo)','errcatch')==0;
clear foo;
function y=foo(),y=sin(33)+1;endfunction
foo(); //execution creates a deleted op in the pseudo code of foo
T2=execstr('macr2tree(foo)','errcatch')==0
affich_result(T1&T2,1619);