• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /barrelfish-2018-10-04/lib/acpica/tests/aslts/src/runtime/collections/functional/control/ImplicitReturn/
1/*
2 * Some or all of this work - Copyright (c) 2006 - 2016, Intel Corp.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification,
6 * are permitted provided that the following conditions are met:
7 *
8 * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * Neither the name of Intel Corporation nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/*
30 * Test of Impllicit Return
31 *
32 * The last operation of Methods is a standalone Return.
33 */
34
35Name(z137, 137)
36
37Method(mf6f,, Serialized)
38{
39	Name(fl00, 0)
40	Name(i000, 0xabcd0000)
41	Name(i001, 0xabcd0001)
42
43	Method(m000)
44	{
45		Store(0xabcd0002, i001)
46		if (fl00) {
47			Store(0xdddd0000, i001)
48			Return (0)
49		}
50		Return
51	}
52
53	Method(m001)
54	{
55		if (fl00) {
56			Store(0xdddd0001, i001)
57			Return (0)
58		}
59		Store(0xabcd0003, i001)
60		Return
61	}
62
63	Method(m002, 1)
64	{
65		if (fl00) {
66			Store(0xdddd0002, i001)
67			Return (0)
68		}
69		if (fl00) {
70			Return (0)
71		}
72		if (arg0) {
73			Store(0xabcd0004, i001)
74			Return
75		}
76	}
77
78	Method(m003, 1)
79	{
80		if (fl00) {
81			Store(0xdddd0003, i001)
82			Return (0)
83		}
84		if (fl00) {
85			Return (0)
86		}
87		if (arg0) {
88			Store(0xabcd0005, i001)
89		} else {
90			Store(0xabcd0006, i001)
91		}
92		Return
93	}
94
95	Method(m004, 1)
96	{
97		if (fl00) {
98			Return (0)
99		}
100
101		switch (arg0) {
102			case (0) {
103				Store(0xabcd0007, i001)
104			}
105			case (0x12345678) {
106				Store(0xabcd0008, i001)
107			}
108			default {
109				Store(0xabcd0009, i001)
110			}
111		}
112		Return
113	}
114
115	Method(m005)
116	{
117		if (fl00) {
118			Return (0)
119		}
120
121		While (1) {
122			Store(0xabcd000a, i001)
123			Break
124		}
125		Return
126	}
127
128	Method(m006)
129	{
130		if (fl00) {
131			Return (0)
132		}
133
134		Store(0xabcd000b, i001)
135		While (1) {
136			Break
137		}
138		Return
139	}
140
141	Method(m007,, Serialized)
142	{
143		Name(i000, 0)
144		Name(num, 0)
145		Name(lpN0, 0)
146		Name(lpC0, 0)
147
148		Store(10, num)
149
150		Store(num, lpN0)
151		Store(0, lpC0)
152
153		if (fl00) {
154			Return (0)
155		}
156
157		While (lpN0) {
158			if (i000) {
159				Break
160			}
161			Decrement(lpN0)
162			Increment(lpC0)
163			Store(1, i000)
164			Store(0xabcd000c, i001)
165			Continue
166		}
167		Return
168	}
169
170	Method(m008)
171	{
172		Method(m000)
173		{
174			Store(0xabcd000d, i001)
175		}
176
177		if (fl00) {
178			Return (0)
179		}
180
181		m000()
182
183		Return
184	}
185
186
187	// m000
188
189	Store(0xabcd9000, i000)
190
191	CH03("", z137, 0x200, 0, 0)
192
193	Store(m000(), i000)
194
195	if (SLCK) {
196		CH03("", z137, 0x201, 0, 0)
197		if (LNotEqual(i000, 0)) {
198			err("", z137, 0x202, 0, 0, i000, 0)
199		}
200	} else {
201		CH03("", z137, 0x203, 0, 0)
202	}
203
204	// m001
205
206	Store(0xabcd9001, i000)
207
208	CH03("", z137, 0x204, 0, 0)
209
210	Store(m001(), i000)
211
212	if (SLCK) {
213		CH03("", z137, 0x205, 0, 0)
214		if (LNotEqual(i000, 0)) {
215			err("", z137, 0x206, 0, 0, i000, 0)
216		}
217	} else {
218		CH03("", z137, 0x207, 0, 0)
219	}
220
221	// m002
222
223	Store(0xabcd9002, i000)
224
225	CH03("", z137, 0x208, 0, 0)
226
227	Store(m002(1), i000)
228
229	if (SLCK) {
230		CH03("", z137, 0x209, 0, 0)
231		if (LNotEqual(i000, 0)) {
232			err("", z137, 0x20a, 0, 0, i000, 0)
233		}
234	} else {
235		CH03("", z137, 0x20b, 0, 0)
236	}
237
238	// m003
239
240	Store(0xabcd9003, i000)
241
242	CH03("", z137, 0x20c, 0, 0)
243
244	Store(m003(0), i000)
245
246	if (SLCK) {
247		CH03("", z137, 0x20d, 0, 0)
248		if (LNotEqual(i000, 0)) {
249			err("", z137, 0x20e, 0, 0, i000, 0)
250		}
251	} else {
252		CH03("", z137, 0x20f, 0, 0)
253	}
254
255	// m004(0)
256
257	Store(0xabcd9004, i000)
258
259	CH03("", z137, 0x210, 0, 0)
260
261	Store(m004(0), i000)
262
263	if (SLCK) {
264		CH03("", z137, 0x211, 0, 0)
265		if (LNotEqual(i000, 0)) {
266			err("", z137, 0x212, 0, 0, i000, 0)
267		}
268	} else {
269		CH03("", z137, 0x213, 0, 0)
270	}
271
272	// m004(0x12345678)
273
274	Store(0xabcd9005, i000)
275
276	CH03("", z137, 0x214, 0, 0)
277
278	Store(m004(0x12345678), i000)
279
280	if (SLCK) {
281		CH03("", z137, 0x215, 0, 0)
282		if (LNotEqual(i000, 0)) {
283			err("", z137, 0x216, 0, 0, i000, 0)
284		}
285	} else {
286		CH03("", z137, 0x217, 0, 0)
287	}
288
289	// m004(Default)
290
291	Store(0xabcd9006, i000)
292
293	CH03("", z137, 0x218, 0, 0)
294
295	Store(m004(1111), i000)
296
297	if (SLCK) {
298		CH03("", z137, 0x219, 0, 0)
299		if (LNotEqual(i000, 0)) {
300			err("", z137, 0x21a, 0, 0, i000, 0)
301		}
302	} else {
303		CH03("", z137, 0x21b, 0, 0)
304	}
305
306	// m005
307
308	Store(0xabcd9007, i000)
309
310	CH03("", z137, 0x21c, 0, 0)
311
312	Store(m005(), i000)
313
314	if (SLCK) {
315		CH03("", z137, 0x21d, 0, 0)
316		if (LNotEqual(i000, 0)) {
317			err("", z137, 0x21e, 0, 0, i000, 0)
318		}
319	} else {
320		CH03("", z137, 0x21f, 0, 0)
321	}
322
323	// m006
324
325	Store(0xabcd9008, i000)
326
327	CH03("", z137, 0x220, 0, 0)
328
329	Store(m006(), i000)
330
331	if (SLCK) {
332		CH03("", z137, 0x221, 0, 0)
333		if (LNotEqual(i000, 0)) {
334			err("", z137, 0x222, 0, 0, i000, 0)
335		}
336	} else {
337		CH03("", z137, 0x223, 0, 0)
338	}
339
340	// m007
341
342	Store(0xabcd9009, i000)
343
344	CH03("", z137, 0x224, 0, 0)
345
346	Store(m007(), i000)
347
348	if (SLCK) {
349		CH03("", z137, 0x225, 0, 0)
350		if (LNotEqual(i000, 0)) {
351			err("", z137, 0x226, 0, 0, i000, 0)
352		}
353	} else {
354		CH03("", z137, 0x227, 0, 0)
355	}
356
357	// m008
358
359	Store(0xabcd900a, i000)
360
361	CH03("", z137, 0x228, 0, 0)
362
363	Store(m008(), i000)
364
365	if (SLCK) {
366		CH03("", z137, 0x229, 0, 0)
367		if (LNotEqual(i000, 0)) {
368			err("", z137, 0x22a, 0, 0, i000, 0)
369		}
370	} else {
371		CH03("", z137, 0x22b, 0, 0)
372	}
373}
374