Mercurial > projects > dstress
annotate run/s/struct_27_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 | 5dcdd1cd6a66 |
children |
rev | line source |
---|---|
1347
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
1 // $HeadURL$ |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
2 // $Date$ |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
3 // $Author$ |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
4 |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
5 // @author@ Tim Fang <timfang2006@126.com> |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
6 // @date@ 2007-01-11 |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=829 |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
8 // @desc@ [Issue 829] struct operator overload returns a wrong value (suspect NRVO bug) |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
9 |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
10 module dstress.run.s.struct_27_C; |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
11 |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
12 struct Vector3{ |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
13 float x; |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
14 |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
15 Vector3 mul(float s){ |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
16 Vector3 ret; |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
17 ret.x = x*s; |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
18 return ret; |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
19 } |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
20 } |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
21 |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
22 int main(){ |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
23 Vector3 a; |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
24 a.x = 1; |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
25 |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
26 a = a.mul(2); |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
27 |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
28 if(2 == a.x){ |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
29 return 0; |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
30 } |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
31 assert(0); |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
32 } |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
33 |
5dcdd1cd6a66
[Issue 829] struct operator overload returns a wrong value (suspect NRVO bug)
thomask
parents:
diff
changeset
|
34 |