Debian Codegraph @

src/test/04-Stress/func-call-6-ctor.ck

raw
1 // #2024-func-call-update verification
2
3 // test constructor instruction stack alignment
4 true => int OK;
5
6 // class definition
7 class Foo
8 {
9 int N;
10 // constructor
11 fun Foo(int n) { n => N; }
12 }
13
14 // test stack overflow
15 repeat( 100000 )
16 { Foo foo(5); if( foo.N != 5 ) { false => OK; break; } }
17
18 // print
19 if( OK ) <<< "success" >>>;
20 else <<< "noooooo" >>>;