vararg testcases

This commit is contained in:
Wolfgang Bumiller 2013-01-12 16:37:26 +01:00
parent f440c3c614
commit 61b777f575
2 changed files with 24 additions and 0 deletions

14
tests/varargs.qc Normal file
View file

@ -0,0 +1,14 @@
void(string...) print = #1;
string(float) ftos = #2;
void nbva(float a, string...count) {
print("You gave me ", ftos(count), " additional parameters\n");
print("First: ", ...(0, string), "\n");
print("You chose: ", ...(a, string), "\n");
for (a = 0; a < count; ++a)
print("Vararg ", ftos(a), " = ", ...(a, string), "\n");
}
void main() {
nbva(1, "Hello", "You", "There");
}

10
tests/varargs.tmpl Normal file
View file

@ -0,0 +1,10 @@
I: varargs.qc
D: non-builtin vararg support
T: -execute
C: -std=fteqcc -fvariadic-args
M: You gave me 3 additional parameters
M: First: Hello
M: You chose: You
M: Vararg 0 = Hello
M: Vararg 1 = You
M: Vararg 2 = There