summaryrefslogtreecommitdiff
path: root/tests/methods/bug710862.vala
blob: 856d110ad58dd7f81d8b1b04e92513efa74fc8ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
class Foo : Object {
	[PrintfFormat]
	public void print (string format, ...) {
		var vargs = va_list ();
		print_vargs (format, vargs);
	}

	[PrintfFormat]
	public void print_shift ([FormatArg] string format, int shift, ...) {
		var vargs = va_list ();
		print_shift_vargs (format, shift, vargs);
	}

	[PrintfFormat]
	public void print_vargs (string format, va_list vargs) {
	}

	[PrintfFormat]
	public void print_shift_vargs ([FormatArg] string format, int shift, va_list vargs) {
	}

	[NoWrapper]
	[PrintfFormat]
	public virtual void print_vfunc_vargs (string format, va_list vargs) {
	}

	[NoWrapper]
	[PrintfFormat]
	public virtual void print_vfunc_shift_vargs ([FormatArg] string format, int shift, va_list vargs) {
	}

	[ScanfFormat]
	public void scan (string input, string format, ...) {
	}

	[NoWrapper]
	[ScanfFormat]
	public virtual void scan_vfunc_vargs (string input, string format, va_list vargs) {
	}
}

[PrintfFormat]
void print_something (string format, ...) {
	var vargs = va_list ();
	print_something_vargs (format, vargs);
}

[PrintfFormat]
void print_something_shift ([FormatArg] string format, int shift, ...) {
	var vargs = va_list ();
	print_something_vargs (format, vargs);
}

[PrintfFormat]
void print_something_vargs (string format, va_list vargs) {
}

[PrintfFormat]
void print_something_shift_vargs ([FormatArg] string format, int shift, va_list vargs) {
}

[ScanfFormat]
void scan_something (string input, string format, ...) {
}

void main () {
	int i;

	print_something ("%d", 42);
	print_something_shift ("%d", 0, 42);
	scan_something ("42", "%d", out i);

	var foo = new Foo ();
	foo.print ("%d", 42);
	foo.scan ("42", "%d", out i);
}