changeset 172:e5bbb877feb9

extended offsetof / offset tests
author thomask
date Wed, 01 Dec 2004 13:53:23 +0000
parents e2ba37f5b797
children 6c00d3fd09ec
files compile/bug_e2ir_1158_A.d nocompile/offset_01.d nocompile/offset_02.d nocompile/offset_03.d nocompile/offsetof_03.d nocompile/offsetof_04.d nocompile/offsetof_05.d nocompile/offsetof_06.d nocompile/offsetof_07.d nocompile/offsetof_08.d run/offsetof_01.d run/offsetof_02.d
diffstat 12 files changed, 120 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compile/bug_e2ir_1158_A.d	Wed Dec 01 13:53:23 2004 +0000
@@ -0,0 +1,12 @@
+// @uri@	news:cok6h5$1p9u$1@digitaldaemon.com
+// @author@	Stewart Gordon <smjg_1998@yahoo.com>
+// @date@	2004-12-01
+// @url@	nntp://news.digitalmars.com/digitalmars.D.bugs/2395
+
+module dstress.compile.bug_e2ir_1158_A;
+
+import std.c.windows.windows;
+
+void main(char[][] args) {
+     HDC dc = (args.length > 1 ? &GetWindowDC : &GetDC) (null);
+}
--- a/nocompile/offset_01.d	Wed Dec 01 12:41:29 2004 +0000
+++ b/nocompile/offset_01.d	Wed Dec 01 13:53:23 2004 +0000
@@ -1,6 +1,6 @@
 // $HeadURL$
 // $Date$
-// Author$
+// $Author$
 
 // .offset is depricated, use .offsetof
 
--- a/nocompile/offset_02.d	Wed Dec 01 12:41:29 2004 +0000
+++ b/nocompile/offset_02.d	Wed Dec 01 13:53:23 2004 +0000
@@ -1,6 +1,6 @@
 // $HeadURL$
 // $Date$
-// Author$
+// $Author$
 
 module dstress.nocompile.offset_02;
 
--- a/nocompile/offset_03.d	Wed Dec 01 12:41:29 2004 +0000
+++ b/nocompile/offset_03.d	Wed Dec 01 13:53:23 2004 +0000
@@ -1,6 +1,6 @@
 // $HeadURL$
 // $Date$
-// Author$
+// $Author$
 
 // .offset isn't supported for unions
 
--- a/nocompile/offsetof_03.d	Wed Dec 01 12:41:29 2004 +0000
+++ b/nocompile/offsetof_03.d	Wed Dec 01 13:53:23 2004 +0000
@@ -1,6 +1,6 @@
 // $HeadURL$
 // $Date$
-// Author$
+// $Author$
 
 module dstress.nocompile.offsetof_03;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/offsetof_04.d	Wed Dec 01 13:53:23 2004 +0000
@@ -0,0 +1,20 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+module dstress.nocompile.offsetof_04;
+
+union MyUnion{
+	int a;
+	void test(){
+	}
+	int b;	
+}
+
+int main(){
+	MyUnion u;
+
+	assert(u.test.offsetof >= 0);
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/offsetof_05.d	Wed Dec 01 13:53:23 2004 +0000
@@ -0,0 +1,22 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// functions are no member fields
+
+module dstress.nocompile.offsetof_05;
+
+struct MyStruct{
+	int a;
+	void test(){
+	}
+	int b;	
+}
+
+int main(){
+	MyStruct s;
+
+	assert(s.test.offsetof >= 0);
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/offsetof_06.d	Wed Dec 01 13:53:23 2004 +0000
@@ -0,0 +1,22 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// functions are no member fields
+
+module dstress.nocompile.offsetof_06;
+
+class MyClass{
+	int a;
+	void test(){
+	}
+	int b;	
+}
+
+int main(){
+	MyClass o = new MyClass();
+
+	assert(o.test.offsetof >= 0);
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/offsetof_07.d	Wed Dec 01 13:53:23 2004 +0000
@@ -0,0 +1,19 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+module dstress.nocompile.offsetof_07;
+
+struct MyStruct{
+	int a;
+	int b;	
+}
+
+int main(){
+	MyStruct s;
+	
+	assert(MyStruct.a.offsetof == s.a.offsetof);
+	assert(MyStruct.b.offsetof == s.a.offsetof);
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/offsetof_08.d	Wed Dec 01 13:53:23 2004 +0000
@@ -0,0 +1,19 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+module dstress.nocompile.offsetof_08;
+
+class MyClass{
+	int a;
+	int b;	
+}
+
+int main(){
+	MyClass c = new MyClass();
+	
+	assert(MyClass.a.offsetof == c.a.offsetof);
+	assert(MyClass.b.offsetof == c.a.offsetof);
+
+	return 0;
+}
--- a/run/offsetof_01.d	Wed Dec 01 12:41:29 2004 +0000
+++ b/run/offsetof_01.d	Wed Dec 01 13:53:23 2004 +0000
@@ -1,6 +1,6 @@
 // $HeadURL$
 // $Date$
-// Author$
+// $Author$
 
 module dstress.run.offsetof_01;
 
--- a/run/offsetof_02.d	Wed Dec 01 12:41:29 2004 +0000
+++ b/run/offsetof_02.d	Wed Dec 01 13:53:23 2004 +0000
@@ -1,6 +1,6 @@
 // $HeadURL$
 // $Date$
-// Author$
+// $Author$
 
 module dstress.run.offsetof_02;