lagergren@679: /* lagergren@679: * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. lagergren@679: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. attila@962: * lagergren@679: * This code is free software; you can redistribute it and/or modify it lagergren@679: * under the terms of the GNU General Public License version 2 only, as lagergren@679: * published by the Free Software Foundation. attila@962: * lagergren@679: * This code is distributed in the hope that it will be useful, but WITHOUT lagergren@679: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or lagergren@679: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License lagergren@679: * version 2 for more details (a copy is included in the LICENSE file that lagergren@679: * accompanied this code). attila@962: * lagergren@679: * You should have received a copy of the GNU General Public License version lagergren@679: * 2 along with this work; if not, write to the Free Software Foundation, lagergren@679: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. attila@962: * lagergren@679: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA lagergren@679: * or visit www.oracle.com if you need additional information or have any lagergren@679: * questions. lagergren@679: */ lagergren@679: lagergren@679: /** lagergren@679: * JDK-8028434: Check that the line number of the tests in while and do while loops lagergren@679: * is correct. It needs to correspond to the line with the test expression. lagergren@679: * lagergren@679: * @test lagergren@679: * @run lagergren@679: */ lagergren@679: lagergren@679: try { lagergren@679: while (test.apa < 0) { attila@962: print("x"); lagergren@679: } lagergren@679: } catch (e) { lagergren@679: var st = e.getStackTrace(); lagergren@679: if (st.length != 1) { attila@962: print("erroneous stacktrace length " + s.length); lagergren@679: } lagergren@680: if (st[0].lineNumber !== 33) { attila@962: print("erroneous stacktrace element, lineNumber=" + st[0].lineNumber + " elem=" + st); lagergren@679: } lagergren@679: } lagergren@679: lagergren@679: try { lagergren@679: do { attila@962: print("x"); lagergren@679: } while (test.apa < 0); lagergren@679: } catch (e) { lagergren@679: var st = e.getStackTrace(); lagergren@679: if (st.length != 1) { attila@962: print("erroneous stacktrace length " + s.length); lagergren@679: } lagergren@680: if (st[0].lineNumber !== 49) { attila@962: print("erroneous stacktrace element, lineNumber= " + st[0].lineNumber + " elem=" + st); lagergren@679: } lagergren@679: }