2
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
27
* @summary Ensure no assert error in C2 with deeply nested synchronize
29
* @run main/othervm -XX:CompileCommand=compileonly,compiler.locks.TestNestedSynchronize::test
31
* compiler.locks.TestNestedSynchronize
34
package compiler.locks;
36
public class TestNestedSynchronize {
38
public static void main(String[] args) {
42
public static void test() {
44
synchronized (TestNestedSynchronize.class) {
45
synchronized (TestNestedSynchronize.class) {
46
synchronized (TestNestedSynchronize.class) {
47
synchronized (TestNestedSynchronize.class) {
48
synchronized (TestNestedSynchronize.class) {
49
synchronized (TestNestedSynchronize.class) {
50
synchronized (TestNestedSynchronize.class) {
51
synchronized (TestNestedSynchronize.class) {
52
synchronized (TestNestedSynchronize.class) {
53
synchronized (TestNestedSynchronize.class) {
54
synchronized (TestNestedSynchronize.class) {
55
synchronized (TestNestedSynchronize.class) {
56
synchronized (TestNestedSynchronize.class) {
57
synchronized (TestNestedSynchronize.class) {
58
synchronized (TestNestedSynchronize.class) {
59
synchronized (TestNestedSynchronize.class) {
60
synchronized (TestNestedSynchronize.class) {
61
synchronized (TestNestedSynchronize.class) {
62
synchronized (TestNestedSynchronize.class) {
63
synchronized (TestNestedSynchronize.class) {
64
synchronized (TestNestedSynchronize.class) {
65
synchronized (TestNestedSynchronize.class) {
66
synchronized (TestNestedSynchronize.class) {
67
synchronized (TestNestedSynchronize.class) {
68
synchronized (TestNestedSynchronize.class) {
69
synchronized (TestNestedSynchronize.class) {
70
synchronized (TestNestedSynchronize.class) {
71
synchronized (TestNestedSynchronize.class) {
72
synchronized (TestNestedSynchronize.class) {
73
synchronized (TestNestedSynchronize.class) {
74
synchronized (TestNestedSynchronize.class) {
75
synchronized (TestNestedSynchronize.class) {
76
synchronized (TestNestedSynchronize.class) {
77
synchronized (TestNestedSynchronize.class) {
78
synchronized (TestNestedSynchronize.class) {
79
synchronized (TestNestedSynchronize.class) {
80
synchronized (TestNestedSynchronize.class) {
81
synchronized (TestNestedSynchronize.class) {
82
synchronized (TestNestedSynchronize.class) {
83
synchronized (TestNestedSynchronize.class) {
84
synchronized (TestNestedSynchronize.class) {
85
synchronized (TestNestedSynchronize.class) {
86
synchronized (TestNestedSynchronize.class) {
87
synchronized (TestNestedSynchronize.class) {
88
synchronized (TestNestedSynchronize.class) {
89
synchronized (TestNestedSynchronize.class) {
90
synchronized (TestNestedSynchronize.class) {
91
synchronized (TestNestedSynchronize.class) {
92
synchronized (TestNestedSynchronize.class) {
93
synchronized (TestNestedSynchronize.class) {
94
synchronized (TestNestedSynchronize.class) {
95
synchronized (TestNestedSynchronize.class) {
96
synchronized (TestNestedSynchronize.class) {
97
synchronized (TestNestedSynchronize.class) {
98
synchronized (TestNestedSynchronize.class) {
99
synchronized (TestNestedSynchronize.class) {
100
synchronized (TestNestedSynchronize.class) {
101
synchronized (TestNestedSynchronize.class) {
102
synchronized (TestNestedSynchronize.class) {
103
synchronized (TestNestedSynchronize.class) {
104
synchronized (TestNestedSynchronize.class) {
105
synchronized (TestNestedSynchronize.class) {
106
synchronized (TestNestedSynchronize.class) {
107
synchronized (TestNestedSynchronize.class) {
108
synchronized (TestNestedSynchronize.class) {
109
synchronized (TestNestedSynchronize.class) {
110
synchronized (TestNestedSynchronize.class) {
111
synchronized (TestNestedSynchronize.class) {
112
synchronized (TestNestedSynchronize.class) {
113
synchronized (TestNestedSynchronize.class) {
114
synchronized (TestNestedSynchronize.class) {
115
synchronized (TestNestedSynchronize.class) {
116
synchronized (TestNestedSynchronize.class) {
117
synchronized (TestNestedSynchronize.class) {
118
synchronized (TestNestedSynchronize.class) {
119
synchronized (TestNestedSynchronize.class) {
120
synchronized (TestNestedSynchronize.class) {
121
synchronized (TestNestedSynchronize.class) {
122
synchronized (TestNestedSynchronize.class) {
123
synchronized (TestNestedSynchronize.class) {
124
synchronized (TestNestedSynchronize.class) {
125
synchronized (TestNestedSynchronize.class) {
126
synchronized (TestNestedSynchronize.class) {
127
synchronized (TestNestedSynchronize.class) {
128
synchronized (TestNestedSynchronize.class) {
129
synchronized (TestNestedSynchronize.class) {
130
synchronized (TestNestedSynchronize.class) {
131
synchronized (TestNestedSynchronize.class) {
132
synchronized (TestNestedSynchronize.class) {
133
synchronized (TestNestedSynchronize.class) {
134
synchronized (TestNestedSynchronize.class) {
135
synchronized (TestNestedSynchronize.class) {
136
synchronized (TestNestedSynchronize.class) {
137
synchronized (TestNestedSynchronize.class) {
138
synchronized (TestNestedSynchronize.class) {
139
synchronized (TestNestedSynchronize.class) {