forked from diffblue/cbmc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request diffblue#1813 from smowton/smowton/fix/cleanup-unu…
…sed-clinits Java frontend: clean up unused clinit symbols
- Loading branch information
Showing
21 changed files
with
134 additions
and
5 deletions.
There are no files selected for viewing
Binary file added
BIN
+251 Bytes
regression/cbmc-java/lazyloading_synthetic_method_cleanup1/Test.class
Binary file not shown.
22 changes: 22 additions & 0 deletions
22
regression/cbmc-java/lazyloading_synthetic_method_cleanup1/Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
public class Test { | ||
|
||
// Refers to, but never instantiates or refers to static fields of, Unused. | ||
// Thus a clinit-wrapper for Unused should be created, but subsequently | ||
// discarded. | ||
Unused u; | ||
|
||
public static void main() { | ||
|
||
} | ||
|
||
} | ||
|
||
class Unused { | ||
|
||
static int x; | ||
|
||
static { | ||
x = 1; | ||
} | ||
|
||
} |
Binary file added
BIN
+268 Bytes
regression/cbmc-java/lazyloading_synthetic_method_cleanup1/Unused.class
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
...ession/cbmc-java/lazyloading_synthetic_method_cleanup1/check_clinit_normally_present.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CORE | ||
Test.class | ||
--show-goto-functions | ||
java::Unused::clinit_wrapper | ||
Unused\.<clinit>\(\) | ||
|
6 changes: 6 additions & 0 deletions
6
...cbmc-java/lazyloading_synthetic_method_cleanup1/check_clinit_removed_by_lazy_loading.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CORE | ||
Test.class | ||
--lazy-methods --show-goto-functions | ||
-- | ||
java::Unused::clinit_wrapper | ||
Unused\.<clinit>\(\) |
5 changes: 5 additions & 0 deletions
5
regression/cbmc-java/lazyloading_synthetic_method_cleanup1/check_runs_with_lazy_loading.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CORE | ||
Test.class | ||
--lazy-methods | ||
VERIFICATION SUCCESSFUL | ||
|
Binary file added
BIN
+252 Bytes
regression/cbmc-java/lazyloading_synthetic_method_cleanup2/Test.class
Binary file not shown.
26 changes: 26 additions & 0 deletions
26
regression/cbmc-java/lazyloading_synthetic_method_cleanup2/Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
public class Test { | ||
|
||
// Refers to, but never instantiates or refers to static fields of, Unused. | ||
// Thus a clinit-wrapper for Unused should be created, but subsequently | ||
// discarded. | ||
Unused1 u; | ||
|
||
public static void main() { | ||
|
||
} | ||
|
||
} | ||
|
||
class Unused1 extends Unused2 { | ||
|
||
} | ||
|
||
class Unused2 { | ||
|
||
static int x; | ||
|
||
static { | ||
x = 1; | ||
} | ||
|
||
} |
Binary file added
BIN
+176 Bytes
regression/cbmc-java/lazyloading_synthetic_method_cleanup2/Unused1.class
Binary file not shown.
Binary file added
BIN
+269 Bytes
regression/cbmc-java/lazyloading_synthetic_method_cleanup2/Unused2.class
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
...ession/cbmc-java/lazyloading_synthetic_method_cleanup2/check_clinit_normally_present.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CORE | ||
Test.class | ||
--show-goto-functions | ||
java::Unused1::clinit_wrapper | ||
java::Unused2::clinit_wrapper | ||
Unused2\.<clinit>\(\) | ||
|
7 changes: 7 additions & 0 deletions
7
...cbmc-java/lazyloading_synthetic_method_cleanup2/check_clinit_removed_by_lazy_loading.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CORE | ||
Test.class | ||
--lazy-methods --show-goto-functions | ||
-- | ||
java::Unused1::clinit_wrapper | ||
java::Unused2::clinit_wrapper | ||
Unused2\.<clinit>\(\) |
5 changes: 5 additions & 0 deletions
5
regression/cbmc-java/lazyloading_synthetic_method_cleanup2/check_runs_with_lazy_loading.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CORE | ||
Test.class | ||
--lazy-methods | ||
VERIFICATION SUCCESSFUL | ||
|
Binary file added
BIN
+333 Bytes
regression/cbmc-java/lazyloading_synthetic_method_cleanup3/Test.class
Binary file not shown.
22 changes: 22 additions & 0 deletions
22
regression/cbmc-java/lazyloading_synthetic_method_cleanup3/Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
public class Test { | ||
|
||
public static void main() { | ||
|
||
} | ||
|
||
public static Opaque unused() { | ||
|
||
// Should cause jbmc to create a synthetic static initialiser for Opaque, | ||
// but because this function isn't called by main() it should then be | ||
// cleaned up as unused. | ||
return Opaque.field; | ||
|
||
} | ||
|
||
} | ||
|
||
class Opaque { | ||
|
||
public static Opaque field; | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
...ession/cbmc-java/lazyloading_synthetic_method_cleanup3/check_clinit_normally_present.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CORE | ||
Test.class | ||
--show-goto-functions | ||
java::Opaque\.<clinit>:\(\)V | ||
java::Opaque::clinit_wrapper |
6 changes: 6 additions & 0 deletions
6
...cbmc-java/lazyloading_synthetic_method_cleanup3/check_clinit_removed_by_lazy_loading.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CORE | ||
Test.class | ||
--lazy-methods --show-goto-functions | ||
-- | ||
java::Opaque\.<clinit>:\(\)V | ||
java::Opaque::clinit_wrapper |
5 changes: 5 additions & 0 deletions
5
regression/cbmc-java/lazyloading_synthetic_method_cleanup3/check_runs_with_lazy_loading.desc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CORE | ||
Test.class | ||
--lazy-methods | ||
VERIFICATION SUCCESSFUL | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters