1 # Copyright 2013 the V8 project authors. All rights reserved. 2 # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 # 4 # Redistribution and use in source and binary forms, with or without 5 # modification, are permitted provided that the following conditions 6 # are met: 7 # 1. Redistributions of source code must retain the above copyright 8 # notice, this list of conditions and the following disclaimer. 9 # 2. Redistributions in binary form must reproduce the above copyright 10 # notice, this list of conditions and the following disclaimer in the 11 # documentation and/or other materials provided with the distribution. 12 # 13 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 14 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 24 Tests that our attempts to do peephole Branch(LogicalNot) optimization doesn't break OSR exit's ability to recover the value of LogicalNot. 25 26 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 6 30 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 7 31 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 8 32 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 9 33 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 10 34 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 9 35 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 12 36 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 13 37 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 14 38 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 15 39 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 16 40 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 17 41 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 18 42 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 19 43 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 20 44 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 21 45 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 22 46 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 23 47 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 24 48 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 25 49 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 26 50 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 27 51 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 28 52 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 29 53 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 30 54 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 31 55 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 32 56 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 33 57 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 34 58 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 35 59 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 36 60 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 37 61 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 38 62 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 39 63 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 40 64 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 41 65 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 42 66 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 43 67 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 44 68 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 45 69 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 46 70 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 47 71 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 48 72 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 49 73 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 50 74 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 51 75 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 52 76 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 53 77 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 54 78 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 55 79 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 56 80 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 57 81 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 58 82 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 59 83 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 60 84 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 61 85 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 62 86 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 63 87 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 64 88 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 65 89 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 66 90 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 67 91 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 68 92 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 69 93 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 70 94 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 71 95 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 72 96 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 73 97 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 74 98 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 75 99 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 76 100 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 77 101 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 78 102 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 79 103 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 80 104 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 81 105 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 82 106 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 83 107 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 84 108 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 85 109 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 86 110 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 87 111 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 88 112 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 89 113 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 90 114 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 91 115 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 92 116 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 93 117 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 94 118 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 95 119 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 96 120 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 97 121 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 98 122 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 99 123 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 100 124 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 101 125 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 102 126 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 103 127 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 104 128 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 105 129 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 106 130 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 107 131 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 108 132 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 109 133 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 110 134 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 111 135 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 112 136 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 113 137 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 114 138 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 115 139 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 116 140 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 117 141 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 118 142 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 119 143 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 120 144 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 121 145 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 122 146 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 123 147 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 124 148 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 125 149 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 126 150 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 127 151 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 128 152 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 129 153 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 130 154 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 131 155 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 132 156 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 133 157 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 134 158 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 135 159 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 136 160 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 137 161 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 138 162 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 139 163 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 140 164 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 141 165 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 142 166 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 143 167 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 144 168 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 145 169 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 146 170 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 147 171 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 148 172 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 149 173 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 150 174 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 151 175 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 152 176 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 153 177 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 154 178 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 155 179 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 156 180 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 157 181 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 158 182 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 159 183 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 160 184 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 161 185 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 162 186 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 163 187 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 164 188 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 165 189 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 166 190 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 167 191 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 168 192 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 169 193 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 170 194 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 171 195 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 172 196 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 173 197 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 174 198 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 175 199 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 176 200 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 177 201 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 178 202 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 179 203 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 180 204 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 181 205 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 182 206 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 183 207 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 184 208 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 185 209 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 186 210 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 187 211 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 188 212 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 189 213 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 190 214 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 191 215 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 192 216 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 193 217 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 194 218 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 195 219 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 196 220 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 197 221 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 198 222 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 199 223 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 200 224 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 201 225 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 202 226 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 203 227 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 204 228 PASS foo(i, 5, i == 199 ? 2147483647 : 5) is 2147483847 229 PASS successfullyParsed is true 230 231 TEST COMPLETE 232 233