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 a redundant load of a captured variable that was proven to be a constant doesn't crash the compiler. 25 26 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 30 PASS "" + foo(o, i % 2) is "function () { return x; }" 31 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 32 PASS "" + foo(o, i % 2) is "function () { return x; }" 33 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 34 PASS "" + foo(o, i % 2) is "function () { return x; }" 35 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 36 PASS "" + foo(o, i % 2) is "function () { return x; }" 37 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 38 PASS "" + foo(o, i % 2) is "function () { return x; }" 39 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 40 PASS "" + foo(o, i % 2) is "function () { return x; }" 41 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 42 PASS "" + foo(o, i % 2) is "function () { return x; }" 43 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 44 PASS "" + foo(o, i % 2) is "function () { return x; }" 45 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 46 PASS "" + foo(o, i % 2) is "function () { return x; }" 47 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 48 PASS "" + foo(o, i % 2) is "function () { return x; }" 49 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 50 PASS "" + foo(o, i % 2) is "function () { return x; }" 51 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 52 PASS "" + foo(o, i % 2) is "function () { return x; }" 53 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 54 PASS "" + foo(o, i % 2) is "function () { return x; }" 55 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 56 PASS "" + foo(o, i % 2) is "function () { return x; }" 57 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 58 PASS "" + foo(o, i % 2) is "function () { return x; }" 59 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 60 PASS "" + foo(o, i % 2) is "function () { return x; }" 61 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 62 PASS "" + foo(o, i % 2) is "function () { return x; }" 63 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 64 PASS "" + foo(o, i % 2) is "function () { return x; }" 65 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 66 PASS "" + foo(o, i % 2) is "function () { return x; }" 67 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 68 PASS "" + foo(o, i % 2) is "function () { return x; }" 69 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 70 PASS "" + foo(o, i % 2) is "function () { return x; }" 71 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 72 PASS "" + foo(o, i % 2) is "function () { return x; }" 73 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 74 PASS "" + foo(o, i % 2) is "function () { return x; }" 75 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 76 PASS "" + foo(o, i % 2) is "function () { return x; }" 77 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 78 PASS "" + foo(o, i % 2) is "function () { return x; }" 79 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 80 PASS "" + foo(o, i % 2) is "function () { return x; }" 81 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 82 PASS "" + foo(o, i % 2) is "function () { return x; }" 83 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 84 PASS "" + foo(o, i % 2) is "function () { return x; }" 85 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 86 PASS "" + foo(o, i % 2) is "function () { return x; }" 87 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 88 PASS "" + foo(o, i % 2) is "function () { return x; }" 89 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 90 PASS "" + foo(o, i % 2) is "function () { return x; }" 91 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 92 PASS "" + foo(o, i % 2) is "function () { return x; }" 93 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 94 PASS "" + foo(o, i % 2) is "function () { return x; }" 95 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 96 PASS "" + foo(o, i % 2) is "function () { return x; }" 97 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 98 PASS "" + foo(o, i % 2) is "function () { return x; }" 99 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 100 PASS "" + foo(o, i % 2) is "function () { return x; }" 101 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 102 PASS "" + foo(o, i % 2) is "function () { return x; }" 103 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 104 PASS "" + foo(o, i % 2) is "function () { return x; }" 105 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 106 PASS "" + foo(o, i % 2) is "function () { return x; }" 107 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 108 PASS "" + foo(o, i % 2) is "function () { return x; }" 109 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 110 PASS "" + foo(o, i % 2) is "function () { return x; }" 111 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 112 PASS "" + foo(o, i % 2) is "function () { return x; }" 113 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 114 PASS "" + foo(o, i % 2) is "function () { return x; }" 115 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 116 PASS "" + foo(o, i % 2) is "function () { return x; }" 117 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 118 PASS "" + foo(o, i % 2) is "function () { return x; }" 119 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 120 PASS "" + foo(o, i % 2) is "function () { return x; }" 121 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 122 PASS "" + foo(o, i % 2) is "function () { return x; }" 123 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 124 PASS "" + foo(o, i % 2) is "function () { return x; }" 125 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 126 PASS "" + foo(o, i % 2) is "function () { return x; }" 127 PASS "" + foo(o, i % 2) is "function () { return 32; },function () { return 32; }" 128 PASS "" + foo(o, i % 2) is "function () { return x; }" 129 PASS successfullyParsed is true 130 131 TEST COMPLETE 132 133