mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
[FunC] Forbid auto-creating undefined symbols
This commit is contained in:
parent
4994ae8edd
commit
f217a7d312
7 changed files with 40 additions and 16 deletions
12
crypto/func/auto-tests/tests/invalid-undef-1.fc
Normal file
12
crypto/func/auto-tests/tests/invalid-undef-1.fc
Normal file
|
@ -0,0 +1,12 @@
|
|||
int main(int x) {
|
||||
return 1 + demo();
|
||||
}
|
||||
|
||||
int demo() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
{-
|
||||
@compilation_should_fail
|
||||
@stderr undefined symbol `demo`
|
||||
-}
|
10
crypto/func/auto-tests/tests/invalid-undef-2.fc
Normal file
10
crypto/func/auto-tests/tests/invalid-undef-2.fc
Normal file
|
@ -0,0 +1,10 @@
|
|||
int main(int x) {
|
||||
return 1 + demo;
|
||||
}
|
||||
|
||||
global int demo;
|
||||
|
||||
{-
|
||||
@compilation_should_fail
|
||||
@stderr undefined symbol `demo`
|
||||
-}
|
10
crypto/func/auto-tests/tests/invalid-undef-3.fc
Normal file
10
crypto/func/auto-tests/tests/invalid-undef-3.fc
Normal file
|
@ -0,0 +1,10 @@
|
|||
int demo(int x);
|
||||
|
||||
int main(int x) {
|
||||
return 1 + demo(x);
|
||||
}
|
||||
|
||||
{-
|
||||
@compilation_should_fail
|
||||
@stderr function `demo` is just declared, not implemented
|
||||
-}
|
Loading…
Add table
Add a link
Reference in a new issue