From 0b1c1ebf2098527214be6ba9c3676f45a9ce412b Mon Sep 17 00:00:00 2001 From: jjenista Date: Tue, 30 Mar 2010 21:39:53 +0000 Subject: [PATCH] a test that shows our analysis doesn't always terminate --- .../Tests/disjoint/nonTermination1/makefile | 33 +++++++++++++++++++ .../Tests/disjoint/nonTermination1/test.java | 22 +++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Robust/src/Tests/disjoint/nonTermination1/makefile create mode 100644 Robust/src/Tests/disjoint/nonTermination1/test.java diff --git a/Robust/src/Tests/disjoint/nonTermination1/makefile b/Robust/src/Tests/disjoint/nonTermination1/makefile new file mode 100644 index 00000000..28536c97 --- /dev/null +++ b/Robust/src/Tests/disjoint/nonTermination1/makefile @@ -0,0 +1,33 @@ +PROGRAM=test + +SOURCE_FILES=$(PROGRAM).java + +BUILDSCRIPT=~/research/Robust/src/buildscript + + +BSFLAGS= -mainclass Test -justanalyze -disjoint -disjoint-k 2 -disjoint-write-dots final -enable-assertions + +all: $(PROGRAM).bin + +view: PNGs + eog *.png & + +PNGs: DOTs + d2p *COMPLETE*.dot + +DOTs: $(PROGRAM).bin + +$(PROGRAM).bin: $(SOURCE_FILES) + $(BUILDSCRIPT) $(BSFLAGS) $(DEBUGFLAGS) -o $(PROGRAM) $(SOURCE_FILES) + +OLDBSFLAGS= -mainclass Test -justanalyze -ownership -ownallocdepth 1 -ownwritedots final -enable-assertions +old: $(SOURCE_FILES) + $(BUILDSCRIPT) $(OLDBSFLAGS) -o $(PROGRAM) $(SOURCE_FILES) + +clean: + rm -f $(PROGRAM).bin + rm -fr tmpbuilddirectory + rm -f *~ + rm -f *.dot + rm -f *.png + rm -f aliases.txt diff --git a/Robust/src/Tests/disjoint/nonTermination1/test.java b/Robust/src/Tests/disjoint/nonTermination1/test.java new file mode 100644 index 00000000..6a1e6dab --- /dev/null +++ b/Robust/src/Tests/disjoint/nonTermination1/test.java @@ -0,0 +1,22 @@ +public class Foo { + public Foo() {} + public Foo f; +} + +public class Test { + + static public void main( String[] args ) { + + Foo x = null; + Foo y = new Foo(); + + while( false ) { + addSomething( x ); + x = y; + } + } + + public static void addSomething( Foo z ) { + z.f = new Foo(); + } +} -- 2.34.1