summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbf/tw15777b.pp
blob: a72f80716f0d89da9e57d3acfd5489170e00acc7 (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{ %opt=-vw -Sew }
{ %fail }

{ has to fail because of the longint/single mixing with the procvars }

{$mode macpas}

program testunivprocparams;

type
	Int8 = -128..127;
	Int16 = integer;
	Int32 = longint;
	Rec32 = packed record f1, f2: Int16 end;

procedure calli32value( procedure pp( i: univ Int32; x: string); i: univ Int32; x: string);
begin
	pp( i, x)
end;
procedure calli32var( procedure pp( var i: univ Int32; x: string); i: univ Int32; x: string);
begin
	pp( i, x)
end;
procedure calli32const( procedure pp( const i: univ Int32; x: string); i: univ Int32; x: string);
begin
	pp( i, x)
end;

procedure psvalue( s: single; x: string);
begin
	writeln( s, ', ', x)
end;
procedure psvar( var s: single; x: string);
begin
	writeln( s, ', ', x)
end;
procedure psconst( const s: single; x: string);
begin
	writeln( s, ', ', x)
end;

procedure pdvalue( d: double; x: string);
begin
	writeln( d, ', ', x)
end;
procedure pdvar( var d: double; x: string);
begin
	writeln( d, ', ', x)
end;
procedure pdconst( const d: double; x: string);
begin
	writeln( d, ', ', x)
end;

procedure pi8value( i8: Int8; x: string);
begin
	writeln( i8, ', ', x)
end;
procedure pi8var( var i8: Int8; x: string);
begin
	writeln( i8, ', ', x)
end;
procedure pi8const( const i8: Int8; x: string);
begin
	writeln( i8, ', ', x)
end;

procedure pi16value( i16: Int16; x: string);
begin
	writeln( i16, ', ', x)
end;
procedure pi16var( var i16: Int16; x: string);
begin
	writeln( i16, ', ', x)
end;
procedure pi16const( const i16: Int16; x: string);
begin
	writeln( i16, ', ', x)
end;

procedure pi32value( i32: Int32; x: string);
begin
	writeln( i32, ', ', x)
end;
procedure pi32var( var i32: Int32; x: string);
begin
	writeln( i32, ', ', x)
end;
procedure pi32const( const i32: Int32; x: string);
begin
	writeln( i32, ', ', x)
end;

procedure variouscalli32;
var
	s: single;
	d: double;
	i8: Int8;
	i16: Int16;
	i32: Int32;
	r: Rec32;
begin
	s:=1.0;
	d:=1.0;
	i8:=1;
	i16:=2;
	r.f1:=3;
	r.f1:=4;
	i32:=5;

  calli32value( psvalue, s, 'psvalue');
  calli32var( psvar, s, 'psvar');
  calli32const( psconst, s, 'psconst');

end;

begin
	variouscalli32
end.