annotate run/t/template_18_B.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
750
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
1 // $HeadURL$
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
2 // $Date$
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
3 // $Author$
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
4
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
5 // @author@ Don Clugston <dac@nospam.com.au>
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
6 // @date@ 2005-11-14
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 750
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=5463
750
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
8
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
9 module dstress.run.t.template_18_B;
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
10
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
11 template outside(alias s){
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
12 const int outval = s.localval;
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
13 }
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
14
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
15 template test(alias f){
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
16 template local(){
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
17 const int localval = f.x;
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
18 }
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
19
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
20 const int val = outside!(local!()).outval;
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
21 }
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
22
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
23 template a(){
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
24 const int x = 123;
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
25 }
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
26
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
27 int main(){
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
28 static assert( test!( a!() ).val == 123);
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
29
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
30 return 0;
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
31 }
87cc8f744369 Don Clugston <dac@nospam.com.au>
thomask
parents:
diff changeset
32