blob: 047f20536eea8be815fad854234a3a877aad6450 [file] [log] [blame]
H. Peter Anvin733cbb32008-10-06 18:27:30 -07001;Testname=warning; Arguments=-fbin -omacdef.bin -w+macro-defaults; Files=stdout stderr macdef.bin
2;Testname=nonwarning; Arguments=-fbin -omacdef.bin -w-macro-defaults; Files=stdout stderr macdef.bin
Victor van den Elzen22343c22008-08-06 14:47:54 +02003
4%MACRO mmac_fix 1 a
5 ; While defined to take one parameter, any invocation will
6 ; see two, due to the default parameter.
7 %warning %0 %1 %2 %3 %4 %5
8%ENDMACRO
9mmac_fix one
10
11%MACRO mmac_var 1-2 a,b
12 ; While defined to take one or two parameters, invocations
13 ; will see three, due to the default parameters.
14 %warning %0 %1 %2 %3 %4 %5
15%ENDMACRO
16mmac_var one
17mmac_var one,two
18
19%MACRO mmac_plus 1-2+ a,b
20 ; This does not warn. Although this looks like two default
21 ; parameters, it ends up being only one: the "+" limits it
22 ; to two parameters; if invoked without a second parameter
23 ; the second parameter will be "a,b".
24 %warning %0 %1 %2 %3 %4 %5
25 ;Check rotating behaviour
26%ENDMACRO
27mmac_plus one
28mmac_plus one,two
29mmac_plus one,two,three
30
31%MACRO mmac_star 1-* a,b
32 ; This does not warn. Because the "*" extends the range of
33 ; parameters to infinity, the "a,b" default parameters can
34 ; not exceed that range.
35 %warning %0 %1 %2 %3 %4 %5
36%ENDMACRO
37mmac_star one
38mmac_star one,two
39mmac_star one,two,three
40
41%MACRO mmac_rotate 0-* a,b
42 %warning %0 %1 %2 %3 %4 %5
43 ;%rotate should rotate all parameters
44 %rotate 1
45 %warning %0 %1 %2 %3 %4 %5
46%ENDMACRO
47mmac_rotate
48mmac_rotate one
49mmac_rotate one,two
50mmac_rotate one,two,three
51
52;Scope / evaluation time test
53%define I 0
54%assign J 0
55%xdefine K 0
56
57%MACRO mmac_scope 0 I J K
58 %warning %1 %2 %3
59%ENDMACRO
60
61%define I 1
62%assign J 1
63%xdefine K 1
64mmac_scope