annotate run/opIndex_04.d @ 1630:d0efa3ae5522 default tip

run/mini/naked_asm5: New x86_64 ABI passes the arguments in reverse order.
author David Nadlinger <code@klickverbot.at>
date Sat, 23 Apr 2011 22:57:32 +0200
parents b8c0195059d9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
480
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
1 // $HeadURI$
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
2 // $Author$
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
3 // $Date$
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
4
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
5 // @author@ Kevin Bealer <Kevin_member@pathlink.com>
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
6 // @date@ 2005-04-24
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 736
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3808
480
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
8
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
9 module dstress.run.opIndex_04;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
10
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
11 class Range{
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
12 int width(){
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
13 return 1;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
14 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
15 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
16
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
17 class Container {
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
18 this(){
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
19 data.length=2;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
20 data[0]=new Range;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
21 data[1]=new Range;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
22 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
23
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
24 Range opIndex(int i){
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
25 return data[i];
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
26 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
27
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
28 Range[] data;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
29 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
30
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
31 int main(){
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
32 Container ranges=new Container;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
33
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
34 Range r=ranges[0];
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
35 if (r.width == 1){
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
36 return 0;
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
37 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
38
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
39 assert(0);
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
40 }
a3d84fdbfd53 -inline / opIndex / struct
thomask
parents:
diff changeset
41