add tests for i276
This commit is contained in:
parent
8948f207ea
commit
1cdb8b7d6b
@ -52,6 +52,16 @@ set_tests_properties(meaningless_class_specifiers_gh_172 PROPERTIES PASS_REGULAR
|
||||
.*\\.pwn\\(1 \\-\\- 2\\) : warning 238: meaningless combination of class specifiers \\(const variable arguments\\)
|
||||
")
|
||||
|
||||
add_compiler_test(const_array_args_and_literals_gh_276 ${CMAKE_CURRENT_SOURCE_DIR}/const_array_args_and_literals_gh_276.pwn)
|
||||
set_tests_properties(const_array_args_and_literals_gh_276 PROPERTIES PASS_REGULAR_EXPRESSION
|
||||
".*\\.pwn\\(13\\) : warning 214: possibly a \\\"const\\\" array argument was intended: \\\"arr\\\"
|
||||
.*\\.pwn\\(18\\) : warning 214: possibly a \\\"const\\\" array argument was intended: \\\"arr\\\"
|
||||
.*\\.pwn\\(30\\) : warning 214: possibly a \\\"const\\\" array argument was intended: \\\"arr\\\"
|
||||
.*\\.pwn\\(39\\) : warning 239: literal array/string passed to a non-const parameter
|
||||
.*\\.pwn\\(40\\) : warning 239: literal array/string passed to a non-const parameter
|
||||
.*\\.pwn\\(41\\) : warning 239: literal array/string passed to a non-const parameter
|
||||
")
|
||||
|
||||
# Crashers
|
||||
#
|
||||
# These tests simply check that the compiler doesn't crash.
|
||||
|
@ -0,0 +1,61 @@
|
||||
forward OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
|
||||
|
||||
native SetTimer(funcname[], interval, repeating);
|
||||
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
f0(arr[]) {
|
||||
#pragma unused arr
|
||||
}
|
||||
|
||||
f1(arr[]) { // line 13
|
||||
new a = arr[0];
|
||||
#pragma unused a
|
||||
}
|
||||
|
||||
f2(arr[5]) {// line 18
|
||||
new a = arr[0];
|
||||
#pragma unused a
|
||||
}
|
||||
f3(const arr[]) {
|
||||
new a = arr[0];
|
||||
#pragma unused a
|
||||
}
|
||||
f4(const arr[5]) {
|
||||
new a = arr[0];
|
||||
#pragma unused a
|
||||
}
|
||||
f5(arr[][]) { // line 30
|
||||
new a = arr[0][0];
|
||||
#pragma unused a
|
||||
}
|
||||
f6(arr[][]) {
|
||||
arr[0][0] = 0;
|
||||
}
|
||||
|
||||
main () {
|
||||
f0("test"); // line 39
|
||||
f1("test"); // line 40
|
||||
f2("test"); // line 41
|
||||
f3("test");
|
||||
f4("test");
|
||||
|
||||
new arr[5];
|
||||
f1(arr);
|
||||
f2(arr);
|
||||
f3(arr);
|
||||
f4(arr);
|
||||
|
||||
f1(arr[0]);
|
||||
//f2(arr[0]); - array size must match
|
||||
f3(arr[0]);
|
||||
//f4(arr[0]); - array size must match
|
||||
|
||||
new arr2[1][1];
|
||||
f5(arr2);
|
||||
f6(arr2);
|
||||
|
||||
SetTimer("test", 0, 0);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user