changeset 192:014844597bbd

1) updated results 2) adjusted mime type to text/x-dsrc (https://bugs.freedesktop.org/show_bug.cgi?id=676)
author thomask
date Sat, 11 Dec 2004 17:46:49 +0000
parents c5cbab12376d
children 7203f4521cb2
files complex/linking/a.d complex/linking/b.d complex/linking/c.d complex/linking/complex.mak nocompile/return_05.d nocompile/return_06.d nocompile/return_07.d run/command_line_deprecated_01.d run/return_02.d run/return_03.d run/return_04.d run/version_02.d run/version_04.d todo.txt
diffstat 14 files changed, 291 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/complex/linking/a.d	Sat Dec 11 17:46:49 2004 +0000
@@ -0,0 +1,18 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	"Ben Hinkle" <ben.hinkle@gmail.com>
+// @date@	2004-12-07
+// @uri@	news:cp2vjj$1ljt$1@digitaldaemon.com
+// @url@	nntp://news.digitalmars.com/digitalmars.D.bugs
+
+module dstress.complex.linking.a;
+
+struct StructA(T){
+	void set(T x) {
+		y = x;
+	}
+	T y;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/complex/linking/b.d	Sat Dec 11 17:46:49 2004 +0000
@@ -0,0 +1,19 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@     "Ben Hinkle" <ben.hinkle@gmail.com>
+// @date@       2004-12-07
+// @uri@        news:cp2vjj$1ljt$1@digitaldaemon.com
+// @url@        nntp://news.digitalmars.com/digitalmars.D.bugs
+
+module dstress.complex.linking.b;
+
+import dstress.complex.linking.a;
+
+void functB() {
+	StructA!(int)* x;
+	x = new StructA!(int);
+	x.set(10);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/complex/linking/c.d	Sat Dec 11 17:46:49 2004 +0000
@@ -0,0 +1,26 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@     "Ben Hinkle" <ben.hinkle@gmail.com>
+// @date@       2004-12-07
+// @uri@        news:cp2vjj$1ljt$1@digitaldaemon.com
+// @url@        nntp://news.digitalmars.com/digitalmars.D.bugs
+
+module dstress.complex.linking.c;
+
+import dstress.complex.linking.a;
+import dstress.complex.linking.b;
+
+void functC() {
+	StructA!(int)* x;
+	x = new StructA!(int);
+	x.set(100);
+}
+
+int main() {
+	functB();
+	functC();
+	return 0;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/complex/linking/complex.mak	Sat Dec 11 17:46:49 2004 +0000
@@ -0,0 +1,73 @@
+# GnuMakefile for DStress http://dmd.kuehne.cn/dstress.html
+# Copyright (C) 2004 Thomas Kuehne
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+
+#
+# NOTE: almost all tests can be written using __DSTRESS_DFLAGS__
+#
+
+.PHONY: \
+	complex/linking/warning \
+	complex/linking/$(complex_done) \
+	complex/linking/clean \
+	complex/linking/dest
+	
+complex/linking/warning :
+	@echo "don't invoke this file directly, instead use DStress' root Makefile with the target \"complex/linking/complex.done\", \"complex\" or \"all\""
+
+complex/linking/dest = \
+	complex/linking/linking_01 \
+	complex/linking/linking_02 
+
+# the actual target, will be called by root's "all" / "complex" target
+complex/linking/$(complex_done) : $(complex/linking/dest)
+
+#
+# compile all 3 files in 1 step -> link, execute
+#
+complex/linking/linking_01 : complex/linking/a.d complex/linking/b.d complex/linking/c.d
+	$(eval z_name = $@)
+	 @$(RM) -f complex/linking/a.o complex/linking/b.o complex/linking/c.o
+	$(eval z_return = $(shell $(return__) "$(DMD) $(DFLAGS) -od$(OBJ_DIR) -of$@ complex/linking/a.d complex/linking/b.d complex/linking/c.d $(to_log)"))
+	$(analyse_run)
+
+#
+# compile 3 files in 3 steps -> link, execute
+#
+complex/linking/linking_02 : complex/linking/a.d complex/linking/b.d complex/linking/c.d
+	$(eval z_flags = -I.. )
+	@$(RM) -f complex/linking/a.o complex/linking/b.o complex/linking/c.o
+	$(eval z_name = $@_A)
+	$(eval z_return = $(shell $(return__) "$(DMD) $(DFLAGS) $(z_flags) -c -ofcomplex/linking/a.o complex/linking/a.d $(to_log)"))
+	$(analyse_compile)
+
+	$(eval z_name = $@_B)
+	$(eval z_return = $(shell $(return__) "$(DMD) $(DFLAGS) $(z_flags) -c -ofcomplex/linking/b.o complex/linking/b.d $(to_log)"))
+	$(analyse_compile)
+
+	$(eval z_name = $@_C)
+	$(eval z_return = $(shell $(return__) "$(DMD) $(DFLAGS) $(z_flags) -c -ofcomplex/linking/c.o complex/linking/c.d $(to_log)"))
+	$(analyse_compile)
+
+	$(eval z_name = $@)
+	$(eval z_return = $(shell $(return__) "$(DMD) $(DFLAGS) -of$@ complex/linking/a.o complex/linking/b.o complex/linking/c.o $(to_log)"))
+	$(analyse_run)
+
+# this will be called by root's "clean" target
+complex/linking/clean :
+	$(RM) complex/linking/*.done $(complex/linking/dest)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/return_05.d	Sat Dec 11 17:46:49 2004 +0000
@@ -0,0 +1,13 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// path without return 
+
+module dstress.nocompile.return_05;
+
+int main(char[][] args){
+	if(0){
+		return 0;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/return_06.d	Sat Dec 11 17:46:49 2004 +0000
@@ -0,0 +1,13 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// path without return 
+
+module dstress.nocompile.return_06;
+
+int main(char[][] args){
+	if(args.length==0){
+		return 0;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/return_07.d	Sat Dec 11 17:46:49 2004 +0000
@@ -0,0 +1,16 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// path without return 
+
+module dstress.nocompile.return_07;
+
+int main(char[][] args){
+	if(args.length==0){
+		return 0;
+	}else{
+		// dummy
+		args.length==2;
+	}
+}
--- a/run/command_line_deprecated_01.d	Fri Dec 10 19:19:26 2004 +0000
+++ b/run/command_line_deprecated_01.d	Sat Dec 11 17:46:49 2004 +0000
@@ -4,6 +4,6 @@
 
 int main(){
 	int[7] array;
-	assert(array.size == 7);
+	assert(array.size == array.sizeof);
 	return 0;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/return_02.d	Sat Dec 11 17:46:49 2004 +0000
@@ -0,0 +1,22 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+module dstress.run.return_02;
+
+int status;
+
+int test(){
+	try{
+		return -1;
+	}finally{
+		status++;
+	}
+}
+
+int main(){
+	assert(status == 0);
+	assert(test() == -1);
+	assert(status == 1);
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/return_03.d	Sat Dec 11 17:46:49 2004 +0000
@@ -0,0 +1,39 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+module dstress.run.return_03;
+
+int status;
+
+int test(char[][] args){
+	try{
+		try{
+			if(args.length==1){
+				return -1;
+			}
+		}finally{
+			assert(status==0);
+			status+=2;
+		}
+
+		try{
+			assert(0);
+		}finally{
+			assert(0);
+		}
+	}finally{
+		assert(status==2);
+		status+=3;
+	}
+	assert(0);
+	return 0;
+}
+
+int main(char[][] args){
+	assert(status == 0);
+	assert(args.length == 1);
+	assert(test(args) == -1);
+	assert(status == 5);
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/return_04.d	Sat Dec 11 17:46:49 2004 +0000
@@ -0,0 +1,32 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+module dstress.run.return_04;
+
+int status;
+
+int test(char[][] args){
+	try{
+		try{
+			if(args.length==1){
+				return -1;
+			}
+		}finally{
+			assert(status==0);
+			status+=2;
+		}
+	}finally{
+		assert(status==2);
+		status+=3;
+	}
+	return 0;
+}
+
+int main(char[][] args){
+	assert(status == 0);
+	assert(args.length == 1);
+	assert(test(args) == -1);
+	assert(status == 5);
+	return 0;
+}
--- a/run/version_02.d	Fri Dec 10 19:19:26 2004 +0000
+++ b/run/version_02.d	Sat Dec 11 17:46:49 2004 +0000
@@ -15,7 +15,15 @@
 	}
 	
 	version(linux){
-		os++;
+		os=+3;
+	}
+
+	version(darwin){
+		os=+3;
+	}
+
+	version(Unix){
+		os=-2;
 	}
 	
 	assert(os == 1);
--- a/run/version_04.d	Fri Dec 10 19:19:26 2004 +0000
+++ b/run/version_04.d	Sat Dec 11 17:46:49 2004 +0000
@@ -10,6 +10,14 @@
 		cpu++;
 	}
 
+	version(IA64){
+		cpu++;
+	}
+
+	version(PPC){
+		cpu++;
+	}
+
 	assert(cpu==1);
 
 	return 0;
--- a/todo.txt	Fri Dec 10 19:19:26 2004 +0000
+++ b/todo.txt	Sat Dec 11 17:46:49 2004 +0000
@@ -23,7 +23,7 @@
 * keyword: export
 * keyword: extern
 * keyword: function
-* keyword: goto (intervening finally clauses; mutexes)
+* keyword: goto (intervening finally clauses; synchronization objects/mutexes)
 * keyword: idouble
 * keyword: ifloat
 * keyword: import
@@ -34,7 +34,7 @@
 * keyword: private
 * keyword: protected
 * keyword: public
-* keyword: return (enclosing finally clauses, synchronization objects)
+* keyword: return (synchronization objects/mutexes)
 * keyword: struct (anonymous)
 * keyword: synchronized
 * keyword: typeid (alias, typedef, union, ?functions, ?delegates)