changeset 611:697d0f7b0fe8

Sean Kelly <sean@f4.ca> 2005-07-31 news:dciqn7$73f$1@digitaldaemon.com
author thomask
date Tue, 02 Aug 2005 22:46:24 +0000
parents 046fc75257d5
children b5fc547b3fd1
files run/v/volatile_01_A.d run/v/volatile_01_B.d
diffstat 2 files changed, 52 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/v/volatile_01_A.d	Tue Aug 02 22:46:24 2005 +0000
@@ -0,0 +1,26 @@
+// $HeadURL$
+// $Date$
+// $Autor$
+
+// @author@	Sean Kelly <sean@f4.ca>
+// @date@	2005-07-31
+// @uri@	news:dciqn7$73f$1@digitaldaemon.com
+	
+module dstress.run.v.volatile_01_A;
+
+template load( T, int i, size_t sizeofT : 4 = T.sizeof ){
+	T load( inout T val ){
+		volatile asm{
+			naked;
+			mov EAX, [EAX];
+			ret;
+		}
+	}
+}
+
+int main(){
+	int i;
+	load!(int,1)(i);
+	load!(int,2)(i);
+	return 0;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/v/volatile_01_B.d	Tue Aug 02 22:46:24 2005 +0000
@@ -0,0 +1,26 @@
+// $HeadURL$
+// $Date$
+// $Autor$
+
+// @author@	Sean Kelly <sean@f4.ca>
+// @date@	2005-07-31
+// @uri@	news:dciqn7$73f$1@digitaldaemon.com
+	
+module dstress.run.v.volatile_01_B;
+
+template load( T, int i, size_t sizeofT : 4 = T.sizeof ){
+	T load( inout T val ){
+		asm{
+			naked;
+			mov EAX, [EAX];
+			ret;
+		}
+	}
+}
+
+int main(){
+	int i;
+	load!(int,1)(i);
+	load!(int,2)(i);
+	return 0;
+}
\ No newline at end of file