| 1 |
/* |
| 2 |
* Some or all of this work - Copyright (c) 2006 - 2021, 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 |
* Bug 0031: |
| 30 |
* |
| 31 |
* SUMMARY: The ASL Compiler doesn't try to detect and reject attempts to use object before its declaration is evaluated |
| 32 |
* |
| 33 |
* ASL-compiler doesn't result in Error |
| 34 |
* |
| 35 |
* ATTENTION: |
| 36 |
* |
| 37 |
* Note 1: This test now is a run-time test because the ASL compiler doesn't |
| 38 |
* actually detect and prohibit (my mistake) use of object before its |
| 39 |
* declaration. After this bug of ASL compiler is fixed move this bdemo |
| 40 |
* to non-run-time bug tests but don't forget to move all positive checkings |
| 41 |
* of it in other run-time tests. |
| 42 |
* |
| 43 |
* Note 2: Since the ability itself to tun this test is error |
| 44 |
* the test returns Error unconditionally (Method m1dc). |
| 45 |
* But only one that error is expected. When the bug is |
| 46 |
* fixed we will encounter that the test is no more |
| 47 |
* compiled and fix it (see Note 1). |
| 48 |
*/ |
| 49 |
Name (ID28, 0x00) |
| 50 |
Method (MDC7, 0, Serialized) |
| 51 |
{ |
| 52 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 53 |
I000 = 0x12345678 |
| 54 |
Name (I000, 0x00) |
| 55 |
CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00) |
| 56 |
} |
| 57 |
|
| 58 |
Method (M800, 0, Serialized) |
| 59 |
{ |
| 60 |
Name (I000, 0x00) |
| 61 |
Method (M000, 0, Serialized) |
| 62 |
{ |
| 63 |
Debug = I000 /* \M800.M000.I000 */ |
| 64 |
Name (I000, 0xFFFFFFFF) |
| 65 |
} |
| 66 |
} |
| 67 |
|
| 68 |
Method (M801, 0, NotSerialized) |
| 69 |
{ |
| 70 |
Method (M000, 0, Serialized) |
| 71 |
{ |
| 72 |
Debug = ID28 /* \M801.M000.ID28 */ |
| 73 |
Name (ID28, 0xFFFFFFFF) |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
Method (M802, 0, Serialized) |
| 78 |
{ |
| 79 |
Name (I000, 0x00) |
| 80 |
I000 = 0xABCD0000 |
| 81 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 82 |
Name (I001, 0x00) |
| 83 |
I001 = 0xABCD0001 |
| 84 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 85 |
Name (I002, 0xABCD0002) |
| 86 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 87 |
If (Y084) |
| 88 |
{ |
| 89 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 90 |
Method (M000, 0, Serialized) |
| 91 |
{ |
| 92 |
Name (I000, 0xABCD0003) |
| 93 |
If ((I000 != 0xABCD0003)) |
| 94 |
{ |
| 95 |
ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, I000, 0xABCD0003) |
| 96 |
} |
| 97 |
} |
| 98 |
|
| 99 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 100 |
Method (M001, 0, Serialized) |
| 101 |
{ |
| 102 |
Name (I000, 0xABCD0004) |
| 103 |
I000 = 0xABCD0005 |
| 104 |
If ((I000 != 0xABCD0005)) |
| 105 |
{ |
| 106 |
ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, I000, 0xABCD0005) |
| 107 |
} |
| 108 |
} |
| 109 |
|
| 110 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 111 |
Method (M002, 0, Serialized) |
| 112 |
{ |
| 113 |
Debug = I000 /* \M802.M002.I000 */ |
| 114 |
Name (I000, 0xABCD0006) |
| 115 |
I000 = 0xABCD0007 |
| 116 |
If ((I000 != 0xABCD0007)) |
| 117 |
{ |
| 118 |
ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, I000, 0xABCD0007) |
| 119 |
} |
| 120 |
} |
| 121 |
|
| 122 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 123 |
Method (M003, 0, Serialized) |
| 124 |
{ |
| 125 |
Debug = "------------------------------ 000000000" |
| 126 |
Debug = ID28 /* \M802.M003.ID28 */ |
| 127 |
Name (ID28, 0xABCD0008) |
| 128 |
If ((ID28 != 0xABCD0008)) |
| 129 |
{ |
| 130 |
ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, ID28, 0xABCD0008) |
| 131 |
} |
| 132 |
} |
| 133 |
|
| 134 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 135 |
} |
| 136 |
|
| 137 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 138 |
If ((I000 != 0xABCD0000)) |
| 139 |
{ |
| 140 |
ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, I000, 0xABCD0000) |
| 141 |
} |
| 142 |
|
| 143 |
If ((I001 != 0xABCD0001)) |
| 144 |
{ |
| 145 |
ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, I001, 0xABCD0001) |
| 146 |
} |
| 147 |
|
| 148 |
If ((I002 != 0xABCD0002)) |
| 149 |
{ |
| 150 |
ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, I002, 0xABCD0002) |
| 151 |
} |
| 152 |
|
| 153 |
If (Y084) |
| 154 |
{ |
| 155 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 156 |
M000 () |
| 157 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 158 |
M001 () |
| 159 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 160 |
M002 () |
| 161 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 162 |
M003 () |
| 163 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 164 |
} |
| 165 |
Else |
| 166 |
{ |
| 167 |
SRMT ("sub-tests-of-m802") |
| 168 |
BLCK () |
| 169 |
} |
| 170 |
|
| 171 |
CH03 (__METHOD__, 0x00, __LINE__, 0x00, 0x00) |
| 172 |
II99 = 0xABCD0009 |
| 173 |
Name (II99, 0x00) |
| 174 |
CH04 (__METHOD__, 0x00, 0xFF, 0x00, __LINE__, 0x00, 0x00) |
| 175 |
} |
| 176 |
|
| 177 |
Method (M1DC, 0, NotSerialized) |
| 178 |
{ |
| 179 |
/* Successful compilation itself of this test is error */ |
| 180 |
|
| 181 |
ERR (__METHOD__, ZFFF, __LINE__, 0x00, 0x00, 0x00, 0x00) |
| 182 |
} |
| 183 |
|
| 184 |
Method (MDC6, 0, NotSerialized) |
| 185 |
{ |
| 186 |
SRMT ("mdc7") |
| 187 |
MDC7 () |
| 188 |
SRMT ("m800") |
| 189 |
M800 () |
| 190 |
SRMT ("m801") |
| 191 |
M801 () |
| 192 |
SRMT ("m802") |
| 193 |
M802 () |
| 194 |
SRMT ("m1dc") |
| 195 |
M1DC () |
| 196 |
} |