Skip to content
Snippets Groups Projects
Commit b96ebc28 authored by Johannes Mey's avatar Johannes Mey
Browse files

cleanup

parent fdbee264
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 625 deletions
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class ForStmt05 {
{
// Test for statement with constant false condition.
for (Object o = i(); false; u()) {
x();
}
y();
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenClassInstance01 {
GenClassInstance01() {
new C(p1(), p2(), new D(p3() + p4()));
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenClassInstance02 {
{
new Object() {
void f() {
notInParentCfg();
}
}.toString();
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenForStmt01 {
{
// Test a labeled break.
loop1:
for (int i = 3 * x; i < 100; ++i, u()) {
while (c()) {
if (i >= 40) {
break loop1;
}
}
}
fin();
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenForStmt02 {
{
// Test a labeled continue.
loop1:
for (int i = 3 * x; i < 100; ++i, u()) {
while (c()) {
if (i >= 40) {
continue loop1;
}
}
}
fin();
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenSwitchStmt01 {
GenSwitchStmt01() {
while (x + y == 400 - z) {
switch (x) {
case -1:
c1();
break;
case 1:
break;
case 3:
c3();
case 2:
c2();
continue;
case 4:
c4();
break;
case 5:
c5();
return;
case 6:
c6();
break;
}
}
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenTryStmt01 {
void f(Exception exception) {
// Test that branches from throw statement go to both all catch clauses.
try {
if (cond()) {
throw exception;
}
x();
} catch (Exception1 e) {
c1();
} catch (Exception2 e) {
c2();
}
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenTryStmt02 {
{
try {
tryBlock();
} catch (Exception unused) {
c1();
} catch (Throwable unused) {
c2();
}
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenTryStmt03 {
{
try {
x();
} catch (Throwable unused) {
c1();
} catch (Exception unused) {
// Never reached.
c2();
} finally {
f();
}
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenTryStmt04 {
void m() {
// Test that finally handlers are generated in separate CFG branches.
// Non-identical CFG nodes with the same name are expected in this graph.
try {
if (condition) {
a();
return;
}
} finally {
x();
}
y();
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenTryStmt05 {
void z() {
try {
try {
if (condition) throw exception;
} finally {
f1();
return;
}
a();
} finally {
f2();
}
b();
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenTryStmt06 {
{
// Abrupt exit from nested finally block.
try {
try {
s();
} finally {
f1();
return;
}
} finally {
f2();
}
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenTryStmt07 {
{
try {
x();
} catch (Throwable unused) {
c1();
return;
} catch (Exception unused) {
// Never reached.
c2();
} finally {
f();
}
y();
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenTryWithResources01 {
{
try (AutoCloseable stream = openStream()) {
stmt();
} catch (IOException e) {
c();
} finally {
f();
}
}
}
/**
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* This is test data, not real source code!
* StmtCfgTest builds and tests the CFG for the first block/method in this class.
*/
class GenTryWithResources02 {
{
try (AutoCloseable s1 = o1();
AutoCloseable s2 = o2()) {
stmt();
} catch (IOException e) {
c();
} finally {
f();
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment