diff --git a/source/compiler/tests/share_arg_flags_fstates_gh_371.meta b/source/compiler/tests/share_arg_flags_fstates_gh_371.meta new file mode 100644 index 0000000..51ea5e9 --- /dev/null +++ b/source/compiler/tests/share_arg_flags_fstates_gh_371.meta @@ -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" +""" +} diff --git a/source/compiler/tests/share_arg_flags_fstates_gh_371.pwn b/source/compiler/tests/share_arg_flags_fstates_gh_371.pwn new file mode 100644 index 0000000..6c1e3a8 --- /dev/null +++ b/source/compiler/tests/share_arg_flags_fstates_gh_371.pwn @@ -0,0 +1,55 @@ +f0(str[]) +{ + new a = str[0]; + #pragma unused a +} + +f0(str[]) +{ + new a = str[0] + str[1]; + #pragma unused a +} + +f1(str[]) +{ + new a = str[0]; + #pragma unused a +} + +f1(str[]) +{ + str[0] = 5; +} + +f2(const str[]) +{ + new a = str[0]; + #pragma unused a +} + +f2(const str[]) +{ + new a = str[0] + str[1]; + #pragma unused a +} + +f3(str[]) +{ + str[0] = 5; +} + +f3(str[]) +{ + new a = str[0]; + #pragma unused a +} + +main() +{ + state fstate : a; + new arr[10]; + f0(arr); + f1(arr); + f2(arr); + f3(arr); +}