-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
properly emit function value vs. function call #2024-func-call-update
- Loading branch information
Showing
17 changed files
with
260 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// #2024-func-call-update verification | ||
|
||
// test custom non-class function | ||
fun void foo( int a ) { } | ||
|
||
// call it | ||
foo(1); | ||
// get the function as value only | ||
foo; | ||
|
||
// check for stack overflow | ||
repeat(100000) foo(2); | ||
repeat(100000) foo; | ||
|
||
// if we get here we are ok | ||
<<< "success" >>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// #2024-func-call-update verification | ||
// test spork static function from within a class | ||
class Foo | ||
{ | ||
static int N; | ||
fun static void foo() { N++; spork ~ bar(); me.yield(); } | ||
fun static void bar() { if( N >= 10000 ) <<< "success" >>>; } | ||
} | ||
|
||
0 => Foo.N; | ||
// test for stack overflow | ||
repeat(10000) Foo.foo(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// #2024-func-call-update verification | ||
|
||
// test static function | ||
Machine.refcount; | ||
|
||
// check for stack overflow | ||
repeat(1000000) | ||
Machine.refcount; | ||
|
||
// if we get here, ok | ||
<<< "success" >>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// #2024-func-call-update verification | ||
|
||
// test member function | ||
SinOsc osc; | ||
|
||
// emit as value without call | ||
osc.gain; | ||
|
||
// test for stack overflow | ||
repeat(1000000) osc.gain; | ||
|
||
// this might yield a compiler later on, until then... | ||
repeat(1000000) osc.gain == "hello"; | ||
|
||
// if we get here, ok | ||
<<< "success" >>>; |
Oops, something went wrong.