From df9ff58aa09ee7f9f9dbbb2e6cba04d39a9a2c34 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 23 Mar 2009 19:44:45 +0000 Subject: [PATCH] small test --- .../OwnershipAnalysisTest/smalltest/makefile | 30 +++++++++++++ .../smalltest/small.java | 43 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 Robust/src/Tests/OwnershipAnalysisTest/smalltest/makefile create mode 100644 Robust/src/Tests/OwnershipAnalysisTest/smalltest/small.java diff --git a/Robust/src/Tests/OwnershipAnalysisTest/smalltest/makefile b/Robust/src/Tests/OwnershipAnalysisTest/smalltest/makefile new file mode 100644 index 00000000..12099614 --- /dev/null +++ b/Robust/src/Tests/OwnershipAnalysisTest/smalltest/makefile @@ -0,0 +1,30 @@ +MAIN_CLASS=small #smalltest + +PROGRAM=test +SOURCE_FILES=small.java #smalltest.java + +BUILDSCRIPT=~/research/Robust/src/buildscript +BSFLAGS= -debug -nooptimize -mainclass $(MAIN_CLASS) -justanalyze -ownership -ownallocdepth 1 -ownwritedots final -ownaliasfile aliases.txt -enable-assertions + +all: $(PROGRAM).bin + +view: PNGs + eog *.png & + +PNGs: DOTs + d2p *COMPLETE*.dot + +DOTs: $(PROGRAM).bin + +$(PROGRAM).bin: $(SOURCE_FILES) + $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM) $(SOURCE_FILES) + +clean: + rm -f $(PROGRAM).bin + rm -fr tmpbuilddirectory + rm -f *~ + rm -f *.dot + rm -f *.png + rm -f aliases.txt + rm -f output.txt + diff --git a/Robust/src/Tests/OwnershipAnalysisTest/smalltest/small.java b/Robust/src/Tests/OwnershipAnalysisTest/smalltest/small.java new file mode 100644 index 00000000..20b4a74e --- /dev/null +++ b/Robust/src/Tests/OwnershipAnalysisTest/smalltest/small.java @@ -0,0 +1,43 @@ +class small { + tiny t1; + foo[] f; + + public small(tiny t) { + t1=t; + f=new foo[100]; + } + + public static void main(String x[]) { + tiny t=new tiny(); + small s=new small(t); + s.process(); + } + + void process() { + while(true) { + createfoo(); + } + } + + public void createfoo() { + foo f=disjoint test new foo(); + this.f[0]=f; + f.t1=t1; + } + + +} + +public class tiny { + int x; + public tiny() { + + } +} + +public class foo { + tiny t1; + public foo() { + + } +} \ No newline at end of file -- 2.34.1