annotate run/c/creal_29_C.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
744
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
1 // $HeadURL$
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
2 // $Date$
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
3 // $Author$
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
4
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
5 // @author@ Tiago Gasiba <tiago.gasiba@gmail.com>
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
6 // @date@ 2005-11-07
1489
b8c0195059d9 changed nntp: URLs to http: URLs
thomask
parents: 1090
diff changeset
7 // @uri@ http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=5344
744
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
8
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
9 module dstress.run.c.creal_29_C;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
10
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
11 void foo(creal[] data){
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
12 data[0] /= data.length;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
13 }
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
14
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
15 int main(){
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
16 creal[] data;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
17 data.length = 2;
920
5511f9277078 testcase review
thomask
parents: 744
diff changeset
18 data[0] = 4.0L + 2.0Li;
5511f9277078 testcase review
thomask
parents: 744
diff changeset
19 data[1] = 2.0L + 4.0Li;
744
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
20
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
21 foo(data);
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
22
1090
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
23 if(data.length != 2){
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
24 assert(0);
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
25 }
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
26 if(data[0].im != 1.0L){
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
27 assert(0);
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
28 }
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
29 if(data[0].re != 2.0L){
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
30 assert(0);
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
31 }
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
32 if(data[1].im != 4.0L){
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
33 assert(0);
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
34 }
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
35 if(data[1].re != 2.0L){
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
36 assert(0);
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
37 }
f4e98d870b57 pre DMD-0.163 review
thomask
parents: 920
diff changeset
38
744
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
39 return 0;
d64391ac2148 bulk catch up
thomask
parents:
diff changeset
40 }