add test for issue #371
This commit is contained in:
parent
66bbe6c4df
commit
b32aea5faf
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
'test_type': 'output_check',
|
||||||
|
'errors': """
|
||||||
|
share_arg_flags_fstates_gh_371.pwn(1) : warning 214: possibly a "const" array argument was intended: "str"
|
||||||
|
share_arg_flags_fstates_gh_371.pwn(7) : warning 214: possibly a "const" array argument was intended: "str"
|
||||||
|
"""
|
||||||
|
}
|
55
source/compiler/tests/share_arg_flags_fstates_gh_371.pwn
Normal file
55
source/compiler/tests/share_arg_flags_fstates_gh_371.pwn
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
f0(str[]) <fstate : a>
|
||||||
|
{
|
||||||
|
new a = str[0];
|
||||||
|
#pragma unused a
|
||||||
|
}
|
||||||
|
|
||||||
|
f0(str[]) <fstate : b>
|
||||||
|
{
|
||||||
|
new a = str[0] + str[1];
|
||||||
|
#pragma unused a
|
||||||
|
}
|
||||||
|
|
||||||
|
f1(str[]) <fstate : a>
|
||||||
|
{
|
||||||
|
new a = str[0];
|
||||||
|
#pragma unused a
|
||||||
|
}
|
||||||
|
|
||||||
|
f1(str[]) <fstate : b>
|
||||||
|
{
|
||||||
|
str[0] = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
f2(const str[]) <fstate : a>
|
||||||
|
{
|
||||||
|
new a = str[0];
|
||||||
|
#pragma unused a
|
||||||
|
}
|
||||||
|
|
||||||
|
f2(const str[]) <fstate : b>
|
||||||
|
{
|
||||||
|
new a = str[0] + str[1];
|
||||||
|
#pragma unused a
|
||||||
|
}
|
||||||
|
|
||||||
|
f3(str[]) <fstate : a>
|
||||||
|
{
|
||||||
|
str[0] = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
f3(str[]) <fstate : b>
|
||||||
|
{
|
||||||
|
new a = str[0];
|
||||||
|
#pragma unused a
|
||||||
|
}
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
state fstate : a;
|
||||||
|
new arr[10];
|
||||||
|
f0(arr);
|
||||||
|
f1(arr);
|
||||||
|
f2(arr);
|
||||||
|
f3(arr);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user