Test6756768.java revision 11707:ad7af1afda7a
1270866Simp/* 2270866Simp * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. 3270866Simp * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4270866Simp * 5270866Simp * This code is free software; you can redistribute it and/or modify it 6270866Simp * under the terms of the GNU General Public License version 2 only, as 7270866Simp * published by the Free Software Foundation. 8270866Simp * 9270866Simp * This code is distributed in the hope that it will be useful, but WITHOUT 10270866Simp * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11270866Simp * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12270866Simp * version 2 for more details (a copy is included in the LICENSE file that 13270866Simp * accompanied this code). 14270866Simp * 15270866Simp * You should have received a copy of the GNU General Public License version 16270866Simp * 2 along with this work; if not, write to the Free Software Foundation, 17270866Simp * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18270866Simp * 19270866Simp * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20270866Simp * or visit www.oracle.com if you need additional information or have any 21270866Simp * questions. 22270866Simp */ 23270866Simp 24270866Simp/** 25270866Simp * @test 26270866Simp * @bug 6756768 27270866Simp * @summary C1 generates invalid code 28270866Simp * 29270866Simp * @run main/othervm -Xcomp compiler.c1.Test6756768 30270866Simp */ 31270866Simp 32270866Simppackage compiler.c1; 33270866Simp 34270866Simpclass Test6756768a 35270866Simp{ 36270866Simp static boolean var_1 = true; 37270866Simp} 38270866Simp 39270866Simpfinal class Test6756768b 40270866Simp{ 41270866Simp static boolean var_24 = false; 42270866Simp static int var_25 = 0; 43270866Simp 44270866Simp static boolean var_temp1 = Test6756768a.var_1 = false; 45270866Simp} 46270866Simp 47270866Simppublic final class Test6756768 extends Test6756768a 48270866Simp{ 49270866Simp final static int var = var_1 ^ (Test6756768b.var_24 ? var_1 : var_1) ? Test6756768b.var_25 : 1; 50270866Simp 51270866Simp static public void main(String[] args) { 52270866Simp if (var != 0) { 53270866Simp throw new InternalError("var = " + var); 54270866Simp } 55270866Simp } 56270866Simp 57270866Simp} 58270866Simp